]> granicus.if.org Git - sudo/commitdiff
Error out if setusercontext() fails and the runas user is not root.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 20 Jul 2002 12:30:45 +0000 (12:30 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 20 Jul 2002 12:30:45 +0000 (12:30 +0000)
set_perms.c

index ac07eabbcb8d106767d6d29f077dc2937ac6b54d..45374eb077d0681af37a519418a6b7192c8550e0 100644 (file)
@@ -318,8 +318,12 @@ runas_setup()
                perror("cannot set gid to runas gid");
            error = setusercontext(lc, runas_pw,
                runas_pw->pw_uid, flags);
-           if (error)
-               perror("unable to set user context");
+           if (error) {
+               if (runas_pw->pw_gid != 0)
+                   fatal("unable to set user context", 1);
+               else
+                   perror("unable to set user context");
+           }
        } else
 #endif /* HAVE_LOGIN_CAP_H */
        {