]> granicus.if.org Git - sudo/commitdiff
added NO_PASSWD
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 22 Mar 1996 00:55:29 +0000 (00:55 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 22 Mar 1996 00:55:29 +0000 (00:55 +0000)
OPTIONS
options.h
sudo.c

diff --git a/OPTIONS b/OPTIONS
index 6274db40d08217961ad4518e66eea8208a35e830..5113004c2c163d3ea0f352576512d8a28a2c2277 100644 (file)
--- a/OPTIONS
+++ b/OPTIONS
@@ -64,6 +64,12 @@ EXEMPTGROUP
     a password but where Jr. sysadmins need to.
     This is off by default.
 
+NO_PASSWD
+    If this is defined then sudo will *never* ask for a password.
+    It should only be used in an environment where machines are
+    physically secure.  It would be a very bad idea for an open
+    lab.
+
 ENV_EDITOR
     Makes visudo consult the EDITOR and VISUAL environmental variables
     before falling back on the default editor.  Note that this may create
index e77fee319b82a1b91e4fae7e11b8eca7c4e9283f..2f53ce5914e726ad635d21b0ee124faacf3f1868 100644 (file)
--- a/options.h
+++ b/options.h
@@ -40,6 +40,7 @@
 #define SEND_MAIL_WHEN_NO_USER /* send mail when user not in sudoers file */
 /*#define SEND_MAIL_WHEN_NOT_OK        /* send mail if no permissions to run command */
 /*#define EXEMPTGROUP "sudo"   /* no passwd needed for users in this group */
+/*#define NO_PASSWD            /* no passwds are required */
 /*#define ENV_EDITOR           /* visudo honors EDITOR and VISUAL envars */
 #define SHORT_MESSAGE          /* short sudo message, no copyright printed */
 #define TIMEOUT 5              /* minutes before sudo asks for passwd again */
diff --git a/sudo.c b/sudo.c
index 37e8386d81f36a52dfa141fdfed735e22e9ca3c3..f75d54793b2f777474dfc11e44c872ae1a5c1c66 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -291,7 +291,9 @@ int main(argc, argv)
        remove_timestamp();     /* remove the timestamp ticket file */
        exit(0);
     } else if (sudo_mode == MODE_LIST) {
+#ifndef NO_PASSWD
        check_user();
+#endif /* NO_PASSWD */
        log_error(ALL_SYSTEMS_GO);
        (void) validate(FALSE);
        exit(0);
@@ -304,7 +306,9 @@ int main(argc, argv)
     switch (rtn) {
 
        case VALIDATE_OK:
+#ifndef NO_PASSWD
            check_user();
+#endif /* NO_PASSWD */
            log_error(ALL_SYSTEMS_GO);
            if (sudo_mode == MODE_VALIDATE)
                exit(0);