]> granicus.if.org Git - sudo/commitdiff
For the sudo_root option, check against user_uid, not getuid() since
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 1 Nov 1999 15:43:12 +0000 (15:43 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 1 Nov 1999 15:43:12 +0000 (15:43 +0000)
at this point, ruid == euid == 0.

sudo.c

diff --git a/sudo.c b/sudo.c
index 48299ab91917be11f1127f2a4dc27810a7cc5f87..b84bc9df263ab9489f560cb78b7931ae5692aa64 100644 (file)
--- 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);