> > Hi,there!
> >
> > I'm wondering if there is any possibility
> > to let a filter run as a different user
> > than lp.
> > In my printcap I have
> >
> > if=/var/lib/lpdfilter/myfilter
> >
> > Now when a user calls "lpr file.txt"
> > the filter is called under user
> > id "lp". The filter tries to write
> > to the user's home dir so the user
> > id of the calling user or root
> > is needed.
> >
> > Is there any way to do this?
>
> Well, depending on what your filter is written in, the obvious answer
> would be to modify it and run it SUID root. The modification would be
> to change the effective UID to the user in question. (You would want
> to make this really bulletproof, among other things NOT doing it in
> a shell script.)
>
> You might also want to set the process's group ID as well. You'd
> want to do that first, while you're still root, I think. (There's
> a good chance that you wouldn't need to do this, but I mention it
> just in case.)
>
> See the man pages for setuid(2) and setgid(2).
Hm... it IS a script calling another programm.
But since it is for our intranet a script might do it as well.
I could write a wrapper... but this wrapper would call
the external program. I guess then I could also set up a sudo
command instead.
So there are no options to change the behavior of the lpd
instead? Something like: call the filter as the user the
job belongs to.
And other idea or comments?
--
Torsten
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------