]> git.ipfire.org Git - thirdparty/systemd.git/commit
Try path without sbin even if compiled with split-bin=true
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 18 Apr 2024 14:11:06 +0000 (16:11 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 22 Apr 2024 07:53:24 +0000 (09:53 +0200)
commit0f36a4c897ff53eb0be3bd3728a3ff91e9c0664d
treeb3fc0f27363355c0928a4089405385b22fe1ced7
parent18d264123629a284b0923201735f057ed12b348c
Try path without sbin even if compiled with split-bin=true

I'm working on the transition to merged sbin in Fedora. While the transition is
happening (and probably for a while after), we need to compile systemd with
split-bin=true to support systems upgraded from previous versions. But when the
system has been upgraded and already has /usr/sbin that is a symlink, be nice
and give $PATH without sbin.

We check for both /usr/sbin and /usr/local/sbin. If either exists and is not a
symlink to ./bin, we retain previous behaviour. This means that if both are
converted, we get the same behaviour as split-bin=false, and otherwise we
get the same behaviour as before.

sd-path uses the same logic. This is not a hot path, so I got rid of the nulstr
macros that duplicated the logic.
src/basic/path-util.c
src/basic/path-util.h
src/core/manager.c
src/libsystemd/sd-path/sd-path.c
src/test/test-exec-util.c
src/test/test-path-util.c