path-util: teach find_executable_full how to look into the root directory
When the root parameter in find_executable_full is set, chase_symlinks prefixes this root to every check of the path name to find the complete path of the execuatble in case the path provided is not absolute. This is only done for the non NULL root because otherwise the chase_symlinks function would alter the behavior of some of the callers which would in turn alter the outputs in a way that is undesirable. The find_execuatble_full function is invoked by the verify_executable function in analyze-verify.
This commit is contained in:
@@ -99,9 +99,9 @@ int path_strv_make_absolute_cwd(char **l);
|
||||
char** path_strv_resolve(char **l, const char *root);
|
||||
char** path_strv_resolve_uniq(char **l, const char *root);
|
||||
|
||||
int find_executable_full(const char *name, bool use_path_envvar, char **ret_filename, int *ret_fd);
|
||||
int find_executable_full(const char *name, const char *root, bool use_path_envvar, char **ret_filename, int *ret_fd);
|
||||
static inline int find_executable(const char *name, char **ret_filename) {
|
||||
return find_executable_full(name, true, ret_filename, NULL);
|
||||
return find_executable_full(name, /* root= */ NULL, true, ret_filename, NULL);
|
||||
}
|
||||
|
||||
bool paths_check_timestamp(const char* const* paths, usec_t *paths_ts_usec, bool update);
|
||||
|
||||
Reference in New Issue
Block a user