From: Wietse Venema Date: Fri, 19 Jul 2002 05:00:00 +0000 (-0500) Subject: postfix-1.1.11-20020719 X-Git-Tag: v2.0.0~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3c2f6ef224926d493f264312b351a730e6a8099;p=thirdparty%2Fpostfix.git postfix-1.1.11-20020719 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index 4b9df80ed..86c5a4732 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -6707,6 +6707,22 @@ Apologies for any names omitted. did not work, nor did my own, but the present version should be OK. File: global/virtual8_maps_find.c. +20020719 + + Workaround: log a warning when an SMTP client name->address + lookup results in a numeric IP address, and set the client + hostname to "unknown". Some gethostbyname() implementations + will actually accept such garbage and thereby allow sites + to defeat the "reject_unknown_client" restriction. Problem + reported by Wolfgang Rupprecht, fix based on analysis (but + not code) by Victor Duchovni. + + Bugfix: memory leaks in the LDAP client by Victor Duchovni. + File: util/dict_ldap.c. + + Bugfix: garbage in verbose "flush" server logging. Victor + Duchovni. File: flush/flush.c. + Open problems: Medium: should permit_mx_backup defer delivery if DNS diff --git a/postfix/src/flush/flush.c b/postfix/src/flush/flush.c index 433432f25..c4517a492 100644 --- a/postfix/src/flush/flush.c +++ b/postfix/src/flush/flush.c @@ -217,6 +217,7 @@ static int flush_send_path(const char *, int); static VSTRING *flush_site_to_path(VSTRING *path, const char *site) { + const char *ptr; int ch; /* @@ -228,7 +229,7 @@ static VSTRING *flush_site_to_path(VSTRING *path, const char *site) /* * Mask characters that could upset the name-to-queue-file mapping code. */ - while ((ch = *(unsigned const char *) site++) != 0) + for (ptr = site; (ch = *(unsigned const char *) ptr) != 0; ptr++) if (ISALNUM(ch)) VSTRING_ADDCH(path, ch); else diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index c277fb3ac..554c1a950 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change the patchlevel and the release date. Snapshots change the * release date only, unless they include the same bugfix as a patch release. */ -#define MAIL_RELEASE_DATE "20020718" +#define MAIL_RELEASE_DATE "20020719" #define VAR_MAIL_VERSION "mail_version" #define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE diff --git a/postfix/src/smtpd/smtpd_peer.c b/postfix/src/smtpd/smtpd_peer.c index 81f88431a..4a8b2c57f 100644 --- a/postfix/src/smtpd/smtpd_peer.c +++ b/postfix/src/smtpd/smtpd_peer.c @@ -134,6 +134,11 @@ void smtpd_peer_init(SMTPD_STATE *state) if (hp == 0) { state->name = mystrdup("unknown"); state->peer_code = (h_errno == TRY_AGAIN ? 4 : 5); + } else if (valid_hostaddr(hp->h_name, DONT_GRIPE)) { + msg_warn("numeric result %s in address->name lookup for %s", + hp->h_name, state->addr); + state->name = mystrdup("unknown"); + state->peer_code = 5; } else if (!valid_hostname(hp->h_name, DONT_GRIPE)) { state->name = mystrdup("unknown"); state->peer_code = 5; diff --git a/postfix/src/util/dict_ldap.c b/postfix/src/util/dict_ldap.c index 60a07e92a..970738569 100644 --- a/postfix/src/util/dict_ldap.c +++ b/postfix/src/util/dict_ldap.c @@ -506,15 +506,10 @@ static void dict_ldap_get_values(DICT_LDAP *dict_ldap, LDAPMessage * res, for (entry = ldap_first_entry(dict_ldap->ld, res); entry != NULL; entry = ldap_next_entry(dict_ldap->ld, entry)) { ber = NULL; - attr = ldap_first_attribute(dict_ldap->ld, entry, &ber); - if (attr == NULL) { - if (msg_verbose) - msg_info("%s: no attributes found", myname); - continue; - } - for (; attr != NULL; - attr = ldap_next_attribute(dict_ldap->ld, entry, ber)) { - + for (attr = ldap_first_attribute(dict_ldap->ld, entry, &ber); + attr != NULL; + ldap_memfree(attr), attr = ldap_next_attribute(dict_ldap->ld, + entry, ber)) { vals = ldap_get_values(dict_ldap->ld, entry, attr); if (vals == NULL) { if (msg_verbose) @@ -587,6 +582,8 @@ static void dict_ldap_get_values(DICT_LDAP *dict_ldap, LDAPMessage * res, } ldap_value_free(vals); } + if (ber != NULL) + ber_free(ber, 0); } if (msg_verbose) msg_info("%s: Leaving %s", myname, myname);