mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 06:15:37 +00:00
Add VALIDATE_NOT_OK_NOPASS for when user is not allowed to run a command
but the NOPASSWD flag was set. Make runasspec, runaslist, runasuser, and nopasswd typeless in parse.yacc Add support for '!' in the runas list Fix double printing of '%' and '+' for groups and netgroups respectively Add *_matched macros (no need for local stack variable). Should only be used directly after a pop (since top must be >= 2).
This commit is contained in:
@@ -184,6 +184,7 @@ void log_error(code)
|
||||
break;
|
||||
|
||||
case VALIDATE_NOT_OK:
|
||||
case VALIDATE_NOT_OK_NOPASS:
|
||||
(void) sprintf(p,
|
||||
"command not allowed ; TTY=%s ; PWD=%s ; USER=%s ; COMMAND=",
|
||||
tty, cwd, runas_user);
|
||||
@@ -580,6 +581,7 @@ void inform_user(code)
|
||||
break;
|
||||
|
||||
case VALIDATE_NOT_OK:
|
||||
case VALIDATE_NOT_OK_NOPASS:
|
||||
(void) fprintf(stderr,
|
||||
"Sorry, user %s is not allowed to execute \"%s",
|
||||
user_name, cmnd);
|
||||
@@ -719,6 +721,7 @@ static int appropriate(code)
|
||||
break;
|
||||
|
||||
case VALIDATE_NOT_OK:
|
||||
case VALIDATE_NOT_OK_NOPASS:
|
||||
#ifdef SEND_MAIL_WHEN_NOT_OK
|
||||
return (1);
|
||||
#else
|
||||
|
Reference in New Issue
Block a user