diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-08-06 05:59:47 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-08-06 05:59:47 +0000 |
commit | 48232265f836113745c0534694e65b3c9f8bcfc7 (patch) | |
tree | ab387b0e15e5924155ac060be4a39ebe708e7508 | |
parent | 8354acc5f0864f8ba12a94dc8a6cc525abbcc211 (diff) | |
download | fetchmail-48232265f836113745c0534694e65b3c9f8bcfc7.tar.gz fetchmail-48232265f836113745c0534694e65b3c9f8bcfc7.tar.bz2 fetchmail-48232265f836113745c0534694e65b3c9f8bcfc7.zip |
Fixed Bill Powers's uid bug.
svn path=/trunk/; revision=1240
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | fetchmail.c | 51 | ||||
-rw-r--r-- | fetchmail.h | 1 |
3 files changed, 31 insertions, 24 deletions
@@ -21,6 +21,9 @@ Release Notes: ------------------------------------------------------------------------------ +fetchmail-4.0.8 () +* Fixed core dump bug in UID handling introduced by the 4.0.6 change. + fetchmail-4.0.7 (Tue Aug 5 22:47:11 EDT 1997) * Fixed a minor bug in handling of DNS errors in multidrop mode. * Added a `postconnect' analogous to `preconnect'. diff --git a/fetchmail.c b/fetchmail.c index dacf254b..bf866a97 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -369,29 +369,6 @@ int main (int argc, char **argv) continue; #endif /* linux */ - /* - * - * Compute the true name of the mailserver host. - * There are two clashing cases here: - * - * (1) The poll name is a label, possibly on one of several - * poll configurations for the same host. In this case - * the `via' option will be present and give the true name. - * - * (2) The poll name is the true one, the via name is - * localhost. This is going to be typical for ssh-using - * configurations. - * - * We're going to assume the via name is true unless it's - * localhost. - * - * Then, if we've got DNS, we'll try to canonicalize the name. - */ - if (ctl->server.via && strcmp(ctl->server.via, "localhost")) - ctl->server.truename = xstrdup(ctl->server.via); - else - ctl->server.truename = xstrdup(ctl->server.pollname); - #ifdef HAVE_GETHOSTBYNAME /* * This functions partly as a probe to make sure our @@ -404,7 +381,7 @@ int main (int argc, char **argv) /* compute the canonical name of the host */ errno = 0; - namerec = gethostbyname(ctl->server.truename); + namerec = gethostbyname(ctl->server.queryname); if (namerec == (struct hostent *)NULL) { error(0, errno, @@ -644,6 +621,32 @@ static int load_params(int argc, char **argv, int optind) DEFAULT(ctl->server.uidl, FALSE); #undef DEFAULT + /* + * + * Compute the true name of the mailserver host. + * There are two clashing cases here: + * + * (1) The poll name is a label, possibly on one of several + * poll configurations for the same host. In this case + * the `via' option will be present and give the true name. + * + * (2) The poll name is the true one, the via name is + * localhost. This is going to be typical for ssh-using + * configurations. + * + * We're going to assume the via name is true unless it's + * localhost. + * + * Each poll cycle, if we've got DNS, we'll try to canonicalize + * the name. This will function as a probe to ensure the + * host's nameserver is up. + */ + if (ctl->server.via && strcmp(ctl->server.via, "localhost")) + ctl->server.queryname = xstrdup(ctl->server.via); + else + ctl->server.queryname = xstrdup(ctl->server.pollname); + ctl->server.truename = xstrdup(ctl->server.queryname); + /* plug in the semi-standard way of indicating a mail address */ if (ctl->server.envelope == (char *)NULL) ctl->server.envelope = "X-Envelope-To:"; diff --git a/fetchmail.h b/fetchmail.h index 30bad06a..f5632c2d 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -101,6 +101,7 @@ struct hostdata /* shared among all user connections to given server */ /* computed for internal use */ int poll_count; /* count of polls so far */ + char *queryname; /* name to attempt DNS lookup on */ char *truename; /* "true name" of server host */ struct hostdata *lead_server; /* ptr to lead query for this server */ int esmtp_options; |