mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 06:15:37 +00:00
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:
5
sudo.c
5
sudo.c
@@ -848,8 +848,8 @@ parse_args(argc, argv)
|
||||
}
|
||||
|
||||
/*
|
||||
* Sanity check sudoers mode/owner/type.
|
||||
* Leaves a file pointer to the sudoers file open in ``fp''.
|
||||
* Open sudoers and sanity check mode/owner/type.
|
||||
* Returns a handle to the sudoers file.
|
||||
*/
|
||||
FILE *
|
||||
open_sudoers(sudoers)
|
||||
@@ -919,6 +919,7 @@ open_sudoers(sudoers)
|
||||
}
|
||||
if (fp == NULL)
|
||||
log_error(USE_ERRNO, "can't open %s", sudoers);
|
||||
rewind(fp);
|
||||
(void) fcntl(fileno(fp), F_SETFD, 1);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user