|
@ -6362,11 +6362,17 @@ _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 |
|
|
|
|
|
#it's a normal user doing "sudo su", or `sudo -i` or `sudo -s` |
|
|
|
|
|
#fine |
|
|
|
|
|
return 0 |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
case "$SUDO_COMMAND" in |
|
|
|
|
|
*/su ) |
|
|
|
|
|
#it's a normal user doing `sudo su`, no problem |
|
|
|
|
|
return 0 ;; |
|
|
|
|
|
esac |
|
|
|
|
|
for i in `cat /etc/shells`; do |
|
|
|
|
|
if [ "$SUDO_COMMAND" = "$i" ]; then |
|
|
|
|
|
#it's a normal user running `sudo -i` or `sudo -s`, fine |
|
|
|
|
|
return 0 |
|
|
|
|
|
fi |
|
|
|
|
|
done |
|
|
#otherwise |
|
|
#otherwise |
|
|
return 1 |
|
|
return 1 |
|
|
fi |
|
|
fi |
|
|