lpr output filters

Lloyd Kremer kremer at cs.odu.edu
Wed Apr 12 03:39:57 AEST 1989



In article <8185 at chinet.chi.il.us> les at chinet.chi.il.us (Leslie Mikesell)
writes:
>*In article <1159 at novavax.UUCP> gls at novavax.UUCP (Gary Schaps) writes:
>*>> > Does it seem reasonable to try to create an lpr output filter which 
>*>> > selectively prevents certain files from being printed?
>*
>*>I would like to "protect" certain files by making them "view only". 
>
>...................................  The best you could do would be
>to make the files unreadable by normal users and provide a setuid program
>that displays the contents only if the output is directly to a terminal.


This could be made even more secure by displaying not to just *any* terminal,
but specifically to /dev/tty.

How about this?  :

Create a pseudo-user, say "viewer".  Block the login sequence for this
pseudo-user.  Make all view-only files mode 400 viewer.  Write an executable
(not a shell-script) that just opens /dev/tty if possible, and copies the
requested file(s) to it.  Screen pagination would be a nice touch (--MORE--).
Make the executable setuid viewer.  This would (hopefully) discourage all
users except those resourceful enough to change their process's controlling
tty before running the executable.

Take care that the executable does not utilize on any other program such as
vi, ex, ed, etc.  The user could then write the buffer anywhere by means
of ':w ! lpr', or something similar.

This is no doubt still circumventable somehow, since one of UNIX's great
strengths is the ability to redirect and pipe anything anywhere, but it
might be useful as a starting point.


					Lloyd Kremer
					Brooks Financial Systems
					{uunet,sun,...}!xanth!brooks!lloyd



More information about the Comp.unix.wizards mailing list