diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-02-06 21:11:47 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-02-06 21:11:47 +0000 |
commit | 5ef36a85c4d6d3239660983a4464b654d4584cea (patch) | |
tree | d7c5476af961a5e1bbf7287ad0a7f747edb9ab62 | |
parent | 851f54b5110ba2abe88784399bbd55303d48e0aa (diff) | |
download | mailfromd-5ef36a85c4d6d3239660983a4464b654d4584cea.tar.gz mailfromd-5ef36a85c4d6d3239660983a4464b654d4584cea.tar.bz2 |
Ported r1606 from trunk.
* src/dnsbase.c: Define MAX, if necessary.
* src/mailfromd.h: Define INADDR_NONE.
* configure.ac: Check for librt.
Add auth to AM_GNU_MAILUTILS.
* gacopyz/server.c (srv_connect): Fix typo.
* gacopyz/gacopyz.c (do_connect): Fix typo.
* bootstrap (MODLIST): Add vasprintf.
* configure.ac: Check for libsocket and libnsl.
* src/dnsbase.c (dns_resolve_hostname,a_lookup): Change
initialization of domainbuf.
* src/syslog_async.c: Include fcntl.h.
git-svn-id: file:///svnroot/mailfromd/branches/gmach@1607 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r-- | ChangeLog | 16 | ||||
-rwxr-xr-x | bootstrap | 3 | ||||
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | gacopyz/gacopyz.c | 2 | ||||
-rw-r--r-- | gacopyz/server.c | 2 | ||||
-rw-r--r-- | lib/syslog_async.c | 1 | ||||
-rw-r--r-- | mfd/dnsbase.c | 13 | ||||
-rw-r--r-- | mfd/mailfromd.h | 4 |
8 files changed, 38 insertions, 8 deletions
@@ -1,3 +1,19 @@ +2008-02-06 Sergey Poznyakoff <gray@gnu.org.ua> + + Ported r1606 from trunk. + + * src/dnsbase.c: Define MAX, if necessary. + * src/mailfromd.h: Define INADDR_NONE. + * configure.ac: Check for librt. + Add auth to AM_GNU_MAILUTILS. + * gacopyz/server.c (srv_connect): Fix typo. + * gacopyz/gacopyz.c (do_connect): Fix typo. + * bootstrap (MODLIST): Add vasprintf. + * configure.ac: Check for libsocket and libnsl. + * src/dnsbase.c (dns_resolve_hostname,a_lookup): Change + initialization of domainbuf. + * src/syslog_async.c: Include fcntl.h. + 2008-02-01 Sergey Poznyakoff <gray@gnu.org.ua> * pies/pies.c (progman_wake_disabled): Renamed to @@ -18,7 +18,8 @@ MODLIST="argp\ regex\ save-cwd\ snprintf\ - strtok_r" + strtok_r\ + vasprintf" MODAVOID="xalloc-die openat-die" diff --git a/configure.ac b/configure.ac index a03c7476..695d0b32 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,9 @@ AC_PROG_LEX # Checks for libraries. AC_CHECK_LIB(resolv, res_query) +AC_CHECK_LIB(socket, socket) +AC_CHECK_LIB(nsl, gethostbyaddr) +AC_CHECK_LIB(rt, nanosleep) # Checks for header files. AC_HEADER_STDC @@ -85,7 +88,7 @@ extern char *strtok_r (char *s, const char *delim, char **save_ptr); ]) # Check for GNU Mailutils -AM_GNU_MAILUTILS(1.2.90, [all sieve cfg argp], [:]) +AM_GNU_MAILUTILS(1.2.90, [all auth sieve cfg argp], [:]) save_LIBS=$LIBS LIBS="$LIBS $MAILUTILS_LIBS" diff --git a/gacopyz/gacopyz.c b/gacopyz/gacopyz.c index baf8abd2..3cf919bd 100644 --- a/gacopyz/gacopyz.c +++ b/gacopyz/gacopyz.c @@ -283,7 +283,7 @@ do_connect(gacopyz_conn_t conn, } pnum = htons(pnum); } else { - struct servent *sp = getservbyname(path, "tcp"); + struct servent *sp = getservbyname(port, "tcp"); if (!sp) { if (GACOPYZ_CONN_LOG_MATCH(conn, SMI_LOG_ERR)) gacopyz_log(SMI_LOG_ERR, diff --git a/gacopyz/server.c b/gacopyz/server.c index 18c61693..60a8bced 100644 --- a/gacopyz/server.c +++ b/gacopyz/server.c @@ -728,7 +728,7 @@ srv_connect(gacopyz_srv_t srv, char *proto, char *port, char *path) } pnum = htons(pnum); } else { - struct servent *sp = getservbyname(path, "tcp"); + struct servent *sp = getservbyname(port, "tcp"); if (!sp) { gacopyz_io_log(&srv->iod, SMI_LOG_ERR, _("Invalid connection type: %s; " diff --git a/lib/syslog_async.c b/lib/syslog_async.c index 006cf16e..0882f7be 100644 --- a/lib/syslog_async.c +++ b/lib/syslog_async.c @@ -24,6 +24,7 @@ #include <sys/syslog.h> #include <netinet/in.h> #include <signal.h> +#include <fcntl.h> #include <sys/uio.h> #include <sys/wait.h> diff --git a/mfd/dnsbase.c b/mfd/dnsbase.c index c34c7b1c..398973a3 100644 --- a/mfd/dnsbase.c +++ b/mfd/dnsbase.c @@ -258,6 +258,9 @@ struct loop_data { size_t loopcnt; /* Number of CNAME loops allowed */ }; +#ifndef MAX +# define MAX(a,b) ((a) < (b) ? (b) : (a)) +#endif #define NSIZE MAX(MAXPACKET, MAXDNAME*2+2) #define SET_STATUS(lp,s) if ((lp)->status != dns_success) (lp)->status = s @@ -576,8 +579,9 @@ dns_resolve_hostname(const char *host, char *answer, size_t answer_size, { struct loop_data ld; char namebuf[NSIZE]; - char domainbuf[NSIZE] = ""; - + char domainbuf[NSIZE]; + + domainbuf[0] = 0; ld.qtype = ld.atype = T_A; strncpy(namebuf, host, sizeof namebuf - 1); @@ -616,8 +620,9 @@ a_lookup(const char *host, { struct loop_data ld; char namebuf[NSIZE]; - char domainbuf[NSIZE] = ""; - + char domainbuf[NSIZE]; + + domainbuf[0] = 0; ld.qtype = ld.atype = T_A; strncpy(namebuf, host, sizeof namebuf - 1); ld.name = namebuf; diff --git a/mfd/mailfromd.h b/mfd/mailfromd.h index e01cde68..8d0808c3 100644 --- a/mfd/mailfromd.h +++ b/mfd/mailfromd.h @@ -28,6 +28,10 @@ #define SP(s) ((s) ? (s) : "(null)") +#ifndef INADDR_NONE +# define INADDR_NONE ((unsigned long) -1) +#endif + /* Status values used throughout the program */ typedef enum mf_status_code { mf_success, |