From 7c3a0f3a090339ac22e2ace55eab03575f708273 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 17 Aug 1999 17:51:32 +0000 Subject: Changes from the road. svn path=/trunk/; revision=2540 --- NEWS | 7 ++++++- env.c | 1 - fetchmail.c | 39 +++++++++++++++++++++++++-------------- interface.c | 4 ++-- options.c | 6 +++--- rcfile_l.l | 3 ++- 6 files changed, 38 insertions(+), 22 deletions(-) diff --git a/NEWS b/NEWS index e8d38147..b42a69e2 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,10 @@ fetchmail-5.0.7 (): * RPA support works again. * Added debian_rc startup/shutdown script to contrib/. +* Yet another monitor option fix. +* Variouas small option-processing fixes. +* Teach fetchmailconf about HP OpenMail. +* SunOS compilation fixes. There are 263 people on fetchmail-friends and 421 on fetchmail-announce. @@ -21,7 +25,8 @@ fetchmail-5.0.6 (Mon Aug 2 14:04:23 EDT 1999): * Russion internationalization support (but I couldn't read the contributor name in the headers!) * Update of the French internationalization support by Guy Brand. -* Lexer fix for the `nokeep' problem by Robert de Bath. +* Lexer fix for the `nokeep' problem by Robert de Bath (thanks + to David "Hi! I'm an obnoxious twerp" Ashley for stimulating this). * Lexer states added to tell the lexer to return a string after a `username' or `password' keyword, courtesy of Brian Boutel. * Interface option fix from Bill Currie. diff --git a/env.c b/env.c index efa11738..ce4a1a09 100644 --- a/env.c +++ b/env.c @@ -16,7 +16,6 @@ #endif #include #include -#include #ifdef HAVE_GETHOSTBYNAME #include #endif /* HAVE_GETHOSTBYNAME */ diff --git a/fetchmail.c b/fetchmail.c index de0977f3..ee790597 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -16,6 +16,7 @@ #include #include #include +#include #if defined(HAVE_SYSLOG) #include #endif @@ -32,7 +33,7 @@ #endif /* HAVE_SETRLIMIT */ #ifdef HAVE_SYS_WAIT_H #include -#endif +#endif /* HAVE_SYS_WAIT_H */ #ifdef HAVE_GETHOSTBYNAME #include @@ -272,11 +273,14 @@ int main(int argc, char **argv) } #endif /* HAVE_SETRLIMIT */ +#define NETRC_FILE ".netrc" /* parse the ~/.netrc file (if present) for future password lookups. */ - xalloca(netrc_file, char *, strlen (home) + 8); + xalloca(netrc_file, char *, strlen (home) + strlen(NETRC_FILE) + 2); strcpy (netrc_file, home); - strcat (netrc_file, "/.netrc"); + strcat (netrc_file, "/"); + strcat (netrc_file, NETRC_FILE); netrc_list = parse_netrc(netrc_file); +#undef NETRC_FILE /* pick up passwords where we can */ for (ctl = querylist; ctl; ctl = ctl->next) @@ -1391,19 +1395,26 @@ static void dump_params (struct runctl *runp, * Don't poll for password when there is one or when using the ETRN * or IMAP-GSS protocol */ - if (!ctl->password && (ctl->server.protocol != P_ETRN) + /* ETRN, IMAP_GSS, and IMAP_K4 do not need a password, so skip this */ + if ( (ctl->server.protocol != P_ETRN) #ifdef GSSAPI - && (ctl->server.protocol != P_IMAP_GSS) + && (ctl->server.protocol != P_IMAP_GSS) #endif /* GSSAPI */ - && ctl->server.protocol != P_IMAP_K4) - printf(_(" Password will be prompted for.\n")); - else if (outlevel >= O_VERBOSE) - if (ctl->server.protocol == P_APOP) - printf(_(" APOP secret = \"%s\".\n"), visbuf(ctl->password)); - else if (ctl->server.protocol == P_RPOP) - printf(_(" RPOP id = \"%s\".\n"), visbuf(ctl->password)); - else - printf(_(" Password = \"%s\".\n"), visbuf(ctl->password)); + && (ctl->server.protocol != P_IMAP_K4) ) { + if (!ctl->password) + printf(_(" Password will be prompted for.\n")); + else if (outlevel >= O_VERBOSE) + if (ctl->server.protocol == P_APOP) + printf(_(" APOP secret = \"%s\".\n"), + visbuf(ctl->password)); + else if (ctl->server.protocol == P_RPOP) + printf(_(" RPOP id = \"%s\".\n"), + visbuf(ctl->password)); + else + printf(_(" Password = \"%s\".\n"), + visbuf(ctl->password)); + } + if (ctl->server.protocol == P_POP3 #if INET6 && !strcmp(ctl->server.service, KPOP_PORT) diff --git a/interface.c b/interface.c index a062f5dc..936b5bf9 100644 --- a/interface.c +++ b/interface.c @@ -488,7 +488,7 @@ int interface_approve(struct hostdata *hp) * (c) newpacket count is greater than the old packet count, * and the difference is large. Connection is live. Don't skip. */ - if (diff > 0 && diff <= MONITOR_SLOP) + if (diff >= 0 && diff <= MONITOR_SLOP) { (void) report(stdout, _("skipping poll of %s, %s inactive\n"), @@ -498,7 +498,7 @@ int interface_approve(struct hostdata *hp) } #ifdef ACTIVITY_DEBUG - report(stdout _("activity on %s was %d, is %d"), + report(stdout, _("activity on %s was %d, is %d\n"), hp->monitor, hp->monitor_io, ifinfo.rx_packets + ifinfo.tx_packets); #endif diff --git a/options.c b/options.c index 00060960..5172657d 100644 --- a/options.c +++ b/options.c @@ -430,7 +430,7 @@ struct query *ctl; /* option record to be initialized */ break; case 'r': case LA_FOLDER: - xalloca(buf, char *, strlen(optarg)); + xalloca(buf, char *, strlen(optarg) + 1); strcpy(buf, optarg); cp = strtok(buf, ","); do { @@ -440,7 +440,7 @@ struct query *ctl; /* option record to be initialized */ break; case 'S': case LA_SMTPHOST: - xalloca(buf, char *, strlen(optarg)); + xalloca(buf, char *, strlen(optarg) + 1); strcpy(buf, optarg); cp = strtok(buf, ","); do { @@ -455,7 +455,7 @@ struct query *ctl; /* option record to be initialized */ break; case 'Z': case LA_ANTISPAM: - xalloca(buf, char *, strlen(optarg)); + xalloca(buf, char *, strlen(optarg) + 1); strcpy(buf, optarg); cp = strtok(buf, ","); do { diff --git a/rcfile_l.l b/rcfile_l.l index b7f22949..2a51ff06 100644 --- a/rcfile_l.l +++ b/rcfile_l.l @@ -42,6 +42,8 @@ int prc_lineno = 1; return STRING; } +"*" { BEGIN(0); return WILDCARD; } + [^=;:, \t\r\n]+ { char buf[MSGBUFSIZE]; @@ -106,7 +108,6 @@ here { return HERE; } there { return THERE; } to { BEGIN(NAME); return TO; } = { BEGIN(NAME); return MAP; } -"*" { BEGIN(0); return WILDCARD; } nobouncemail | nouidl | -- cgit v1.2.3