1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03:00

path-util: make find_executable() work without /proc mounted

Follow-up for 888f65ace6.

Hopefully fixes #20514.
This commit is contained in:
Yu Watanabe 2021-08-23 06:16:48 +09:00
parent ded8039abe
commit 93413acd3e

View File

@ -630,7 +630,11 @@ static int check_x_access(const char *path, int *ret_fd) {
return r;
r = access_fd(fd, X_OK);
if (r < 0)
if (r == -ENOSYS) {
/* /proc is not mounted. Fallback to access(). */
if (access(path, X_OK) < 0)
return -errno;
} else if (r < 0)
return r;
if (ret_fd)