lpr printing with CUPS

Nathan dosman at packetsniffers.org
Fri Jan 26 15:38:20 PST 2007


Hello,
I am having some problems with the Easy Software Product/CUPS lpr command while printing to a remote lpr system. I am speaking lpr protocol to the remote host, not IPP protocol. This may be my own misunderstanding of how lpr print flags work with the CUPS lpr command.

I am using this command to print to a remote lpr server:
lpr -Pprinter -JABCD -C1234 /tmp/print.txt

So, print jobs make their way to the remote lpr server and are accepted ok. However lpr is hacking up my -J and -C flags when building the lpr control file. These are of course arbitrary values that only have meaning at the remote lpr server. In this case -JABCD is a printer name -C1234 is a formatting code for landscape.

I did a tcpdump and found that lpr only sends my last job name flag and marks it as a value for "J" no matter which job name flag I use (-J, -C, and -T are all listed as job name flags in the CUPS lpr man page). There are other oddities such as the strange reuse of the -J flag value as the file name at the end of the control file.

Control file structure that I am expecting from the command above:
Hmyhost.somewhere.edu
Proot
JABCD
C1234
ldfA010myhost.somewhere.edu
UdfA010myhost.somewhere.edu
N/tmp/print.txt

What I am getting:
Hmyhost.somewhere.edu
Proot
J1234
ldfA010myhost.somewhere.edu
UdfA010myhost.somewhere.edu
N1234


I've been referencing rfc 1179 to interpret the packets and understand the control file:
http://www.ietf.org/rfc/rfc1179.txt


Other Unix platforms (AIX/non CUPS) support these print codes just fine and don't seem to mangle my flags. Any assistance would be appreciated.

Thanks!
-dosman




More information about the cups mailing list