
Starting qmail from perl script
Quote:
> I need users in a certain group to be able to restart Qmail (after
> editing files in /var/qmail/control).
> It seems that the only way Qmail will start is with the exact syntax
> provided in the documentation -
> csh -cf 'qmail-start ./Mailbox splogger qmail &'
And why should you want to start it in an undocumented way? :-)
Quote:
> So anyway, I can't just stick that in a shell script and +s it because
> Linux doesn't allow suid scripts.
Good for Linux!
Quote:
> I can't put it in a Perl program because no
> combination of permissions would please csh.
Naaaaah. Perl can do it! If nothing else, you can pass those args to csh,
and let it start qmail.
Quote:
> The only way I managed to get it to work at all was to write a C
> program that setuid(0) then called that does this with system(). The
> problem with that is, when the Perl program finishes, Qmail dies with
> it.
Why not do is from a set-id Perl program? (Read perlsec, though.) You'll
probably want to use fork-and-exec, rather that system. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/