Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Nov 1997 23:39:01 -0800 (PST)
From:      Joerg Wunsch <joerg@FreeBSD.ORG>
To:        announce@FreeBSD.ORG, stable@FreeBSD.ORG
Subject:   Fatal bug in 2.2.5R's lpd
Message-ID:  <199711080739.XAA29381@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
When merging the new `ct' printcap functionality into 2.2-stable right
before 2.2.5-RELEASE was due, it's now apparent that I didn't test it
enough before. :-(  I've introduced a fatal bug that causes all the
lpd children sending jobs to remote printers to be killed after the `ct'
timeout, even in case the connection came up properly.  For small jobs,
you won't notice this immediately (the default timeout is 120 seconds,
and modern printers can print a lot within this time), but large jobs
will ultimately be aborted then.

Sorry for the inconvenience.  For those of you who do need to operate
on remote printers, please either do upgrade to the latest 2.2-stable,
or apply the patch below, rebuild and reinstall your lpd.

Sorry again,

	Joerg <joerg@FreeBSD.ORG>

Index: src/usr.sbin/lpr/common_source/displayq.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/lpr/common_source/displayq.c,v
retrieving revision 1.4.2.5
retrieving revision 1.4.2.6
diff -u -u -r1.4.2.5 -r1.4.2.6
--- displayq.c	1997/10/15 12:25:35	1.4.2.5
+++ displayq.c	1997/11/07 13:20:29	1.4.2.6
@@ -242,6 +242,7 @@
 	savealrm = signal(SIGALRM, alarmhandler);
 	alarm(CT);
 	fd = getport(RM, 0);
+	alarm(0);
 	(void)signal(SIGALRM, savealrm);
 	if (fd < 0) {
 		if (from != host)
Index: src/usr.sbin/lpr/lpd/printjob.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/lpr/lpd/printjob.c,v
retrieving revision 1.11.2.3
retrieving revision 1.11.2.4
diff -u -u -r1.11.2.3 -r1.11.2.4
--- printjob.c	1997/10/15 09:56:00	1.11.2.3
+++ printjob.c	1997/11/07 13:20:37	1.11.2.4
@@ -1474,6 +1474,7 @@
 		savealrm = signal(SIGALRM, alarmhandler);
 		alarm(CT);
 		pfd = getport(cp, port);
+		alarm(0);
 		(void)signal(SIGALRM, savealrm);
 		if (pfd < 0 && errno == ECONNREFUSED)
 			resp = 1;
@@ -1541,6 +1542,7 @@
 		savealrm = signal(SIGALRM, alarmhandler);
 		alarm(CT);
 		pfd = getport(RM, 0);
+		alarm(0);
 		(void)signal(SIGALRM, savealrm);
 		if (pfd >= 0) {
 			(void) snprintf(line, sizeof(line), "\2%s\n", RP);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711080739.XAA29381>