mirror of
https://github.com/sudo-project/sudo.git
synced 2025-09-02 15:25:58 +00:00
For the sudo_root option, check against user_uid, not getuid() since
at this point, ruid == euid == 0.
This commit is contained in:
2
sudo.c
2
sudo.c
@@ -298,7 +298,7 @@ main(argc, argv)
|
|||||||
errorlineno);
|
errorlineno);
|
||||||
|
|
||||||
/* Is root even allowed to run sudo? */
|
/* Is root even allowed to run sudo? */
|
||||||
if (getuid() == 0 && !def_flag(I_ROOT_SUDO)) {
|
if (user_uid == 0 && !def_flag(I_ROOT_SUDO)) {
|
||||||
(void) fputs("You are already root, you don't need to use sudo.\n",
|
(void) fputs("You are already root, you don't need to use sudo.\n",
|
||||||
stderr);
|
stderr);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Reference in New Issue
Block a user