diff --git a/docs/ENVIRONMENT.md b/docs/ENVIRONMENT.md index 292a0f1e0e..445131b479 100644 --- a/docs/ENVIRONMENT.md +++ b/docs/ENVIRONMENT.md @@ -45,8 +45,7 @@ All tools: * `$SYSTEMD_OS_RELEASE` — if set, use this path instead of `/etc/os-release` or `/usr/lib/os-release`. When operating under some root (e.g. `systemctl - --root=…`), the path is taken relative to the outside root. Only useful for - debugging. + --root=…`), the path is prefixed with the root. Only useful for debugging. * `$SYSTEMD_FSTAB` — if set, use this path instead of `/etc/fstab`. Only useful for debugging. diff --git a/src/basic/os-util.c b/src/basic/os-util.c index 16fe123ce6..0f123aaf82 100644 --- a/src/basic/os-util.c +++ b/src/basic/os-util.c @@ -128,7 +128,7 @@ int open_os_release(const char *root, char **ret_path, int *ret_fd) { e = secure_getenv("SYSTEMD_OS_RELEASE"); if (e) - return chase(e, root, 0, ret_path, ret_fd); + return chase(e, root, CHASE_PREFIX_ROOT, ret_path, ret_fd); FOREACH_STRING(path, "/etc/os-release", "/usr/lib/os-release") { r = chase(path, root, CHASE_PREFIX_ROOT, ret_path, ret_fd); diff --git a/test/test-systemctl-enable.sh b/test/test-systemctl-enable.sh index 7d5667f297..e22a3ef628 100644 --- a/test/test-systemctl-enable.sh +++ b/test/test-systemctl-enable.sh @@ -695,4 +695,4 @@ cat >"$root/etc/os-release2" <