Only treat an unknown Defaults entry as a parse error in visudo,

not in sudo itself.
This commit is contained in:
Todd C. Miller
2016-11-01 15:08:11 -06:00
parent 8a48085184
commit f6ce83ea76
7 changed files with 124 additions and 116 deletions

View File

@@ -87,7 +87,7 @@ sudo_file_close(struct sudo_nss *nss)
debug_decl(sudo_file_close, SUDOERS_DEBUG_NSS)
/* Free parser data structures and close sudoers file. */
init_parser(NULL, false);
init_parser(NULL, false, false);
if (nss->handle != NULL) {
fclose(nss->handle);
nss->handle = NULL;
@@ -107,7 +107,7 @@ sudo_file_parse(struct sudo_nss *nss)
if (nss->handle == NULL)
debug_return_int(-1);
init_parser(sudoers_file, false);
init_parser(sudoers_file, false, false);
sudoersin = nss->handle;
if (sudoersparse() != 0 || parse_error) {
if (errorlineno != -1) {