set_cmnd_path: apply runchroot if set when finding the command path

Previously we would prepend runchroot to the path we were checking
but that does not properly handle symbolic links.
This commit is contained in:
Todd C. Miller
2023-02-21 13:24:33 -07:00
parent 13a311bc71
commit bff4e3ce16
7 changed files with 31 additions and 38 deletions

View File

@@ -288,12 +288,11 @@ struct timespec;
#define YY_DECL int sudoerslex(void)
/* goodpath.c */
bool sudo_goodpath(const char *path, const char *runchroot, struct stat *sbp);
bool sudo_goodpath(const char *path, struct stat *sbp);
/* findpath.c */
int find_path(const char *infile, char **outfile, struct stat *sbp,
const char *path, const char *runchroot, int ignore_dot,
char * const *allowlist);
const char *path, int ignore_dot, char * const *allowlist);
/* check.c */
int check_user(int validate, int mode);