Fatal bug in 2.2.5R's lpd

Joerg Wunsch joerg at FreeBSD.ORG
Fri Nov 7 23:40:47 PST 1997


some header freebsd-announce Joerg Wunsch <joerg at FreeBSD.ORG> 1.92
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 at 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);

This is the moderated mailing list freebsd-announce.
The list contains announcements of new FreeBSD capabilities,
important events and project milestones.
See also the FreeBSD Web pages at http://www.freebsd.org

To unsubscribe from freebsd-announce, sent a mail to
majordomo at freebsd.org with the body

unsubscribe freebsd-announce



More information about the freebsd-announce mailing list