diff options
author | Todd C. Miller <Todd.Miller@sudo.ws> | 2023-04-01 10:17:31 -0600 |
---|---|---|
committer | Todd C. Miller <Todd.Miller@sudo.ws> | 2023-04-01 10:17:31 -0600 |
commit | ef183ed948b7a5b8074bcf70c7f32e6a95cb96e8 (patch) | |
tree | b5fd83a72d856cdafd116b65eaa04d523390ba3d /plugins | |
parent | ddf9a519378691be85a79ddd47f2006ce3ac3882 (diff) | |
download | sudo-ef183ed948b7a5b8074bcf70c7f32e6a95cb96e8.tar.gz |
sudoers_lookup_pseudo: remove validated function argument
This was always set to FLAG_NO_USER|FLAG_NO_HOST which are cleared
at the top of the fuction. Make validated a local variables,
initialized to 0, instead. No change in behavior.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sudoers/parse.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/plugins/sudoers/parse.c b/plugins/sudoers/parse.c index 820fae2ef..069a25fac 100644 --- a/plugins/sudoers/parse.c +++ b/plugins/sudoers/parse.c @@ -57,8 +57,7 @@ runas_matches_pw(struct sudoers_parse_tree *parse_tree, * list, verify and kill. */ static int -sudoers_lookup_pseudo(struct sudo_nss_list *snl, struct passwd *pw, - int validated, int pwflag) +sudoers_lookup_pseudo(struct sudo_nss_list *snl, struct passwd *pw, int pwflag) { char *saved_runchroot; struct passwd *root_pw = NULL; @@ -68,14 +67,13 @@ sudoers_lookup_pseudo(struct sudo_nss_list *snl, struct passwd *pw, struct userspec *us; struct defaults *def; int cmnd_match, nopass, match = DENY; + int validated = 0; enum def_tuple pwcheck; debug_decl(sudoers_lookup_pseudo, SUDOERS_DEBUG_PARSER); pwcheck = (pwflag == -1) ? never : sudo_defs_table[pwflag].sd_un.tuple; nopass = (pwcheck == never || pwcheck == all) ? true : false; - CLR(validated, FLAG_NO_USER); - CLR(validated, FLAG_NO_HOST); if (list_pw != NULL) { root_pw = sudo_getpwuid(ROOT_UID); if (root_pw == NULL) @@ -468,7 +466,7 @@ sudoers_lookup(struct sudo_nss_list *snl, struct passwd *pw, int *cmnd_status, * Special case checking the "validate", "list" and "kill" pseudo-commands. */ if (pwflag) - debug_return_int(sudoers_lookup_pseudo(snl, pw, validated, pwflag)); + debug_return_int(sudoers_lookup_pseudo(snl, pw, pwflag)); /* Need to be runas user while stat'ing things. */ if (!set_perms(PERM_RUNAS)) |