diff options
author | Todd C. Miller <Todd.Miller@sudo.ws> | 2023-05-09 07:29:06 -0600 |
---|---|---|
committer | Todd C. Miller <Todd.Miller@sudo.ws> | 2023-05-09 07:29:06 -0600 |
commit | 68642aaa64a80f1caa78be5224574af007e91f93 (patch) | |
tree | 4b9ea9ffbb82942778be78d832711263d5d36ec0 | |
parent | ca71add99f5f2d90f8d1559f0a4e667314a414e7 (diff) | |
download | sudo-68642aaa64a80f1caa78be5224574af007e91f93.tar.gz |
Rename parser_conf -> sudoers_conf in all but the parser itself.
-rw-r--r-- | plugins/sudoers/policy.c | 14 | ||||
-rw-r--r-- | plugins/sudoers/testsudoers.c | 12 | ||||
-rw-r--r-- | plugins/sudoers/visudo.c | 26 |
3 files changed, 26 insertions, 26 deletions
diff --git a/plugins/sudoers/policy.c b/plugins/sudoers/policy.c index 5a3c2a038..7157fab2b 100644 --- a/plugins/sudoers/policy.c +++ b/plugins/sudoers/policy.c @@ -50,7 +50,7 @@ struct sudoers_exec_args { char ***info; }; -static struct sudoers_parser_config parser_conf = SUDOERS_PARSER_CONFIG_INITIALIZER; +static struct sudoers_parser_config sudoers_conf = SUDOERS_PARSER_CONFIG_INITIALIZER; static unsigned int sudo_version; static const char *interfaces_string; sudo_conv_t sudo_conv; @@ -132,7 +132,7 @@ sudoers_policy_deserialize_info(void *v, struct defaults_list *defaults) if (val == -1) { INVALID("error_recovery="); /* Not a fatal error. */ } else { - parser_conf.recovery = val; + sudoers_conf.recovery = val; } continue; } @@ -143,7 +143,7 @@ sudoers_policy_deserialize_info(void *v, struct defaults_list *defaults) } if (MATCHES(*cur, "sudoers_uid=")) { p = *cur + sizeof("sudoers_uid=") - 1; - parser_conf.sudoers_uid = (uid_t)sudo_strtoid(p, &errstr); + sudoers_conf.sudoers_uid = (uid_t)sudo_strtoid(p, &errstr); if (errstr != NULL) { sudo_warnx(U_("%s: %s"), *cur, U_(errstr)); goto bad; @@ -152,7 +152,7 @@ sudoers_policy_deserialize_info(void *v, struct defaults_list *defaults) } if (MATCHES(*cur, "sudoers_gid=")) { p = *cur + sizeof("sudoers_gid=") - 1; - parser_conf.sudoers_gid = (gid_t)sudo_strtoid(p, &errstr); + sudoers_conf.sudoers_gid = (gid_t)sudo_strtoid(p, &errstr); if (errstr != NULL) { sudo_warnx(U_("%s: %s"), *cur, U_(errstr)); goto bad; @@ -161,7 +161,7 @@ sudoers_policy_deserialize_info(void *v, struct defaults_list *defaults) } if (MATCHES(*cur, "sudoers_mode=")) { p = *cur + sizeof("sudoers_mode=") - 1; - parser_conf.sudoers_mode = sudo_strtomode(p, &errstr); + sudoers_conf.sudoers_mode = sudo_strtomode(p, &errstr); if (errstr != NULL) { sudo_warnx(U_("%s: %s"), *cur, U_(errstr)); goto bad; @@ -180,7 +180,7 @@ sudoers_policy_deserialize_info(void *v, struct defaults_list *defaults) } } } - parser_conf.sudoers_path = path_sudoers; + sudoers_conf.sudoers_path = path_sudoers; /* Parse command line settings. */ sudo_user.flags = 0; @@ -628,7 +628,7 @@ bad: const struct sudoers_parser_config * policy_sudoers_conf(void) { - return &parser_conf; + return &sudoers_conf; } /* Return the path to ldap.conf file, which may be set in the plugin args. */ diff --git a/plugins/sudoers/testsudoers.c b/plugins/sudoers/testsudoers.c index b5c8f7899..23af90c5c 100644 --- a/plugins/sudoers/testsudoers.c +++ b/plugins/sudoers/testsudoers.c @@ -97,7 +97,7 @@ sudo_dso_public int main(int argc, char *argv[]); int main(int argc, char *argv[]) { - struct sudoers_parser_config parser_conf = SUDOERS_PARSER_CONFIG_INITIALIZER; + struct sudoers_parser_config sudoers_conf = SUDOERS_PARSER_CONFIG_INITIALIZER; enum sudoers_formats input_format = format_sudoers; struct cmndspec *cs; struct privilege *priv; @@ -145,7 +145,7 @@ main(int argc, char *argv[]) id = sudo_strtoid(optarg, &errstr); if (errstr != NULL) sudo_fatalx("group-ID %s: %s", optarg, errstr); - parser_conf.sudoers_gid = (gid_t)id; + sudoers_conf.sudoers_gid = (gid_t)id; break; case 'g': runas_group = optarg; @@ -177,7 +177,7 @@ main(int argc, char *argv[]) id = sudo_strtoid(optarg, &errstr); if (errstr != NULL) sudo_fatalx("user-ID %s: %s", optarg, errstr); - parser_conf.sudoers_uid = (uid_t)id; + sudoers_conf.sudoers_uid = (uid_t)id; break; case 'u': runas_user = optarg; @@ -278,9 +278,9 @@ main(int argc, char *argv[]) } /* Initialize the parser and set sudoers filename to "sudoers". */ - parser_conf.strict = true; - parser_conf.verbose = 2; - init_parser("sudoers", &parser_conf); + sudoers_conf.strict = true; + sudoers_conf.verbose = 2; + init_parser("sudoers", &sudoers_conf); /* * Set runas passwd/group entries based on command line or sudoers. diff --git a/plugins/sudoers/visudo.c b/plugins/sudoers/visudo.c index 42bae3d6d..53373bd53 100644 --- a/plugins/sudoers/visudo.c +++ b/plugins/sudoers/visudo.c @@ -111,7 +111,7 @@ struct sudo_user sudo_user; struct passwd *list_pw; static const char *path_sudoers = _PATH_SUDOERS; static struct sudoersfile_list sudoerslist = TAILQ_HEAD_INITIALIZER(sudoerslist); -static struct sudoers_parser_config parser_conf = SUDOERS_PARSER_CONFIG_INITIALIZER; +static struct sudoers_parser_config sudoers_conf = SUDOERS_PARSER_CONFIG_INITIALIZER; static bool checkonly; static bool edit_includes = true; static unsigned int errors; @@ -241,11 +241,11 @@ main(int argc, char *argv[]) if (fflag) { /* Looser owner/permission checks for an uninstalled sudoers file. */ if (!use_owner) { - parser_conf.sudoers_uid = (uid_t)-1; - parser_conf.sudoers_gid = (gid_t)-1; + sudoers_conf.sudoers_uid = (uid_t)-1; + sudoers_conf.sudoers_gid = (gid_t)-1; } if (!use_perms) - parser_conf.sudoers_mode |= S_IWUSR; + sudoers_conf.sudoers_mode |= S_IWUSR; } else { /* Check/set owner and mode for installed sudoers file. */ use_owner = true; @@ -289,10 +289,10 @@ 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. */ - parser_conf.strict = true; - parser_conf.verbose = quiet ? 0 : 2; - parser_conf.sudoers_path = path_sudoers; - init_parser(NULL, &parser_conf); + sudoers_conf.strict = true; + sudoers_conf.verbose = quiet ? 0 : 2; + sudoers_conf.sudoers_path = path_sudoers; + init_parser(NULL, &sudoers_conf); if ((sudoersin = open_sudoers(path_sudoers, &sudoers, true, NULL)) == NULL) exit(EXIT_FAILURE); sudoers_setlocale(SUDOERS_LOCALE_SUDOERS, &oldlocale); @@ -655,7 +655,7 @@ reparse_sudoers(char *editor, int editor_argc, char **editor_argv, /* Clean slate for each parse */ if (!init_defaults()) sudo_fatalx("%s", U_("unable to initialize sudoers default values")); - init_parser(sp->opath, &parser_conf); + init_parser(sp->opath, &sudoers_conf); sp->errorline = -1; /* Parse the sudoers temp file(s) */ @@ -1072,7 +1072,7 @@ check_syntax(const char *path, bool quiet, bool strict, bool check_owner, goto done; } } - init_parser(fname, &parser_conf); + init_parser(fname, &sudoers_conf); sudoers_setlocale(SUDOERS_LOCALE_SUDOERS, &oldlocale); if (sudoersparse() && !parse_error) { if (!quiet) @@ -1343,21 +1343,21 @@ parse_sudoers_options(void) p = *cur + sizeof("sudoers_uid=") - 1; id = sudo_strtoid(p, &errstr); if (errstr == NULL) - parser_conf.sudoers_uid = (uid_t)id; + sudoers_conf.sudoers_uid = (uid_t)id; continue; } if (MATCHES(*cur, "sudoers_gid=")) { p = *cur + sizeof("sudoers_gid=") - 1; id = sudo_strtoid(p, &errstr); if (errstr == NULL) - parser_conf.sudoers_gid = (gid_t)id; + sudoers_conf.sudoers_gid = (gid_t)id; continue; } if (MATCHES(*cur, "sudoers_mode=")) { p = *cur + sizeof("sudoers_mode=") - 1; mode = sudo_strtomode(p, &errstr); if (errstr == NULL) - parser_conf.sudoers_mode = mode; + sudoers_conf.sudoers_mode = mode; continue; } } |