From f684aec8592a1bb3bf5fb82f6ed3cabe4eb11693 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 1 Nov 2010 22:13:50 +0000 Subject: check sudo access for iurt_root_command only --- iurt2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'iurt2') diff --git a/iurt2 b/iurt2 index a023228..1ac3c0f 100755 --- a/iurt2 +++ b/iurt2 @@ -366,7 +366,7 @@ plog_init($program_name, $run{logfd}||$LOG, 7, 1); # For parsing command line # (my $iurt_rev = '$Rev: 271258 $') =~ s/.*: (\d+).*/$1/; (my $iurt_aut = '$Author: blino $') =~ s/.*: (..).*/$1/; -(my $iurt_dat = '$Date: 2010-10-31 23:10:12 +0100 (dim. 31 oct. 2010) $') +(my $iurt_dat = '$Date: 2010-10-31 23:10:12 +0100 (Sun, 31 Oct 2010) $') =~ s/.*: ([\d-]* [\d:]*) .*/$1/; plog("MSG", "This is iurt2 revision $iurt_rev-$iurt_aut ($iurt_dat)"); @@ -697,7 +697,7 @@ plog('DEBUG', "using local user $run{user}, id $run{uid}"); my $luser = $run{user} || 'builder'; check_sudo_access() - or die "FATAL: you need to have sudo access to run $program_name"; + or die "FATAL: you need to have sudo access on $config->{iurt_root_command} to run $program_name"; my $debug_tag = $run{debug} && '_debug'; $run{debug_tag} = $debug_tag; @@ -1576,7 +1576,7 @@ sub find_provides { } sub check_sudo_access() { - return 0 == system("$sudo -S /bin/true &>/dev/null {iurt_root_command} &>/dev/null