added support for NO_PASSWD and runas from garp@opustel.com

This commit is contained in:
Todd C. Miller
1996-04-28 00:59:21 +00:00
parent 88c189315c
commit 32002b7d97
2 changed files with 52 additions and 6 deletions

19
parse.c
View File

@@ -74,12 +74,11 @@ static char rcsid[] = "$Id$";
#include "sudo.h"
#include <options.h>
extern FILE *yyin, *yyout;
/*
* Globals
*/
int parse_error = FALSE;
extern FILE *yyin, *yyout;
/*
* Prototypes for static (local) functions
@@ -146,10 +145,20 @@ int validate(check_cmnd)
while (top) {
if (host_matches == TRUE)
if (cmnd_matches == TRUE)
/* user was granted access to cmnd on host */
return(VALIDATE_OK);
if (runas_user == NULL ||
(runas_user != NULL && runas_matches == TRUE))
/*
* User was granted access to cmnd on host.
* If no passwd required return as such.
*/
if (no_passwd == TRUE)
return(VALIDATE_OK_NOPASS);
else
return(VALIDATE_OK);
else
return(VALIDATE_NOT_OK);
else if (cmnd_matches == FALSE)
/* user was explicitly denied acces to cmnd on host */
/* User was explicitly denied acces to cmnd on host. */
return(VALIDATE_NOT_OK);
top--;
}