]> git.gag.com Git - debian/sudo/commitdiff
patch from upstream to fix special case in password checking code
authorBdale Garbee <bdale@gag.com>
Tue, 11 Jan 2011 17:18:15 +0000 (10:18 -0700)
committerBdale Garbee <bdale@gag.com>
Tue, 25 Jan 2011 23:06:08 +0000 (09:06 +1000)
when only the gid is changing, closes #609641

check.c

diff --git a/check.c b/check.c
index d6efa6d0befe153b9d8dcb251fda09371bbf538e..b2c44e145b2955d6eb8599f2b65c9dee5b54294d 100644 (file)
--- a/check.c
+++ b/check.c
@@ -119,7 +119,13 @@ check_user(validated, mode)
     if (ISSET(mode, MODE_INVALIDATE)) {
        SET(validated, FLAG_CHECK_USER);
     } else {
-       if (user_uid == 0 || user_uid == runas_pw->pw_uid || user_is_exempt())
+       /*
+        * Don't prompt for the root passwd or if the user is exempt.
+        * If the user is not changing uid/gid, no need for a password.
+        */
+       if (user_uid == 0 || (user_uid == runas_pw->pw_uid &&
+           (!runas_gr || user_in_group(sudo_user.pw, runas_gr->gr_name))) ||
+           user_is_exempt())
            return;
     }