Filter Help

Helge Blischke h.blischke at acm.org
Fri Nov 25 00:36:29 PST 2011


Paul Conklin wrote:

>> > I'm trying to write a filter that integrates with a 3rd party app. 
>> > Their requirments are that I call their exe and pass it a page at a
>> > time.  I can parse the file into pages (they need it in PCL) via
>> > ghostscript, but where I'm having problems is figuring out how many
>> > pages there are.
>> >
>> > /usr/bin/gs -dQUIET -dPARANOIDSAFER -dNOPAUSE -dBATCH -dNOMEDIAATTRS
>> > -sDEVICE=ljet4 -sstdout=%stderr
>> > -sOUTPUTFILE=$TMPDIR/$PRINTER-$$-%03d.pcl $6 for file in `/bin/ls
>> > $TMPDIR/$PRINTER-$$-*`
>> >
>> > D [24/Nov/2011:17:01:53 -0800] [Job 21]
>> > /usr/lib/cups/filter/troysecurerx: line 12: /bin/ls: cannot execute
>> > [Permission denied]
>> >
>> >
>> > it looks like I can't ls the files.
>> >
>> > Any help would be greatly appreciated.
>>
>> Just so you all can see ls and gs have the same permissions
>>
>> [root at localhost tmp]# ls -l /bin/ls
>> -rwxr-xr-x 1 root root 95116 Jul 21 18:17 /bin/ls
>> [root at localhost tmp]# ls -l /usr/bin/gs
>> -rwxr-xr-x 1 root root 8424 Sep 13 07:48 /usr/bin/gs
> 
> So, it gets odder...
> if I copy ls to /usr/bin instead of just bin, it works (same permissions)
> /usr/bin and /bin have the same permissions and owner
> if i create a softlink from /usr/bin/ls to /bin/ls it still fails (same
> error as above) what is it that the filter isn't co-operating with /bin?

Replace the "-dPARANOIDSAFER" by "-dNOSAFER", as the [PARANOID]SAFER 
prefents Ghostscript to write to files except stdout and stderr.

Helge





More information about the cups mailing list