From: Todd C. Miller Date: Wed, 12 Dec 2001 21:00:56 +0000 (+0000) Subject: Make 'listpw=never' work for users who are not explicitly mentioned in X-Git-Tag: SUDO_1_6_4~121 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=afff0d56b44ef887a1a1b340d589de6df0f3f239;p=sudo Make 'listpw=never' work for users who are not explicitly mentioned in sudoers. --- diff --git a/parse.c b/parse.c index 4919906b6..a6db514e1 100644 --- a/parse.c +++ b/parse.c @@ -117,6 +117,7 @@ sudoers_lookup(pwflag) { int error; int pwcheck; + int nopass; /* Become sudoers file owner */ set_perms(PERM_SUDOERS, 0); @@ -174,13 +175,12 @@ sudoers_lookup(pwflag) * It is set for the "validate", "list" and "kill" pseudo-commands. * Always check the host and user. */ + nopass = -1; if (pwcheck) { - int nopass, found; + int found; if (pwcheck == PWCHECK_NEVER || !def_flag(I_AUTHENTICATE)) nopass = FLAG_NOPASS; - else - nopass = -1; found = 0; while (top) { if (host_matches == TRUE) { @@ -229,7 +229,9 @@ sudoers_lookup(pwflag) /* * The user was not explicitly granted nor denied access. */ - return(error); + if (nopass == -1) + nopass = 0; + return(error | nopass); } /*