Subject: bin/12549: lpd -r doesn't appear to work
To: None <gnats-bugs@gnats.netbsd.org>
From: None <reed@reedmedia.net>
List: netbsd-bugs
Date: 04/04/2001 10:14:09
>Number:         12549
>Category:       bin
>Synopsis:       lpd's OF (output filter) has no data and "-r" doesn't work
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 04 10:15:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Jeremy C. Reed
>Release:        1.5.1_ALPHA (why does send-pr ask for current source date?)
>Organization:
>Environment:
System: NetBSD rainier 1.5.1_ALPHA NetBSD 1.5.1_ALPHA (JCR-1.5-20010108) #0: Mon Jan 8 09:25:45 PST 2001 reed@rainier:/usr/src/sys/arch/i386/compile/JCR-1.5-20010108 i386


>Description:
lpd has a "-r" option (added in Dec. 1999) to allow `of' filters for remote
jobs.

So I use "lpd -r" and the "of" filter never receives any data. I add various
checks to my filter and I see that no data is ever passed to it.
(This causes a "protocol screwup" on the remote lpd.)

M. Buelow on netbsd-help said: "the lpd -r setting won't work either
(as far as I have investigated, it's broken and does nothing observable,
certainly not what was advertised.)  I have discussed this about a year
ago or so on a netbsd mailing list already ..."

(My whole goal is to process/filter locally and print remotely.)

>How-To-Repeat:
Use lpd with "-r" switch and use a "of" filter to process data.
>Fix:
I do not have a fix.

FreeBSD's lpd doesn't have a "-r" switch, but their lpd does use "if" and
"of" filters for processing mail even if printing remotely.
I hand implemented this patch (against 1.5.1_ALPHA's
src/usr.sbin/lpr/lpd/printjob.c) and now "if" works. "of" partially works,
but the "of" filter is exec'd twice (the first time with data and the second
time with out any data). "of" does print correctly though.
This patch is at 
http://www.reedmedia.net/misc/netbsd/patches/printjob.c-diff
I don't know if this patch should be used (especially since "of" is
executed twice). 

It would be better if the NetBSD lpd "-r" option was fixed.

>Release-Note:
>Audit-Trail:
>Unformatted: