in reply to setuid: Perl v C

You might take a look at sudo. You don't say how you plan to run your script, but some OS's (like Linux) won't let you run an interpreter script suid root.

Is root privilege really necessary? What are you doing that seems to need it?

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: setuid: Perl v C
by eyepopslikeamosquito (Archbishop) on May 05, 2003 at 07:27 UTC

    In my little example, the C wrapper wr is setuid, not the interpreter (I am not attempting to use the suidperl binary). The example I posted seems to work fine on Linux. The C wrapper technique I am using is mentioned near the end of perlsec; if I am missing something here, please let me know, as I am no security guru.

    The script is to run at many customer sites and it is unacceptable to ask them to install sudo. The people who run it may not have the root password yet root permissions are required to mess with installing/loading device drivers (which is what the script does).