From 3d267223eabed4ecc418aafc3ddeb0c47d90a311 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 7 Aug 2026 10:59:34 +0200 Subject: [PATCH] systemctl: honour --root= in "is-enabled --full" We have a root argument, let's make sure we honour it in this case. (cherry picked from commit b231b43ff0c3a4b951e45567474052885cad52d3) --- src/systemctl/systemctl-is-enabled.c | 2 +- test/test-systemctl-enable.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/systemctl/systemctl-is-enabled.c b/src/systemctl/systemctl-is-enabled.c index e42faf2724..8161fb0192 100644 --- a/src/systemctl/systemctl-is-enabled.c +++ b/src/systemctl/systemctl-is-enabled.c @@ -27,7 +27,7 @@ static int show_installation_targets_client_side(const char *name) { flags = UNIT_FILE_DRY_RUN | (arg_runtime ? UNIT_FILE_RUNTIME : 0); - r = unit_file_disable(arg_runtime_scope, flags, NULL, p, &changes, &n_changes); + r = unit_file_disable(arg_runtime_scope, flags, arg_root, p, &changes, &n_changes); if (r < 0) return log_error_errno(r, "Failed to get file links for %s: %m", name); diff --git a/test/test-systemctl-enable.sh b/test/test-systemctl-enable.sh index d099b6f41e..52984b4ffe 100644 --- a/test/test-systemctl-enable.sh +++ b/test/test-systemctl-enable.sh @@ -754,3 +754,15 @@ ID='the-id2' EOF SYSTEMD_OS_RELEASE="/etc/os-release2" check_alias o 'the-id2' + +: '-------is-enabled --full is relative to --root=-----------------' +mkdir -p "$root/usr/lib/systemd/system" +cat >"$root/usr/lib/systemd/system/rooted.service" </dev/null