[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problem with setuid script starting pppd



On Tue, Jun 10, 2003 at 18:25:11 +0200, Vincent Lefevre wrote:
> I have written a setuid/setgid-root Perl script that does the
> following:
> 
> #!/usr/bin/suidperl -T
> 
> use strict;
> use warnings;
> 
> $ENV{'PATH'} = '/usr/sbin:/usr/bin:/sbin:/bin';
> 
> @ARGV == 1 and my ($isp) = $ARGV[0] =~ /^([-0-9A-Za-z_]+)$/
>   or die "Usage: ppp-on <ISP>\n";
> 
> $< = $>;  # set real to effective uid
[...]

FYI, the problem was solved by setting the gid too: $( = $);
(thanks to Thomas Hood for the suggestion).

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/> - 100%
validated (X)HTML - Acorn Risc PC, Yellow Pig 17, Championnat International
des Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA



Reply to: