[comp.unix.questions] rsh in a setuid shell script

glen@meteor.wisc.edu (Glen Ecklund) (02/13/91)

I am trying to work around a problem with our lpr software.
I would like to enable users to use a remote printer on a machine
on which they have no login.

I created a setuid program which changes uid to user lp, then does an
rsh to the machine with the printer as user lp.
	#!/bin/csh -b
	id
	cat $* | /bin/rsh othercomputer "lpr -Pprinter"
Unfortunately, the id shows that the euid is changed to lp but not the uid.
The result is that the rsh reports "Login incorrect"  (it is not logging
in as lp, but as the user who ran the script).
Is there anything I can do?

Glen
-- 
Glen Ecklund				glen@meteor.wisc.edu
Department of Meteorology               (608) 262-3086
University of Wisconsin, Madison