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:
+1
-1
@@ -4351,7 +4351,7 @@ static int exec_child(
|
||||
|
||||
_cleanup_free_ char *executable = NULL;
|
||||
_cleanup_close_ int executable_fd = -1;
|
||||
r = find_executable_full(command->path, false, &executable, &executable_fd);
|
||||
r = find_executable_full(command->path, /* root= */ NULL, false, &executable, &executable_fd);
|
||||
if (r < 0) {
|
||||
if (r != -ENOMEM && (command->flags & EXEC_COMMAND_IGNORE_FAILURE)) {
|
||||
log_unit_struct_errno(unit, LOG_INFO, r,
|
||||
|
||||
Reference in New Issue
Block a user