[cups.bugs] ipp returning, but printer still in "remote-pending"?

Jeff Chua jeff.chua.linux at gmail.com
Sat Dec 17 06:02:41 PST 2011


On Sat, Dec 17, 2011 at 2:11 AM, Michael Sweet <msweet at apple.com> wrote:
> On Dec 16, 2011, at 6:31 AM, Jeff Chua wrote:
>> I'm trying to print a simple ipp local printer
>> "ipp://lp:631/printers/file" where "file" is a simple script with
>> "exit 0", but ipp seems to running non-stop. "lp" points to 127.0.0.1
>
> Even if everything was working (unable to tell from the log snippet), using a hostname to map to 127.0.0.1 won't work with current versions of CUPS - DNS rebinding attacks often bind a name to point to the loopback interface, so we only allow "localhost" for 127.0.0.1. There is no way to turn off this security protection.

Michael,

I think I found the problem with IPP. It seems to work only with a C
filter, and not with a bash script.

Here's the test. May be it's just me or bash incompatibility with CUPS.

# bash -version
GNU bash, version 4.2.20(1)-release (x86_64-unknown-linux-gnu)


# this command will no end if /etc/cups/interfaces/fx1 is a bash script
DEVICE_URI=ipp://127.0.0.1/printers/fx1 /usr/lib/cups/backend/ipp 0 xx
ss 1 "" /etc/HOSTNAME

# here's the fx1 script and printer ...
# echo '#!/bin/bash\ndate >/tmp/fx1.$$; exit 0' >/etc/cups/interfaces/fx1
# chmod 755 /etc/cups/interfaces/fx1
# lpadmin -p fx1 -i /etc/cups/interfaces/fx1 -v file:/dev/null
# cupsenable fx1
# accept fx1
# date  | lpr -P fx1

# the ipp printer ...
# echo '#!/bin/bash\ncat $6; exit 0' >/etc/cups/interfaces/ix1
# chmod 755 /etc/cups/interfaces/ix1
# lpadmin -p ix1 -i /etc/cups/interfaces/ix1 -v ipp://127.0.0.1/printers/fx1
# cupsenable ix1
# accept ix1
# date | lpr -P ix1

# lpq
ix1-109361              root              1024   Sat Dec 17 21:57:19 2011
fx1-109362              root              1024   Sat Dec 17 21:57:19 2011

When I convert the filter "fx1" to a c program, everything works!

Can IPP be made to work with a bash script filter? LPD works fine (but slow).

Thanks,
Jeff





More information about the cups-devel mailing list