sudoers file open is now done only in check_sudoers() so
we just do a rewind() instead of an open. May help people on solaris who were getting EAGAIN.
This commit is contained in:
8
parse.c
8
parse.c
@@ -105,17 +105,13 @@ static int has_meta __P((char *));
|
|||||||
int validate(check_cmnd)
|
int validate(check_cmnd)
|
||||||
int check_cmnd;
|
int check_cmnd;
|
||||||
{
|
{
|
||||||
FILE *sudoers_fp;
|
|
||||||
int return_code;
|
int return_code;
|
||||||
|
|
||||||
/* become sudoers file owner */
|
/* become sudoers file owner */
|
||||||
set_perms(PERM_SUDOERS, 0);
|
set_perms(PERM_SUDOERS, 0);
|
||||||
|
|
||||||
if ((sudoers_fp = fopen(_PATH_SUDO_SUDOERS, "r")) == NULL) {
|
/* we opened _PATH_SUDO_SUDOERS in check_sudoers() so just rewind it */
|
||||||
perror(_PATH_SUDO_SUDOERS);
|
rewind(sudoers_fp);
|
||||||
log_error(NO_SUDOERS_FILE);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
yyin = sudoers_fp;
|
yyin = sudoers_fp;
|
||||||
yyout = stdout;
|
yyout = stdout;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user