On 22 September 1999, era eriksson <era(_at_)iki(_dot_)fi> wrote:
On Wed, 22 Sep 1999 02:21:35 +0300, Liviu Daia
<Liviu(_dot_)Daia(_at_)imar(_dot_)ro>
wrote:
> On 23 January 1999, Stephan Zegherd <inverter(_at_)nbs(_dot_)it> wrote:
>> Every user should logon with username/password, then (un)check
>> some simple hardwired rules: the cgi then will update the
>> .procmailrc file in the right user directory. I knew that I'm a
>> bit off-topic.. but.. in your opinion what is the best (or, more
>> precilely, safer) solution to get the work done (apache is running
>> as nobody) ?
> IMHO the safer solution is: DON'T. Don't even think about it.
> In order to be able to write to an user's .procmailrc, your CGI
> would need to be SUID root (or at least it should be called from a
> SUID root wrapper, such as suexec). Unless you maintained a dozen
But it doesn't have to be implemented like that. If you already have
a .procmailrc (or /etc/procmailrc) which knows where to look, the CGI
just has to update the lookup file and you won't have to touch the
"real thing" from the CGI script at all.
Hmm. I think Procmail will refuse to include a file writable by
another user (or if it doesn't, it should). But you're right, it can be
done if the CGI outputs a sort of template in an "well-known" place, and
the user then runs another program (possibly just "cp") that generates
the .procmailrc from the template. However, I'd still feel somewhat
uncomfortable letting a network-driven program any way near my config
files.
Regards,
Liviu Daia
--
Dr. Liviu Daia e-mail: Liviu(_dot_)Daia(_at_)imar(_dot_)ro
Institute of Mathematics web page: http://www.imar.ro/~daia
of the Romanian Academy PGP key: http://www.imar.ro/~daia/daia.asc