yelekeri has asked for the wisdom of the Perl Monks concerning the following question:
Monks, I just installed sudo on the unix machine where I can successfully use the "su" command and become some other user. Now when I run this script, it is not giving me any meaningful information, always returns the information as described below. Any thoughts on this :
OUTPUT is always this :use Sudo; my $password = '*****'; my $su = Sudo->new( { sudo => '/usr/bin/su', username => "*****" , password => $password, program => "/tmp/test.sh" , program_args => '' } ); $result = $su->sudo_run(); print "$result \n"; if (exists($result->{error}) ) { &handle_error($result); } else { printf "STDOUT: %s\n",$result->{stdout}; printf "STDERR: %s\n",$result->{stderr}; printf "return: %s\n",$result->{rc}; }
HASH(0x14a4e0) STDOUT: STDERR: return:
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: perl and sudo basic question
by Old_Gray_Bear (Bishop) on Jul 10, 2007 at 00:16 UTC | |
by yelekeri (Novice) on Jul 10, 2007 at 02:46 UTC | |
by yelekeri (Novice) on Jul 10, 2007 at 03:41 UTC | |
by Tomte (Priest) on Jul 10, 2007 at 06:20 UTC | |
by Argel (Prior) on Jul 10, 2007 at 06:36 UTC | |
by johngg (Canon) on Jul 10, 2007 at 09:21 UTC | |
by yelekeri (Novice) on Jul 10, 2007 at 14:54 UTC | |
| |
Re: perl and sudo basic question
by almut (Canon) on Jul 09, 2007 at 23:28 UTC | |
Re: perl and sudo basic question
by Argel (Prior) on Jul 09, 2007 at 23:49 UTC | |
Re: perl and sudo basic question
by dynamo (Chaplain) on Jul 09, 2007 at 22:41 UTC |
Back to
Seekers of Perl Wisdom