From 688e2df749b62ca51410a0616c3561f02034cf5b Mon Sep 17 00:00:00 2001 From: Gustavo De Nardin Date: Sat, 12 May 2007 20:32:51 +0000 Subject: check sudo access using a simple sudo command, instead of relying in sudo -l output format (which is different between /etc/sudoers and LDAP) --- iurt2 | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'iurt2') diff --git a/iurt2 b/iurt2 index 5d31328..286cd7c 100755 --- a/iurt2 +++ b/iurt2 @@ -1464,13 +1464,7 @@ sub find_provides { } sub check_sudo_access() { - open my $right, "$sudo -l |"; - return 1 if ! $<; - local $_; - while (<$right>) { - /\(ALL\)\s+NOPASSWD:\s+ALL/ and return 1; - } - 0; + return 0 == system("/usr/bin/sudo -S /bin/true &>/dev/null