in reply to forcing script to run as specific user

there is an element of OS dependence here. for example:
print "real userID: $<\n"; print "effective userID: $>\n";
then chown nobody / chmod 4755 and

on linux the output is (20039 is my UID, nobody is 99):
real userID: 20039
effective userID: 20039

but on solaris:
real userID: 20039
effective userID: 99

take a look at 'perldoc perlsec' for more info on setuid scripts. i believe you'll need to run the 'suidperl' binary to do what you want to do.

Replies are listed 'Best First'.
Re: Re: forcing script to run as specific user
by Joost (Canon) on Jun 06, 2002 at 08:46 UTC
    take a look at 'perldoc perlsec' for more info on setuid scripts. i believe you'll need to run the 'suidperl' binary to do what you want to do.

    As there are numerous complications with setuid scripts and suidperl *, I would go for the sudo option mentioned above.

    * See this entry in the perldelta manpage for 5.8.0 rc1:

    After years of trying the suidperl is considered to be too complex to ever be considered truly secure. The suidperl functionality is likely to be removed in a future release.

    -- Joost downtime n. The period during which a system is error-free and immune from user input.