Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!psuvax1!allien!Ahab!tel From: tel@Ahab.UUCP (Tom Lowe) Newsgroups: comp.bugs.sys5 Subject: Re: SysV lp spooler a security hole Message-ID: <12@Ahab.UUCP> Date: Fri, 18-Sep-87 08:44:05 EDT Article-I.D.: Ahab.12 Posted: Fri Sep 18 08:44:05 1987 Date-Received: Sun, 20-Sep-87 00:39:38 EDT References: <313@pvab.UUCP> <15000001@bradley> Organization: AT&T National Systems Support Center, South Plainfield, NJ Lines: 77 Summary: Why not use the -o option of lp? > > kitty.UUCP!Larry (Larry Lippman) Writes: > > |1. There is no reason why more than one printer name cannot be associated > |with _one_ physical printer using _one_ physical I/O port. The usefulness > |here is to invoke the _same_ printer in a different fashion merely by > |specifying a different printer name as an lp(1) argument. For example, > |one name will invoke a laser printer for landscape printing (132 cols wide), > |with another name will invoke the laser printer for portrait printing (80 > |cols wide). The different setup commands for the laser printer are contained > |in the individual /usr/spool/lp/interface/printer_name shell scripts. The interface program can be written to accept options using the -o option of lp.....i.e.: lp [options] -op # for printing portrait or lp [options] -ol # for printing landscape when lp calls the interface program, it would pass the -o options on to the interface program for it to interpret. The following is an example of how to interpret those options. -------- # Sample Spooler Interface # for spooling jobs to a laser printer # # bin=/usr/lbin lib=/usr/lib gid=`grep "^$2:" /etc/passwd | cut -f4 -d:` group=`grep "^[^:]*::$gid:" /etc/group | cut -f1 -d:` bname=$0 reqid=$1 usrid=$2 title=$3 copies=$4 options=$5 fname=$6 shift;shift;shift;shift;shift files="$*" # parse the spooler device dependent options # for i in $options do case "$i" in p) #do here what ever it is you have to do to #get the printer printing in portrait mode and print the stuff ;; l) #do here what ever it is you have to do to #get the printer to print in landscape mode and print the stuff esac done # the end. ------------ Notice: This is a very abbreviated interface program. It is designed to show how to use the options. If you have an imagen printer or access to the imagen interface program, take a look at it. All the code for stty settings and for the actual printing of the files has to be added. If you have any questions, send me a note! Tom Lowe lowe@psuvax1.UUCP