]> granicus.if.org Git - sudo/commitdiff
Check def_authenticate, def_noexec and def_monitor when setting return flags.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 19 Nov 2004 19:46:55 +0000 (19:46 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 19 Nov 2004 19:46:55 +0000 (19:46 +0000)
XXX May be better to just set the defaults directly and get rid of those flags.

parse.c

diff --git a/parse.c b/parse.c
index 97a512f1e4af0e55a17c628c01fba0dfe634d98e..ca17f7973d7070f85476bb8e0c549cc6a8c9791c 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -173,11 +173,14 @@ sudoers_lookup(pwflag)
        CLR(validated, VALIDATE_NOT_OK);
        SET(validated, VALIDATE_OK);
        if (tags != NULL) {
-           if (tags->nopasswd == TRUE)
+           if (tags->nopasswd == TRUE ||
+               (tags->nopasswd == UNSPEC && !def_authenticate))
                SET(validated, FLAG_NOPASS);
-           if (tags->noexec == TRUE)
+           if (tags->noexec == TRUE ||
+               (tags->noexec == UNSPEC && def_noexec))
                SET(validated, FLAG_NOEXEC);
-           if (tags->monitor == TRUE)
+           if (tags->monitor == TRUE ||
+               (tags->monitor == UNSPEC && def_monitor))
                SET(validated, FLAG_MONITOR);
        }
     }