Rewind sudoers_fp in open_sudoers() instead of sudoers_lookup() so
we start at the right file position when reading include files.
This commit is contained in:
2
parse.c
2
parse.c
@@ -109,8 +109,6 @@ sudoers_lookup(pwflag)
|
|||||||
int error, nopass;
|
int error, nopass;
|
||||||
enum def_tupple pwcheck;
|
enum def_tupple pwcheck;
|
||||||
|
|
||||||
/* We opened _PATH_SUDOERS in check_sudoers() so just rewind it. */
|
|
||||||
rewind(sudoers_fp);
|
|
||||||
yyin = sudoers_fp;
|
yyin = sudoers_fp;
|
||||||
yyout = stdout;
|
yyout = stdout;
|
||||||
|
|
||||||
|
5
sudo.c
5
sudo.c
@@ -848,8 +848,8 @@ parse_args(argc, argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sanity check sudoers mode/owner/type.
|
* Open sudoers and sanity check mode/owner/type.
|
||||||
* Leaves a file pointer to the sudoers file open in ``fp''.
|
* Returns a handle to the sudoers file.
|
||||||
*/
|
*/
|
||||||
FILE *
|
FILE *
|
||||||
open_sudoers(sudoers)
|
open_sudoers(sudoers)
|
||||||
@@ -919,6 +919,7 @@ open_sudoers(sudoers)
|
|||||||
}
|
}
|
||||||
if (fp == NULL)
|
if (fp == NULL)
|
||||||
log_error(USE_ERRNO, "can't open %s", sudoers);
|
log_error(USE_ERRNO, "can't open %s", sudoers);
|
||||||
|
rewind(fp);
|
||||||
(void) fcntl(fileno(fp), F_SETFD, 1);
|
(void) fcntl(fileno(fp), F_SETFD, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user