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 /fetchmail.c | |
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
Diffstat (limited to 'fetchmail.c')
-rw-r--r-- | fetchmail.c | 51 |
1 files changed, 27 insertions, 24 deletions
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:"; |