From: Todd C. Miller Date: Mon, 1 Nov 1999 15:43:12 +0000 (+0000) Subject: For the sudo_root option, check against user_uid, not getuid() since X-Git-Tag: SUDO_1_6_0~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e08f3f3937da7197810e31628c08409ec14d7141;p=sudo For the sudo_root option, check against user_uid, not getuid() since at this point, ruid == euid == 0. --- diff --git a/sudo.c b/sudo.c index 48299ab91..b84bc9df2 100644 --- a/sudo.c +++ b/sudo.c @@ -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);