diff options
author | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-03 22:05:52 +0200 |
---|---|---|
committer | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-03 22:05:52 +0200 |
commit | e6e9663d40f7aab9e1982dddcaa11386551ad182 (patch) | |
tree | 39c2a34aa78d4723e8308d270e872f61da3818ca | |
parent | 20b85c03e751b4876fa3c92040464e483172b746 (diff) |
fix issues preventing compilationjannis
-rw-r--r-- | src/control.c | 2 | ||||
-rw-r--r-- | src/include/control.h | 2 | ||||
-rw-r--r-- | src/include/dkim.h | 5 | ||||
-rw-r--r-- | src/include/dkimsign.h | 1 | ||||
-rw-r--r-- | src/include/dkimverify.h | 1 | ||||
-rw-r--r-- | src/include/sha256.h | 3 | ||||
-rw-r--r-- | src/ipmeprint.c | 4 | ||||
-rw-r--r-- | src/qbiff.c | 2 | ||||
-rw-r--r-- | src/qmail-qmtpd.c | 2 | ||||
-rw-r--r-- | src/qmail-remote.c | 6 | ||||
-rw-r--r-- | src/qmail-send.c | 15 | ||||
-rw-r--r-- | src/qmail-showctl.c | 2 | ||||
-rw-r--r-- | src/qmail-smtpam.c | 6 | ||||
-rw-r--r-- | src/qmail-smtpd.c | 2 | ||||
-rw-r--r-- | src/spf.c | 2 | ||||
-rw-r--r-- | src/spfdnsip.c | 4 | ||||
-rw-r--r-- | src/tcpto.c | 4 | ||||
-rw-r--r-- | src/tls_remote.c | 3 |
18 files changed, 38 insertions, 28 deletions
diff --git a/src/control.c b/src/control.c index d595c0f..d3d12ad 100644 --- a/src/control.c +++ b/src/control.c @@ -77,7 +77,7 @@ int control_readline(stralloc *sa, char *fn) return 1; } -int control_readint(int *i, char *fn) +int control_readint(unsigned long *i, char *fn) { unsigned long u; diff --git a/src/include/control.h b/src/include/control.h index fdd72b3..6d10345 100644 --- a/src/include/control.h +++ b/src/include/control.h @@ -6,7 +6,7 @@ int control_init(void); int control_readline(stralloc *, char *); int control_rldef(stralloc *, char *, int, char *); -int control_readint(int *, char *); +int control_readint(unsigned long *, char *); int control_readfile(stralloc *, char *, int); #endif diff --git a/src/include/dkim.h b/src/include/dkim.h index 27c3b73..a74b785 100644 --- a/src/include/dkim.h +++ b/src/include/dkim.h @@ -19,6 +19,9 @@ * Changes done by ¢feh@fehcom.de obeying the above license * *****************************************************************************/ +#ifndef DKIM_H_INCLUDE +#define DKIM_H_INCLUDE + #define DKIM_CALL #define MAKELONG(a, b) ((long)(((unsigned)(a) & 0xffff) | (((unsigned)(b) & 0xffff) << 16))) @@ -152,3 +155,5 @@ const char *DKIM_ErrorResult(const int); #ifdef __cplusplus } #endif + +#endif diff --git a/src/include/dkimsign.h b/src/include/dkimsign.h index 75d33de..49259ba 100644 --- a/src/include/dkimsign.h +++ b/src/include/dkimsign.h @@ -22,6 +22,7 @@ #ifndef DKIMSIGN_H #define DKIMSIGN_H +#include "dkim.h" #include "dkimbase.h" class CDKIMSign : public CDKIMBase { diff --git a/src/include/dkimverify.h b/src/include/dkimverify.h index fb7d564..8347957 100644 --- a/src/include/dkimverify.h +++ b/src/include/dkimverify.h @@ -24,6 +24,7 @@ #include <vector> +#include "dkim.h" #include "dkimbase.h" /* not used anymore diff --git a/src/include/sha256.h b/src/include/sha256.h index 8c920b1..80ee0ab 100644 --- a/src/include/sha256.h +++ b/src/include/sha256.h @@ -1,6 +1,9 @@ #ifndef SHA256_H #define SHA256_H +#include <stddef.h> +#include <stdint.h> + typedef struct { uint8_t data[64]; uint32_t datalen; diff --git a/src/ipmeprint.c b/src/ipmeprint.c index 9c92138..d7886b6 100644 --- a/src/ipmeprint.c +++ b/src/ipmeprint.c @@ -23,8 +23,8 @@ int main() for (j = 0; j < ipme.len; ++j) { switch (ipme.ix[j].af) { - case AF_INET: buffer_put(buffer_1, ipaddr, ip4_fmt(ipaddr, &ipme.ix[j].addr.ip4.d)); break; - case AF_INET6: buffer_put(buffer_1, ipaddr, ip6_fmt(ipaddr, &ipme.ix[j].addr.ip6.d)); break; + case AF_INET: buffer_put(buffer_1, ipaddr, ip4_fmt(ipaddr, ipme.ix[j].addr.ip4.d)); break; + case AF_INET6: buffer_put(buffer_1, ipaddr, ip6_fmt(ipaddr, ipme.ix[j].addr.ip6.d)); break; default: buffer_puts(buffer_1, "Unknown address family = "); buffer_put(buffer_1, ipaddr, fmt_ulong(ipaddr, ipme.ix[j].af)); diff --git a/src/qbiff.c b/src/qbiff.c index 800e1f2..0fda293 100644 --- a/src/qbiff.c +++ b/src/qbiff.c @@ -116,7 +116,7 @@ int main() if (fdutmp == -1) _exit(0); buffer_init(&b, read, fdutmp, bufutmp, sizeof(bufutmp)); - while (buffer_get(&b, &ut, sizeof(ut)) == sizeof(ut)) { + while (buffer_get(&b, (char *)&ut, sizeof(ut)) == sizeof(ut)) { if (!str_diffn(ut.ut_name, user, sizeof(ut.ut_name))) { #else while ((ut = getutxent()) != 0) { diff --git a/src/qmail-qmtpd.c b/src/qmail-qmtpd.c index b3a121d..9cbc682 100644 --- a/src/qmail-qmtpd.c +++ b/src/qmail-qmtpd.c @@ -78,7 +78,7 @@ void getcomma() if (ch != ',') badproto(); } -unsigned int databytes = 0; +unsigned long databytes = 0; unsigned int bytestooverflow = 0; struct qmail qq; diff --git a/src/qmail-remote.c b/src/qmail-remote.c index ddb4d65..85b2cbd 100644 --- a/src/qmail-remote.c +++ b/src/qmail-remote.c @@ -296,9 +296,9 @@ void dropped() zerodie(); } -int timeoutconnect = 60; +long timeoutconnect = 60; int smtpfd; -int timeout = 1200; +long timeout = 1200; ssize_t saferead(int fd, char *buf, int len) { @@ -553,7 +553,7 @@ void tls_peercheck() if (flagtls < 100) flagtls = 100; X509_free(cert); - X509_free(certs); + sk_X509_free(certs); return; } diff --git a/src/qmail-send.c b/src/qmail-send.c index 31aa60e..13800f4 100644 --- a/src/qmail-send.c +++ b/src/qmail-send.c @@ -40,8 +40,8 @@ #include "sendtodo.h" #include "trigger.h" -int lifetime = 604800; -int bouncemaxbytes = 0; +long lifetime = 604800; +long bouncemaxbytes = 0; stralloc percenthack = {0}; struct constmap mappercenthack; @@ -444,14 +444,15 @@ void pqfinish() { int c; struct prioq_elt pe; - time_t ut[2]; /* XXX: more portable than utimbuf, but still worrisome */ + //time_t ut[2]; /* XXX: more portable than utimbuf, but still worrisome */ + struct utimbuf ut; for (c = 0; c < CHANNELS; ++c) { while (prioq_min(&pqchan[c], &pe)) { prioq_delmin(&pqchan[c]); fnmake_chanaddr(pe.id, c); - ut[0] = ut[1] = pe.dt; - if (utime(fn.s, ut) == -1) + ut.actime = ut.modtime = pe.dt; + if (utime(fn.s, &ut) == -1) log3s("warning: unable to utime ", fn.s, "; message will be retried too soon\n"); } } @@ -796,8 +797,8 @@ struct del { }; unsigned long masterdelid = 1; -unsigned int concurrency[CHANNELS] = {10, 20}; -unsigned int concurrencyused[CHANNELS] = {0, 0}; +unsigned long concurrency[CHANNELS] = {10, 20}; +unsigned long concurrencyused[CHANNELS] = {0, 0}; struct del *d[CHANNELS]; stralloc dline[CHANNELS]; char delbuf[2048]; diff --git a/src/qmail-showctl.c b/src/qmail-showctl.c index 6339707..38568f0 100644 --- a/src/qmail-showctl.c +++ b/src/qmail-showctl.c @@ -40,7 +40,7 @@ void safeput(char *buf, unsigned int len) void do_int(char *fn, char *def, char *pre, char *post) { - int i; + long i; buffer_puts(buffer_1, "\n"); buffer_puts(buffer_1, fn); buffer_puts(buffer_1, ": "); diff --git a/src/qmail-smtpam.c b/src/qmail-smtpam.c index 77f0718..75c0c65 100644 --- a/src/qmail-smtpam.c +++ b/src/qmail-smtpam.c @@ -213,9 +213,9 @@ void dropped() zerodie(); } -int timeoutconnect = 60; +long timeoutconnect = 60; int smtpfd; -int timeout = 1200; +long timeout = 1200; ssize_t saferead(int fd, char *buf, int len) { @@ -661,7 +661,7 @@ int main(int argc, char **argv) } } - r = timeoutconn(smtpfd, &ip.ix[i].addr, (unsigned int)port, timeoutconnect, ifidx); + r = timeoutconn(smtpfd, ip.ix[i].addr.ip4.d, (unsigned int)port, timeoutconnect, ifidx); if (r == 0) { tcpto_err(&ip.ix[i], 0); partner = ip.ix[i]; diff --git a/src/qmail-smtpd.c b/src/qmail-smtpd.c index 035eecf..63c7582 100644 --- a/src/qmail-smtpd.c +++ b/src/qmail-smtpd.c @@ -57,7 +57,7 @@ #define BUFFER_SIZE 1024 #define MAXHOPS 100 unsigned long databytes = 0; -int timeout = 1200; +long timeout = 1200; int modssl_info(); @@ -104,7 +104,7 @@ int spf_query( if (!stralloc_copys(&domain, spfmf.s + at + 1)) return SPF_NOMEM; } else { // if (!stralloc_0(&spfhelo)) return SPF_NOMEM; - if (!stralloc_copys(&domain, &spfhelo)) return SPF_NOMEM; + if (!stralloc_copy(&domain, &spfhelo)) return SPF_NOMEM; } if (!stralloc_copy(&identity, &domain)) return SPF_NOMEM; } diff --git a/src/spfdnsip.c b/src/spfdnsip.c index f2a802e..4e05b31 100644 --- a/src/spfdnsip.c +++ b/src/spfdnsip.c @@ -207,10 +207,10 @@ int spf_mx(char *spfspec, char *prefix) r = SPF_NONE; for (j = 0; j < ia.len; ++j) { if (byte_diff(ip6remote, 16, V6localnet) && !ip6_isv4mapped(ip6remote)) { - if (match_ip6(&ia.ix[j].addr.ip6.d, ipprefix, ip6remote)) return SPF_OK; + if (match_ip6(ia.ix[j].addr.ip6.d, ipprefix, ip6remote)) return SPF_OK; } if (byte_diff(ip4remote, 4, V4localnet)) { - if (match_ip4(&ia.ix[j].addr.ip4.d, ipprefix, ip4remote)) return SPF_OK; + if (match_ip4(ia.ix[j].addr.ip4.d, ipprefix, ip4remote)) return SPF_OK; } } } diff --git a/src/tcpto.c b/src/tcpto.c index 243d4ba..2e2805e 100644 --- a/src/tcpto.c +++ b/src/tcpto.c @@ -49,7 +49,7 @@ static int getbuf() int tcpto(struct ip_mx *ix) { int af = ix->af; - struct ip_address *ip = &ix->addr; + struct ip_address *ip = &ix->addr.ip4; int n; int i; char *record; @@ -84,7 +84,7 @@ int tcpto(struct ip_mx *ix) void tcpto_err(struct ip_mx *ix, int flagerr) { int af = ix->af; - struct ip_address *ip = &ix->addr; + struct ip_address *ip = &ix->addr.ip4; int n; int i; char *record; diff --git a/src/tls_remote.c b/src/tls_remote.c index fd72033..dde4dff 100644 --- a/src/tls_remote.c +++ b/src/tls_remote.c @@ -56,7 +56,6 @@ int tls_conn(SSL *ssl, int smtpfd) int tls_checkpeer(SSL *ssl, X509 *cert, const stralloc host, const int flag, const int verify) { - STACK_OF(GENERAL_NAME) * extensions; const GENERAL_NAME *ext; char buf[SSL_NAME_LEN]; char *dnsname = 0; @@ -74,7 +73,7 @@ int tls_checkpeer(SSL *ssl, X509 *cert, const stralloc host, const int flag, con /* X.509 CA DN/SAN name validation against DNS */ if (host.len && fflag > 4) { - extensions = (GENERAL_NAME *)X509_get_ext_d2i(cert, NID_subject_alt_name, 0, 0); + GENERAL_NAMES *extensions = X509_get_ext_d2i(cert, NID_subject_alt_name, 0, 0); num = sk_GENERAL_NAME_num(extensions); /* num = 0, if no SAN extensions */ for (i = 0; i < num; ++i) { |