in reply to getcwd() as different user
#! /usr/bin/perl -w -T use strict; use Cwd; $ENV{PATH} = "/usr/local/bin:/usr/bin:/bin"; delete($ENV{BASH_ENV}); #500 is my non-root uid that I want to test with; my $newuid = 500; unless ($< == 0 and $> == 0) { die "must be root"; } system('whoami'); print getcwd."\n"; $> = $< = $newuid ; system('whoami'); print getcwd."\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: getcwd() as different user
by 0xbeef (Hermit) on Nov 18, 2005 at 22:42 UTC | |
by 0xbeef (Hermit) on Nov 19, 2005 at 12:53 UTC |