summaryrefslogtreecommitdiff
path: root/src/machine/org.freedesktop.machine1.policy.in
diff options
context:
space:
mode:
authorChris Down <chris@chrisdown.name>2020-08-25 21:59:11 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-08-26 14:35:32 +0200
commitb7cef386bd1bc810f5bb12d84c2ec4d6428231e3 (patch)
tree631c80a63144b59a9ed5dff80dddfbd9c75cd55e /src/machine/org.freedesktop.machine1.policy.in
parent122945f315c8ccb1ecaf8384aff85931791d45d3 (diff)
downloadsystemd-246.3.tar.gz
path: Skip directories when finalising $PATH searchv246.3
Imagine $PATH /a:/b. There is an echo command at /b/echo. Under this configuration, this works fine: % systemd-run --user --scope echo . Running scope as unit: run-rfe98e0574b424d63a641644af511ff30.scope . However, if I do `mkdir /a/echo`, this happens: % systemd-run --user --scope echo . Running scope as unit: run-rcbe9369537ed47f282ee12ce9f692046.scope Failed to execute: Permission denied We check whether the resulting file is executable for the performing user, but of course, most directories are anyway, since that's needed to list within it. As such, another is_dir() check is needed prior to considering the search result final. Another approach might be to check S_ISREG, but there may be more gnarly edge cases there than just eliminating this obviously pathological example, so let's just do this for now. (cherry picked from commit 8b5cb69bc8b70d1dcc39ed2165907723099bd9d8)
Diffstat (limited to 'src/machine/org.freedesktop.machine1.policy.in')
0 files changed, 0 insertions, 0 deletions