os-util: make $SYSTEMD_OS_RELEASE prefixed with the root directory

To make it consistent with other env vars, e.g. $SYSTEMD_ESP_PATH or
$SYSTEMD_XBOOTLDR_PATH.

This is useful when the root is specified by a file descriptor, instead
of a path.
This commit is contained in:
Yu Watanabe
2023-04-11 18:49:23 +09:00
parent f4a1d32c82
commit 5cf69e709e
3 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -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);