summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorTodd C. Miller <Todd.Miller@courtesan.com>2000-01-17 04:05:18 +0000
committerTodd C. Miller <Todd.Miller@courtesan.com>2000-01-17 04:05:18 +0000
commit96bb36186608ca86a2becd983afde2ffe178b427 (patch)
treea2f61fe59c93b7b2f67ed62b7015263aba906638 /parse.c
parent620bba30b53b44e18bcdc418d16af70a421cb40e (diff)
downloadsudo-96bb36186608ca86a2becd983afde2ffe178b427.tar.gz
Add "listpw" and "verifypw" options.
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/parse.c b/parse.c
index 9080da0b3..5d3a0cc49 100644
--- a/parse.c
+++ b/parse.c
@@ -129,7 +129,7 @@ sudoers_lookup(pwflags)
init_parser();
/* For most pwflags to be useful we need to keep more state around. */
- if (pwflags && !(pwflags & PWCHECK_NEVER))
+ if (pwflags && pwflags != PWCHECK_NEVER && pwflags != PWCHECK_ALWAYS)
keepall = TRUE;
/* Need to be root while stat'ing things in the parser. */
@@ -167,7 +167,7 @@ sudoers_lookup(pwflags)
if (pwflags) {
int nopass, found;
- if ((pwflags & PWCHECK_NEVER) || !def_flag(I_AUTHENTICATE))
+ if (pwflags == PWCHECK_NEVER || !def_flag(I_AUTHENTICATE))
nopass = FLAG_NOPASS;
else
nopass = -1;
@@ -175,12 +175,10 @@ sudoers_lookup(pwflags)
while (top) {
if (host_matches == TRUE) {
found = 1;
- if (!(pwflags & PWCHECK_RUNAS) || runas_matches == TRUE) {
- if ((pwflags & PWCHECK_ANY) && no_passwd == TRUE)
- nopass = FLAG_NOPASS;
- else if ((pwflags & PWCHECK_ALL) && nopass != 0)
- nopass = (no_passwd == TRUE) ? FLAG_NOPASS : 0;
- }
+ if (pwflags == PWCHECK_ANY && no_passwd == TRUE)
+ nopass = FLAG_NOPASS;
+ else if (pwflags == PWCHECK_ALL && nopass != 0)
+ nopass = (no_passwd == TRUE) ? FLAG_NOPASS : 0;
}
top--;
}