From owner-freebsd-bugs Tue Sep 26 01:00:05 1995 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA23606 for bugs-outgoing; Tue, 26 Sep 1995 01:00:05 -0700 Received: (from gnats@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA23591 ; Tue, 26 Sep 1995 01:00:03 -0700 Resent-Date: Tue, 26 Sep 1995 01:00:03 -0700 Resent-Message-Id: <199509260800.BAA23591@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, "Received:from bunyip.cc.uq.oz.au (pp@bunyip.cc.uq.oz.au [130.102.2.1]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id AAA23040 for" ; Tue, 26.Sep.1995.00:54:10.-0700 Received: from cc.uq.oz.au by bunyip.cc.uq.oz.au id <19003-0@bunyip.cc.uq.oz.au>; Tue, 26 Sep 1995 17:52:44 +1000 Received: from netfl15a.devetir.qld.gov.au by pandora.devetir.qld.gov.au (8.6.10/DEVETIR-E0.3a) with ESMTP id RAA24442 for ; Tue, 26 Sep 1995 17:57:52 +1000 Received: from localhost by netfl15a.devetir.qld.gov.au (8.6.8.1/DEVETIR-0.1) id IAA07164 for ; Tue, 26 Sep 1995 08:00:22 GMT Message-Id: <199509260800.IAA07164@netfl15a.devetir.qld.gov.au> Date: Tue, 26 Sep 1995 18:00:21 +1000 From: Stephen Hocking To: FreeBSD-gnats-submit@freebsd.org Subject: bin/739: lpd does not handle output filters correctly Sender: owner-bugs@freebsd.org Precedence: bulk >Number: 739 >Category: bin >Synopsis: Some problems when an output filter reads all input before >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Sep 26 01:00:02 PDT 1995 >Last-Modified: >Originator: Stephen Hocking >Organization: DEVETIR >Release: FreeBSD 2.2-CURRENT i386 >Environment: 2.2 current >Description: When using an output filter that reads all of its input before commencing operation, lpd assumes that the printing is finished and starts another job from that queue. This means that output can be interleaved as each instance of the output filter finishes processing. >How-To-Repeat: Create an output filter that reads all of its standard input before printing, eg cat > /tmp/foo.$$ some_random_data_fiddling cat /tmp/foo.$$ Send off lots of jobs to that particular queue and watch your stuff interleave. >Fix: Find the following diff to correct the problem for printjob.c *** printjob.c.dist Fri Sep 8 14:21:53 1995 - --- printjob.c Fri Sep 8 14:23:54 1995 *************** *** 272,277 **** - --- 272,279 ---- (void) write(ofd, TR, strlen(TR)); } (void) unlink(tempfile); + close(ofd); /* give ofilter an EOF indicator */ + (void)wait((int *)0); /* wait until ofilter finished */ exit(0); } goto again; I do not speak for the Worker's Compensation Board of Queensland - They don't pay me enough for that! >Audit-Trail: >Unformatted: starting.