diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2009-04-09 20:46:39 +0000 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2009-04-09 20:46:39 +0000 |
commit | 29fc7923e84b46f29a113b54921d2bf2efacd265 (patch) | |
tree | 702734eedfe25f82eaed50349da9fdc8b7d3ca84 | |
parent | 31763af4e114bf6b7b93262ad997566820a5fa9b (diff) | |
download | fetchmail-29fc7923e84b46f29a113b54921d2bf2efacd265.tar.gz fetchmail-29fc7923e84b46f29a113b54921d2bf2efacd265.tar.bz2 fetchmail-29fc7923e84b46f29a113b54921d2bf2efacd265.zip |
Fix pre-/post-connect error/signal reporting.
svn path=/branches/BRANCH_6-3/; revision=5267
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | driver.c | 17 | ||||
-rw-r--r-- | fetchmail.man | 6 |
3 files changed, 23 insertions, 6 deletions
@@ -48,6 +48,10 @@ removed from a 6.4.0 or newer release.) fetchmail 6.3.10 (not yet released): +# INCOMPATIBLE BUGFIXES +* Use PS_PROTOCOL (4) rather than PS_SYNTAX (5) exit status when a pre- or + post-connect command fails. + # BUGFIXES * Fix misuse of canonical autoconf target as _TARGET when it should have been _HOST. Report and patch courtesy of Diego E. "Flameeyes" Pettenò. @@ -56,6 +60,8 @@ fetchmail 6.3.10 (not yet released): Michelle Konzack, Debian Bug#508667. * Do not overlap source and destination fields in snprintf() in interface.c. Courtesy of Nico Golde, Debian. +* When a pre- or post-connect command fails, now report the exit status or + termination signal properly through sys/wait.h macros. # CHANGES * Make the comparison of the SSL fingerprints case insensitive, to @@ -935,9 +935,13 @@ static int do_session( /* execute pre-initialization command, if any */ if (ctl->preconnect && (err = system(ctl->preconnect))) { - report(stderr, - GT_("pre-connection command failed with status %d\n"), err); - err = PS_SYNTAX; + if (WIFSIGNALED(err)) + report(stderr, + GT_("pre-connection command terminated with signal %d\n"), WTERMSIG(err)); + else + report(stderr, + GT_("pre-connection command failed with status %d\n"), WEXITSTATUS(err)); + err = PS_PROTOCOL; goto closeUp; } @@ -1566,9 +1570,12 @@ closeUp: /* execute wrapup command, if any */ if (ctl->postconnect && (tmperr = system(ctl->postconnect))) { - report(stderr, GT_("post-connection command failed with status %d\n"), tmperr); + if (WIFSIGNALED(tmperr)) + report(stderr, GT_("post-connection command terminated with signal %d\n"), WTERMSIG(tmperr)); + else + report(stderr, GT_("post-connection command failed with status %d\n"), WEXITSTATUS(tmperr)); if (err == PS_SUCCESS) - err = PS_SYNTAX; + err = PS_PROTOCOL; } set_timeout(0); /* cancel any pending alarm */ diff --git a/fetchmail.man b/fetchmail.man index f6234985..e66da7d0 100644 --- a/fetchmail.man +++ b/fetchmail.man @@ -2532,10 +2532,14 @@ tried to run fetchmail under circumstances where it did not have standard input attached to a terminal and could not prompt for a missing password. .IP 4 -Some sort of fatal protocol error was detected. +Some sort of fatal protocol error was detected. Since 6.3.10, this +includes non-zero exit status or signal-triggered termination of a pre- +or post-connect command. .IP 5 There was a syntax error in the arguments to .IR fetchmail . +Up to and including 6.3.9, this was also used if the pre- or +post-connect command failed. .IP 6 The run control file had bad permissions. .IP 7 |