we start at the right file position when reading include files.
int error, nopass;
enum def_tupple pwcheck;
- /* We opened _PATH_SUDOERS in check_sudoers() so just rewind it. */
- rewind(sudoers_fp);
yyin = sudoers_fp;
yyout = stdout;
}
/*
- * 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)
}
if (fp == NULL)
log_error(USE_ERRNO, "can't open %s", sudoers);
+ rewind(fp);
(void) fcntl(fileno(fp), F_SETFD, 1);
}