Date: Tue, 26 Sep 1995 18:00:21 +1000 From: Stephen Hocking <sysseh@devetir.qld.gov.au> To: FreeBSD-gnats-submit@freebsd.org Subject: bin/739: lpd does not handle output filters correctly Message-ID: <199509260800.IAA07164@netfl15a.devetir.qld.gov.au> Resent-Message-ID: <199509260800.BAA23591@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199509260800.IAA07164>