2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Move max_groups out of sudoers_user_context and into pwutil.c.

It is only used by the local password pwutil implementation.
This commit is contained in:
Todd C. Miller
2023-08-14 16:29:15 -06:00
parent 737354390c
commit 20baa39007
4 changed files with 26 additions and 8 deletions

View File

@@ -360,13 +360,15 @@ sudoers_policy_deserialize_info(void *v, struct defaults_list *defaults)
continue;
}
if (MATCHES(*cur, "max_groups=")) {
int max_groups;
errno = 0;
p = *cur + sizeof("max_groups=") - 1;
user_ctx.max_groups = (int)sudo_strtonum(p, 1, 1024, &errstr);
if (user_ctx.max_groups == 0) {
max_groups = (int)sudo_strtonum(p, 1, 1024, &errstr);
if (max_groups == 0) {
sudo_warnx(U_("%s: %s"), *cur, U_(errstr));
goto bad;
}
sudo_pwutil_set_max_groups(max_groups);
continue;
}
if (MATCHES(*cur, "remote_host=")) {