From 3d0d161fa09f54838333bc8610f70110015725b0 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 25 Jul 2001 07:18:36 +0000 Subject: HMH's trivial fixes. svn path=/trunk/; revision=3420 --- env.c | 10 +++++++--- fetchmail-FAQ.html | 20 ++++++++++++++++++-- fetchmail.c | 15 +++++++-------- fetchmailconf | 3 +-- lock.c | 2 +- sink.c | 28 +++++++--------------------- 6 files changed, 41 insertions(+), 37 deletions(-) diff --git a/env.c b/env.c index 0c174009..19593d72 100644 --- a/env.c +++ b/env.c @@ -41,9 +41,13 @@ void envquery(int argc, char **argv) { struct passwd by_name, by_uid, *pwp; - (user = getenv("FETCHMAILUSER")) - || (user = getenv("LOGNAME")) - || (user = getenv("USER")); + if (!(user = getenv("FETCHMAILUSER"))) + { + if (!(user = getenv("LOGNAME"))) + { + user = getenv("USER"); + } + } if (!(pwp = getpwuid(getuid()))) { diff --git a/fetchmail-FAQ.html b/fetchmail-FAQ.html index a002fe22..fb66cac3 100644 --- a/fetchmail-FAQ.html +++ b/fetchmail-FAQ.html @@ -10,7 +10,7 @@
Back to Fetchmail Home Page To Site Map -$Date: 2001/07/07 17:05:56 $ +$Date: 2001/07/25 07:18:36 $

Frequently Asked Questions About Fetchmail

