From 1265fcc4f8a8b171b943b9877e00de8dcba56c91 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 22 Mar 1996 00:55:29 +0000 Subject: [PATCH] added NO_PASSWD --- OPTIONS | 6 ++++++ options.h | 1 + sudo.c | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/OPTIONS b/OPTIONS index 6274db40d..5113004c2 100644 --- 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 diff --git a/options.h b/options.h index e77fee319..2f53ce591 100644 --- 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 37e8386d8..f75d54793 100644 --- 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); -- 2.50.1