Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!rice!sun-spots-request From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.sys.sun Subject: Re: How does lpr decide on the user? Keywords: SunOS Message-ID: <2298@brazos.Rice.edu> Date: 19 Oct 89 20:22:59 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 22 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 8, Issue 168, message 1 of 12 jon@astro.ucla.edu (Jonathan Eisenhamer) writes: \A simple question: How does lpr decide on who is going to be the owner of \a printing job? [...] If file descriptor 0, 1 or 2 refers to a tty, the owner of the job is the person logged in on that tty, else it is the real uid... :-( (Remember: lpr's effective uid is root.) Work-around: % cat mylpr #!/bin/sh exec 3>&1 test -t 0 && exec < /dev/null (/usr/ucb/lpr ${1+"$@"} | cat >&3) 2>&1 | cat >&2 Now we're sure none of the mentioned file descriptors refers to a terminal. A symbolic link is a POINTER to a file, | Maarten Litmaath @ VU Amsterdam: a hard link is the file system's GOTO. | maart@cs.vu.nl, mcsun!botter!maart