aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-09-03 15:05:36 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-09-03 15:05:36 +0000
commite05e01d7d3d24feb10abd4b61c7d26fcdb46ef53 (patch)
tree14c2df58397ffd1ab4a6501a139795271f2e1653
parentc50458d25c0d79f191ca68c1a1bd3a1a110d7eba (diff)
downloadmailfromd-e05e01d7d3d24feb10abd4b61c7d26fcdb46ef53.tar.gz
mailfromd-e05e01d7d3d24feb10abd4b61c7d26fcdb46ef53.tar.bz2
* src/dnsbase.c (dns_resolve_hostname): Make name buffer big
enough to hold eventual CNAME expansions. Reporte by Jan Rafaj. * configure.ac: Improve to compile with the latest MU CVS. git-svn-id: file:///svnroot/mailfromd/trunk@1505 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r--ChangeLog6
-rw-r--r--configure.ac8
-rw-r--r--src/dnsbase.c9
3 files changed, 18 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 58712442..90680c79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-09-03 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ * src/dnsbase.c (dns_resolve_hostname): Make name buffer big
+ enough to hold eventual CNAME expansions.
+ * configure.ac: Improve to compile with the latest MU CVS.
+
2007-08-11 Sergey Poznyakoff <gray@gnu.org.ua>
* configure.ac (check_slackware_bdb): Add heuristics to find the
diff --git a/configure.ac b/configure.ac
index 2be026fd..6360a528 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,9 +93,13 @@ fi
AC_SUBST(MAILUTILS_VERSION)
AC_SUBST(MAILUTILS_INCLUDES)
AC_SUBST(MAILUTILS_LIBS)
-MAILUTILS_VERSION=`$MU_CONFIG --info version|sed s/.*=//`
+MAILUTILS_VERSION=`$MU_CONFIG --info version`
+case $MAILUTILS_VERSION in
+0.*) AC_MSG_ERROR([Mailutils version too old; at least 1.0 is required]);;
+1.1*) MAILUTILS_LIBS=`$MU_CONFIG --link auth`;;
+*) MAILUTILS_LIBS=`$MU_CONFIG --link auth mailer`;;
+esac
MAILUTILS_INCLUDES=`$MU_CONFIG --compile`
-MAILUTILS_LIBS=`$MU_CONFIG --link auth`
save_LIBS=$LIBS
LIBS="$LIBS $MAILUTILS_LIBS"
diff --git a/src/dnsbase.c b/src/dnsbase.c
index 777ca7ee..94a06888 100644
--- a/src/dnsbase.c
+++ b/src/dnsbase.c
@@ -567,11 +567,14 @@ dns_resolve_hostname(const char *host, char *answer, size_t answer_size,
char *ipbuf, size_t ipbsize, unsigned long *ttl)
{
struct loop_data ld;
- char domainbuf[256] = "";
+ char namebuf[NSIZE];
+ char domainbuf[NSIZE] = "";
ld.qtype = ld.atype = T_A;
- ld.name = xstrdup(host);
- ld.name_size = strlen(ld.name);
+
+ strncpy(namebuf, host, sizeof namebuf - 1);
+ ld.name = namebuf;
+ ld.name_size = sizeof namebuf;
ld.domain = domainbuf;
ld.domain_size = sizeof domainbuf;
ld.answer = answer;

Return to:

Send suggestions and report system problems to the System administrator.