Pass in directory to check_user_runchroot() and check_user_runcwd().

This way we do not rely on the runas_ctx global.
This commit is contained in:
Todd C. Miller
2023-08-14 13:25:13 -06:00
parent 2e8648ea0f
commit 737354390c
5 changed files with 20 additions and 22 deletions

View File

@@ -488,7 +488,7 @@ sudoers_check_common(int pwflag)
}
/* Check whether runas_ctx.chroot is permitted (if specified). */
switch (check_user_runchroot()) {
switch (check_user_runchroot(runas_ctx.chroot)) {
case true:
break;
case false:
@@ -503,7 +503,7 @@ sudoers_check_common(int pwflag)
}
/* Check whether runas_ctx.cwd is permitted (if specified). */
switch (check_user_runcwd()) {
switch (check_user_runcwd(runas_ctx.cwd)) {
case true:
break;
case false: