diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2001-11-08 18:34:27 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2001-11-08 18:34:27 +0000 |
commit | 52f3bf729a4f715d94366b01e7e8b4ae0aec9e06 (patch) | |
tree | 56c96f3d8816694000392254310700a1fd618975 | |
parent | 6790784b205159b45db2ff4434a5635c813b87b2 (diff) | |
download | fetchmail-52f3bf729a4f715d94366b01e7e8b4ae0aec9e06.tar.gz fetchmail-52f3bf729a4f715d94366b01e7e8b4ae0aec9e06.tar.bz2 fetchmail-52f3bf729a4f715d94366b01e7e8b4ae0aec9e06.zip |
Avoid UIDL core dump.
svn path=/trunk/; revision=3547
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | fetchmail.c | 40 |
2 files changed, 25 insertions, 19 deletions
@@ -3,7 +3,7 @@ (The `lines' figures total .c, .h, .l, and .y files under version control.) * Changed the logging logic along lines suggested by Jan Klaverstijn, -* fetchmauilconf looks first in the directory it's running from to find +* fetchmailconf looks first in the directory it's running from to find fetchmail. * Make sure we vet a success status correctly from open_smtp_sink() and open_bsmtp_sink(). @@ -18,6 +18,8 @@ * NextStep and OpenStep port patch from Eric Sunshine. * Block signals during SockConnect() so we don't get a socket descriptor leak if we're hit by an alarm signal during connect(2). +* Set queryname even when server is inactive; avoids a core-dump bug in + the fetchids code. fetchmail-5.9.4 (Wed Oct 3 07:47:45 EDT 2001), 21104 lines: diff --git a/fetchmail.c b/fetchmail.c index a1c6754d..c5b6f7cb 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -1003,14 +1003,30 @@ static int load_params(int argc, char **argv, int optind) { ctl->wedged = FALSE; - if (configdump || ctl->active ) - { - /* merge in defaults */ - optmerge(ctl, &def_opts, FALSE); + /* merge in defaults */ + optmerge(ctl, &def_opts, FALSE); + + /* force command-line options */ + optmerge(ctl, &cmd_opts, TRUE); + + /* + * queryname has to be set up for inactive servers too. + * Otherwise the UIDL code core-dumps on startup. + */ + if (ctl->server.via) + ctl->server.queryname = xstrdup(ctl->server.via); + else + ctl->server.queryname = xstrdup(ctl->server.pollname); - /* force command-line options */ - optmerge(ctl, &cmd_opts, TRUE); + /* + * We no longer do DNS lookups at startup. + * This is a kluge. It enables users to edit their + * configurations when DNS isn't available. + */ + ctl->server.truename = xstrdup(ctl->server.queryname); + if (configdump || ctl->active ) + { /* this code enables flags to be turned off */ #define DEFAULT(flag, dflt) if (flag == FLAG_TRUE)\ flag = TRUE;\ @@ -1074,18 +1090,6 @@ static int load_params(int argc, char **argv, int optind) } #endif /* !HAVE_GETHOSTBYNAME || !HAVE_RES_SEARCH */ - if (ctl->server.via) - ctl->server.queryname = xstrdup(ctl->server.via); - else - ctl->server.queryname = xstrdup(ctl->server.pollname); - - /* - * We no longer do DNS lookups at startup. - * This is a kluge. It enables users to edit their - * configurations when DNS isn't available. - */ - ctl->server.truename = xstrdup(ctl->server.queryname); - /* if no folders were specified, set up the null one as default */ if (!ctl->mailboxes) save_str(&ctl->mailboxes, (char *)NULL, 0); |