diff options
author | Gustavo De Nardin <spuk@mandriva.org> | 2007-05-12 20:32:51 +0000 |
---|---|---|
committer | Gustavo De Nardin <spuk@mandriva.org> | 2007-05-12 20:32:51 +0000 |
commit | 688e2df749b62ca51410a0616c3561f02034cf5b (patch) | |
tree | 64f6b9b577b7b934073259d3fb6d237ac6ab8ea9 /iurt2 | |
parent | c2801c794b9bcdcfecb9ce95bc1d449e6c58b128 (diff) | |
download | iurt-688e2df749b62ca51410a0616c3561f02034cf5b.tar iurt-688e2df749b62ca51410a0616c3561f02034cf5b.tar.gz iurt-688e2df749b62ca51410a0616c3561f02034cf5b.tar.bz2 iurt-688e2df749b62ca51410a0616c3561f02034cf5b.tar.xz iurt-688e2df749b62ca51410a0616c3561f02034cf5b.zip |
check sudo access using a simple sudo command, instead of relying in sudo -l
output format (which is different between /etc/sudoers and LDAP)
Diffstat (limited to 'iurt2')
-rwxr-xr-x | iurt2 | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -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 </dev/null"); } __END__ |