Promote strict field in sudoers_parser_config from bool to int.

This will be used by visudo to indicate when "visudo -s" is run.
This commit is contained in:
Todd C. Miller
2023-09-18 12:42:51 -06:00
parent e28dc0f275
commit 8fcb21b5cd
2 changed files with 4 additions and 4 deletions

View File

@@ -81,10 +81,10 @@ struct group_list {
*/
struct sudoers_parser_config {
const char *sudoers_path;
bool strict;
int strict;
int verbose;
bool recovery;
bool ignore_perms;
int verbose;
mode_t sudoers_mode;
uid_t sudoers_uid;
gid_t sudoers_gid;
@@ -92,9 +92,9 @@ struct sudoers_parser_config {
#define SUDOERS_PARSER_CONFIG_INITIALIZER { \
NULL, /* sudoers_path */ \
false, /* strict */ \
1, /* verbose level 1 */ \
true, /* recovery */ \
false, /* ignore_perms */ \
1, /* verbose level 1 */ \
SUDOERS_MODE, \
SUDOERS_UID, \
SUDOERS_GID \

View File

@@ -285,7 +285,7 @@ main(int argc, char *argv[])
* Parse the existing sudoers file(s) to highlight any existing
* errors and to pull in editor and env_editor conf values.
*/
ctx.parser_conf.strict = true;
ctx.parser_conf.strict = strict + 1;
ctx.parser_conf.verbose = quiet ? 0 : 2;
ctx.parser_conf.sudoers_path = path_sudoers;
init_parser(&ctx, NULL);