aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS6
-rw-r--r--driver.c17
-rw-r--r--fetchmail.man6
3 files changed, 23 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index a86d05c0..55c2d18a 100644
--- a/NEWS
+++ b/NEWS
@@ -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
diff --git a/driver.c b/driver.c
index 14cf8700..335da6ac 100644
--- a/driver.c
+++ b/driver.c
@@ -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