Package: printfilters-ppd Version: 2.13-9 Filename: pool/main/p/printfilters-ppd/printfilters-ppd_2.13-9_i386.deb Found error in /usr/lib/printfilters/master-filter: $ grep -A5 -B5 /tmp/ /usr/lib/printfilters/master-filter set -v exec 2>log.filter thetempfile='' else #added by A Mennucc: get errors # and avoid using /tmp/evillog , which has /tmp security problem # other scripts use 'mktemp', so I use it thetempfile=`mktemp /tmp/master-filter.XXXXXX` exec 2>$thetempfile fi function onexit () { #added by A Mennucc1: more nicely treat unprintable files or any other error -- # if [ $depth -ge $MAX_DEPTH ]; then return 1 fi if [ $DEBUG_TREE ]; then echo "Starting point = $start" >> /tmp/filter.debug fi if [ $(filtto $start) = "$DESIRED_TO" ]; then echo " DONE" return 0 -- while [ $1 ]; do try=$1 shift if [ $DEBUG_TREE ]; then echo "for $start trying $try" >> /tmp/filter.debug fi if [ $(filtfrom $try) = $(filtto $start) ]; then echo -n "$start.fpi:$depth:CONT " #A Mennucc: quotes! -- else # echo -n $try nextlvl $try $((depth+1)) $all # echo "|G is $G| " if [ $DEBUG_TREE ]; then echo "|rt is $?|" >> /tmp/filter.debug fi if [ "$?" = "0" ] then if [ $DEBUG_TREE ]; then echo "for $start we are done" >> /tmp/filter.debug fi # return 0 else if [ $DEBUG_TREE ]; then echo "for $start we have failed" >> /tmp/filter.debug fi return 1 fi fi fi -- # MAX_DEPTH=6 # # define these to gets lots of feedback # output is appended on /tmp/filter.debug # DEBUG_TREE="" DEBUG_FILTER="" # -- eval `pcap -P$queue:PRINTER_TYPE` >> /dev/null eval `pcap -P$queue:ASCII_TO_PS` >> /dev/null fi if [ "$DEBUG_FILTER" != "" ]; then echo "Desired print format is $DESIRED_TO" >> /tmp/filter.debug echo "Paper size is $PAPERSIZE" >> /tmp/filter.debug echo -n "A form feed will " >> /tmp/filter.debug if [ "$SEND_EOF" = "" ]; then echo "not be sent." >> /tmp/filter.debug else echo "be sent." >> /tmp/filter.debug fi fi cd $FPIDIR fpis=$(ls *.fpi 2> /dev/null | tr '\n' ' ' | sed 's/\.fpi//g') -- ${prefix}/lib/printfilters/rewindstdin # RH70 removed magic=${magic#*: } if [ "$DEBUG_FILTER" != "" ]; then echo "Magic is |$magic|" >> /tmp/filter.debug fi case `echo $magic | tr 'A-Z' 'a-z'` in *empty* ) exit;; -- # handle extra magics they've defined filters for # # call_user_magic_hook() # if [ "$DEBUG_FILTER" != "" ]; then echo "Type of file is $startpnt" >> /tmp/filter.debug fi if [ "$startpnt" = "Dont know" ]; then echo "Error - input file type is unknown - cannot print" 1>&2 exit 1 -- # source ${SPOOLDIR}/postscript.cfg # else # eval `pcap -P$queue:GSDEVICE` >> /dev/null # fi # #gs needs a file to treat pdf # t=`mktemp /tmp/master-filter-pdf.XXXXXX` # if [ "$GSDEVICE" != "POSTSCRIPT" ]; then # bestpath="$startpnt | { cat > $t ; ps-to-printer.fpi --inputfile $t ; rm $t ; }" # foundbest="YES" # fi fi -- # we go through and find best path # G=`nextlvl "$startpnt" "0" $fpis` if [ "$DEBUG_FILTER" != "" ]; then echo "$G" >> /tmp/filter.debug fi # # now sort out the best path of all available # -- else root="$root | $entry" fi if [ ${i##*:} = "DONE" ]; then if [ "$DEBUG_FILTER" != "" ]; then echo "$root -> depth = $depth" >> /tmp/filter.debug fi if [ $depth -lt $bestdepth ]; then foundbest="YES" bestdepth=$depth bestpath=$root -- PNAME="`cat ${SPOOLDIR}/.paprc`" bestpath="$bestpath | /usr/bin/pap -p $PNAME" fi if [ "$DEBUG_FILTER" != "" ]; then echo "Best path of depth $bestdepth is $bestpath" >> /tmp/filter.debug fi # # run the command! # # A Mennucc: THIS IS VERY BAD FOR SECURITY!!!!!! # eval $bestpath 2> /tmp/evillog # instead stderr have already been redirected to $thetempfile eval $bestpath #