@@ -705,6 +705,22 @@ make: *** [fetchmail] Error 1 then you must add "-lresolv" to the LOADLIBS line in your Makefile once you have installed the `bind' package. +If you get link errors involving dcgettext, like this: + +
+rcfile_y.o: In function `yyparse':
+rcfile_y.o(.text+0x3aa): undefined reference to `dcgettext__'
+rcfile_y.o(.text+0x4f2): undefined reference to `dcgettext__'
+rcfile_y.o(.text+0x5ee): undefined reference to `dcgettext__'
+rcfile_y.o: In function `yyerror':
+rcfile_y.o(.text+0xc7c): undefined reference to `dcgettext__'
+rcfile_y.o(.text+0xcc8): undefined reference to `dcgettext__'
+rcfile_y.o(.text+0xdf9): more undefined references to `dcgettext__' follow
+
+ +reconfigure with configure --with-included-gettext. This is +due to some brain-damage +

F1. Why does my old .fetchmailrc file no longer work?

@@ -2864,7 +2880,7 @@ date from the last Received header.

Back to Fetchmail Home Page To Site Map -$Date: 2001/07/07 17:05:56 $ +$Date: 2001/07/25 07:18:36 $

Eric S. Raymond <esr@thyrsus.com>
diff --git a/fetchmail.c b/fetchmail.c index 5b8c28ea..cba2c678 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -1322,12 +1322,10 @@ static void terminate_poll(int sig) for (ctl = querylist; ctl; ctl = ctl->next) if (ctl->smtp_socket != -1) { - /* - * Don't send QUIT for ODMR case because we're acting - * as a proxy between the SMTP server and client. - */ - if (ctl->server.protocol != P_ODMR) - SMTP_quit(ctl->smtp_socket); + /* don't send QUIT for ODMR case because we're acting + as a proxy between the SMTP server and client. */ + if (ctl->server.protocol != P_ODMR) + SMTP_quit(ctl->smtp_socket); SockClose(ctl->smtp_socket); ctl->smtp_socket = -1; } @@ -1395,7 +1393,7 @@ static const int autoprobe[] = static int query_host(struct query *ctl) /* perform fetch transaction with single host */ { - int i, st; + int i, st = 0; /* * If we're syslogging the progress messages are automatically timestamped. @@ -1414,7 +1412,8 @@ static int query_host(struct query *ctl) for (i = 0; i < sizeof(autoprobe)/sizeof(autoprobe[0]); i++) { ctl->server.protocol = autoprobe[i]; - if ((st = query_host(ctl)) == PS_SUCCESS || st == PS_NOMAIL || st == PS_AUTHFAIL || st == PS_LOCKBUSY || st == PS_SMTP || st == PS_MAXFETCH) + st = query_host(ctl); + if (st == PS_SUCCESS || st == PS_NOMAIL || st == PS_AUTHFAIL || st == PS_LOCKBUSY || st == PS_SMTP || st == PS_MAXFETCH) break; } ctl->server.protocol = P_AUTO; diff --git a/fetchmailconf b/fetchmailconf index 60043f05..d2c9bafd 100755 --- a/fetchmailconf +++ b/fetchmailconf @@ -219,7 +219,7 @@ class User: self.password = None # Password for mail account access self.mailboxes = [] # Remote folders to retrieve from self.smtphunt = [] # Hosts to forward to - self.fetchdomains = [] # Domains to fetch from + self.fetchdomains = [] # Domains to fetch from self.smtpaddress = None # Append this to MAIL FROM line self.smtpname = None # Use this for RCPT TO self.preconnect = None # Connection setup @@ -369,7 +369,6 @@ class User: res = res + " " + x res = res + "\n" trimmed = self.fetchdomains - print "FOO!", `trimmed` if trimmed != [] and trimmed[len(trimmed) - 1] == hostname: trimmed = trimmed[0:len(trimmed) - 1] if trimmed != []: diff --git a/lock.c b/lock.c index a4573493..a9fcb2ae 100644 --- a/lock.c +++ b/lock.c @@ -31,7 +31,7 @@ void lock_setup(void) #define FETCHMAIL_PIDFILE "fetchmail.pid" if (!getuid()) { lockfile = (char *)xmalloc( - sizeof(PID_DIR) + sizeof(FETCHMAIL_PIDFILE)); + sizeof(PID_DIR) + sizeof(FETCHMAIL_PIDFILE) + 1); sprintf(lockfile, "%s/%s", PID_DIR, FETCHMAIL_PIDFILE); } else { lockfile = (char *)xmalloc(strlen(fmhome)+sizeof(FETCHMAIL_PIDFILE)+2); diff --git a/sink.c b/sink.c index bc54cafb..bbe07cb8 100644 --- a/sink.c +++ b/sink.c @@ -127,8 +127,8 @@ int smtp_open(struct query *ctl) ctl->server.plugout)) == -1) continue; - /* return immediately for ODMR */ - if (ctl->server.protocol == P_ODMR) + /* return immediately for ODMR */ + if (ctl->server.protocol == P_ODMR) return(ctl->smtp_socket); /* success */ /* are we doing SMTP or LMTP? */ @@ -180,11 +180,6 @@ int smtp_open(struct query *ctl) /* these are shared by open_sink and stuffline */ static FILE *sinkfp; -#ifndef HAVE_SIGACTION -static RETSIGTYPE (*sigchld)(int); -#else -static struct sigaction sa_old; -#endif /* HAVE_SIGACTION */ int stuffline(struct query *ctl, char *buf) /* ship a line to the given control block's output sink (SMTP server or MDA) */ @@ -694,7 +689,6 @@ int open_sink(struct query *ctl, struct msgblk *msg, else { char errbuf[POPBUFSIZE]; - int res; /* * Do *not* interpret a PS_REFUSED here as a directive @@ -966,7 +960,7 @@ int open_sink(struct query *ctl, struct msgblk *msg, memset (&sa_new, 0, sizeof sa_new); sigemptyset (&sa_new.sa_mask); sa_new.sa_handler = SIG_DFL; - sigaction (SIGCHLD, &sa_new, &sa_old); + sigaction (SIGCHLD, &sa_new, NULL); #endif /* HAVE_SIGACTION */ } @@ -991,12 +985,7 @@ void release_sink(struct query *ctl) pclose(sinkfp); sinkfp = (FILE *)NULL; } -#ifndef HAVE_SIGACTION - signal(SIGCHLD, sigchld); -#else - sigaction (SIGCHLD, &sa_old, NULL); -#endif /* HAVE_SIGACTION */ - deal_with_sigchld(); + deal_with_sigchld(); /* Restore SIGCHLD handling to reap zombies */ } } @@ -1015,12 +1004,9 @@ int close_sink(struct query *ctl, struct msgblk *msg, flag forward) } else rc = 0; -#ifndef HAVE_SIGACTION - signal(SIGCHLD, sigchld); -#else - sigaction (SIGCHLD, &sa_old, NULL); -#endif /* HAVE_SIGACTION */ - deal_with_sigchld(); + + deal_with_sigchld(); /* Restore SIGCHLD handling to reap zombies */ + if (rc) { report(stderr, -- cgit v1.2.3