2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-30 22:05:46 +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:
Todd C. Miller
1999-11-01 15:43:12 +00:00
parent b20a6bb339
commit e08f3f3937

2
sudo.c
View File

@@ -298,7 +298,7 @@ main(argc, argv)
errorlineno);
/* 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",
stderr);
exit(1);