Unverified Commit c9452c9f authored by neil's avatar neil Committed by GitHub
Browse files

Merge pull request #2574 from rewqazxv/master

Fix sudo issue
parents 06995fb0 79ad0ff5
...@@ -6448,10 +6448,10 @@ _checkSudo() { ...@@ -6448,10 +6448,10 @@ _checkSudo() {
#it's root using sudo, no matter it's using sudo or not, just fine #it's root using sudo, no matter it's using sudo or not, just fine
return 0 return 0
fi fi
if [ "$SUDO_COMMAND" = "/bin/su" ] || [ "$SUDO_COMMAND" = "/bin/bash" ]; then if [ -n "$SUDO_COMMAND" ]; then
#it's a normal user doing "sudo su", or `sudo -i` or `sudo -s` #it's a normal user doing "sudo su", or `sudo -i` or `sudo -s`
#fine _endswith "$SUDO_COMMAND" /bin/su || grep "^$SUDO_COMMAND\$" /etc/shells >/dev/null 2>&1
return 0 return $?
fi fi
#otherwise #otherwise
return 1 return 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment