[cups.general] cannot invoke a interface script

Johannes Meixner jsmeix at suse.de
Tue Aug 2 02:33:46 PDT 2005


On Aug 2 10:11 Martin Kammerlander wrote (shortened):
> Ok now I have a copy of such an As400 file and tried to print it with cups from
> my local machine...

I.e. it was actually sent from the As400 to the CUPS server via
LPD protocol and accepted by the cups-lpd or did you copy it
manually from the As400 on the CUPS server?

If it was sent via LPD protocol and accepted by the cups-lpd
then the problem is not the cups-lpd.

> When I took a look at the file then I saw that the file which comes from the
> As400 is already formated for printing in some way.

Printer specific formatted files must be printed in "raw" mode
because anything else confuses the CUPS filtering, see for example

> It seems that cups (or better the cups-lpd) doesn't like that.

If the As400 file appears as spool file in the CUPS spool directory
(i.e. if there is a print job) then the cups-lpd has accepted it
but further processing fails. To verify it, disable printing of
this queue (but let it accept jobs).

> When I look at the hex value of the
> file then the very first Sign of the file is an "Escape".
> When I write a simple "A" as a first character into the file then fianlly cups
> is able to send this file trough the interface.
> Is there any possibility NOT to manipulate the file and to send it nevertheless
> through the filter (interface) or is this just impossible?

Add an entry to /etc/cups/mime.types so that this file type
can be recognized and then it is accepted by CUPS.
Unknown file types are not accepted by the printing system.

A dirty workaround may be to enable 'application/octet-stream'
in /etc/cups/mime.types but this way any user can "print" any
nonsense data.
E.g. any user can "print" the kernel using "lp /boot/vmlinuz"
and then the printer would spit out tons of sheets with menaingless
characters (/boot/vmlinuz contains several thousand formfeeds).
Therefore it is good not to allow printing of unknown file types
(in particular if normal users also use the print server).

Alternatively it may work to force the cups-lpd to use
-o document-format=application/vnd.cups-raw
which indicates that the content is to be printed in "raw" mode
(but then your filter script may not be started).

Alternatively it may work to force the cups-lpd to use
something like
-o document-format=text/plain
which forces CUPS to handle it as if it was plain text
(regardless what it is in fact) and this should start your
filter script.

Regarding making your script safe against printing of nonsense
data you may have a look at

Kind Regards
Johannes Meixner
SUSE LINUX Products GmbH, Maxfeldstrasse 5      Mail: jsmeix at suse.de
90409 Nuernberg, Germany                    WWW: http://www.suse.de/

More information about the cups mailing list