diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-07-07 14:02:36 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-07-21 10:57:35 +0200 |
commit | 7d9ee15d0fc2af87481ee371b278dbe7e68165ef (patch) | |
tree | cc851ed0146a0bf48f8b7eb682fa9afeeca44c68 /src/rpm/triggers.systemd.in | |
parent | Merge pull request #20087 from xen0n/loongarch64-gpt (diff) | |
download | systemd-7d9ee15d0fc2af87481ee371b278dbe7e68165ef.tar.xz systemd-7d9ee15d0fc2af87481ee371b278dbe7e68165ef.zip |
rpm: don't specify the full path for systemctl and other commands
We can make things a bit simpler and more readable by not specifying the path.
Since we didn't specify the full path for all commands (including those invoked
recursively by anythign we invoke), this didn't really privide any security or
robustness benefits. I guess that full paths were used because this style of
rpm packagnig was popular in the past, with macros used for everything
possible, with special macros for common commands like %{__ln} and %{__mkdir}.
Diffstat (limited to 'src/rpm/triggers.systemd.in')
-rw-r--r-- | src/rpm/triggers.systemd.in | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/rpm/triggers.systemd.in b/src/rpm/triggers.systemd.in index b33d2212e8..247358008a 100644 --- a/src/rpm/triggers.systemd.in +++ b/src/rpm/triggers.systemd.in @@ -16,14 +16,14 @@ if posix.access("/run/systemd/system") then pid = posix.fork() if pid == 0 then - assert(posix.exec("%{_bindir}/systemctl", "daemon-reload")) + assert(posix.execp("systemctl", "daemon-reload")) elseif pid > 0 then posix.wait(pid) end pid = posix.fork() if pid == 0 then - assert(posix.exec("%{_bindir}/systemctl", "reload-or-restart", "--marked")) + assert(posix.execp("systemctl", "reload-or-restart", "--marked")) elseif pid > 0 then posix.wait(pid) end @@ -38,7 +38,7 @@ end if posix.access("/run/systemd/system") then pid = posix.fork() if pid == 0 then - assert(posix.exec("%{_bindir}/systemctl", "daemon-reload")) + assert(posix.execp("systemctl", "daemon-reload")) elseif pid > 0 then posix.wait(pid) end @@ -49,7 +49,7 @@ end if posix.access("/run/systemd/system") then pid = posix.fork() if pid == 0 then - assert(posix.exec("%{_bindir}/systemctl", "reload-or-restart", "--marked")) + assert(posix.execp("systemctl", "reload-or-restart", "--marked")) elseif pid > 0 then posix.wait(pid) end @@ -62,7 +62,7 @@ end if posix.access("/run/systemd/system") then pid = posix.fork() if pid == 0 then - assert(posix.exec("%{_bindir}/systemd-sysusers")) + assert(posix.execp("systemd-sysusers")) elseif pid > 0 then posix.wait(pid) end @@ -74,7 +74,7 @@ end if posix.access("/run/systemd/system") then pid = posix.fork() if pid == 0 then - assert(posix.exec("%{_bindir}/systemd-hwdb", "update")) + assert(posix.execp("systemd-hwdb", "update")) elseif pid > 0 then posix.wait(pid) end @@ -86,7 +86,7 @@ end if posix.access("/run/systemd/system") then pid = posix.fork() if pid == 0 then - assert(posix.exec("%{_bindir}/journalctl", "--update-catalog")) + assert(posix.execp("journalctl", "--update-catalog")) elseif pid > 0 then posix.wait(pid) end @@ -111,7 +111,7 @@ end if posix.access("/run/systemd/system") then pid = posix.fork() if pid == 0 then - assert(posix.exec("%{_bindir}/systemd-tmpfiles", "--create")) + assert(posix.execp("systemd-tmpfiles", "--create")) elseif pid > 0 then posix.wait(pid) end @@ -123,7 +123,7 @@ end if posix.access("/run/systemd/system") then pid = posix.fork() if pid == 0 then - assert(posix.exec("%{_bindir}/udevadm", "control", "--reload")) + assert(posix.execp("udevadm", "control", "--reload")) elseif pid > 0 then posix.wait(pid) end |