Support "*" for CWD/CHROOT to allow user to specify cwd or chroot.

Adds two new command line options, -D (--chdir) and -R (--chroot)
that can only be used when sudoers sets runcwd or runchroot to "*".
This commit is contained in:
Todd C. Miller
2020-09-01 14:10:02 -06:00
parent bd254e1042
commit 1676f0ceeb
17 changed files with 397 additions and 128 deletions

View File

@@ -552,11 +552,11 @@ struct sudo_defs_types sudo_defs_table[] = {
N_("Set the pam remote host to the local host name"),
NULL,
}, {
"runcwd", T_STR|T_BOOL|T_PATH|T_TILDE,
"runcwd", T_STR|T_BOOL|T_CHPATH,
N_("Working directory to change to before executing the command: %s"),
NULL,
}, {
"runchroot", T_STR|T_BOOL|T_PATH|T_TILDE,
"runchroot", T_STR|T_BOOL|T_CHPATH,
N_("Root directory to change to before executing the command: %s"),
NULL,
}, {