summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/lpr/lpd/recvjob.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/usr.sbin/lpr/lpd/recvjob.c b/usr.sbin/lpr/lpd/recvjob.c
index e9b0c4e..ebd0560 100644
--- a/usr.sbin/lpr/lpd/recvjob.c
+++ b/usr.sbin/lpr/lpd/recvjob.c
@@ -377,10 +377,25 @@ frecverr(msg, va_alist)
#else
va_start(ap);
#endif
- rcleanup(0);
- syslog(LOG_ERR, "%s", fromb);
+ syslog(LOG_ERR, "Error receiving job from %s:", fromb);
vsyslog(LOG_ERR, msg, ap);
va_end(ap);
+ /*
+ * rcleanup is not called until AFTER logging the error message,
+ * because rcleanup will zap some variables which may have been
+ * supplied as parameters for that msg...
+ */
+ rcleanup(0);
+ /*
+ * Add a minimal delay before returning the final error code to
+ * the sending host. This just in case that machine responds
+ * this error by INSTANTLY retrying (and instantly re-failing...).
+ * It would be stupid of the sending host to do that, but if there
+ * was a broken implementation which did it, the result might be
+ * obscure performance problems and a flood of syslog messages on
+ * the receiving host.
+ */
+ sleep(2); /* a paranoid throttling measure */
putchar('\1'); /* return error code */
exit(1);
}
OpenPOWER on IntegriCloud