diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-09-23 16:23:30 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-11-06 15:20:34 +0100 |
commit | 8939eeae528ef9b9ad2a21995279b76d382d5c81 (patch) | |
tree | bb18c4c23b36911c87d09c1c69c80ada5c707104 /test/TEST-34-DYNAMICUSERMIGRATE | |
parent | a6d9111c67264a8828a563ccc23a24144b879942 (diff) | |
download | systemd-8939eeae528ef9b9ad2a21995279b76d382d5c81.tar.gz |
shared/exec-util: use our own execveat() wrapper instead of fexecve()
For scripts, when we call fexecve(), on new kernels glibc calls execveat(),
which fails with ENOENT, and then we fall back to execve() which succeeds:
[pid 63039] execveat(3, "", ["/home/zbyszek/src/systemd/test/test-path-util/script.sh", "--version"], 0x7ffefa3633f0 /* 0 vars */, AT_EMPTY_PATH) = -1 ENOENT (No such file or directory)
[pid 63039] execve("/home/zbyszek/src/systemd/test/test-path-util/script.sh", ["/home/zbyszek/src/systemd/test/test-path-util/script.sh", "--version"], 0x7ffefa3633f0 /* 0 vars */) = 0
But on older kernels glibc (some versions?) implement a fallback which falls
into the same trap with bash $0:
[pid 13534] execve("/proc/self/fd/3", ["/home/test/systemd/test/test-path-util/script.sh", "--version"], 0x7fff84995870 /* 0 vars */) = 0
We don't want that, so let's call execveat() ourselves. Then we can do the
execve() fallback as we want.
Diffstat (limited to 'test/TEST-34-DYNAMICUSERMIGRATE')
0 files changed, 0 insertions, 0 deletions