diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-04-03 10:39:00 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-04-04 11:46:18 +0900 |
commit | 17f9d6d806ac59161ebd78afe4979e2c6138545f (patch) | |
tree | 6ec109962294b02cad4720018190c4a81c709858 /src/nspawn | |
parent | de2820606d872ddc9c82cc138a5bdfc302863a2d (diff) | |
download | systemd-17f9d6d806ac59161ebd78afe4979e2c6138545f.tar.gz |
Revert "sd-id128: make id128_read() optionally take root directory"
This reverts commit 830e52caa2bf1a29f56cb93e7ed85acb1bda11c3.
Diffstat (limited to 'src/nspawn')
-rw-r--r-- | src/nspawn/nspawn.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 982dffd1b8..9fbacb2713 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -2828,6 +2828,7 @@ static int mount_tunnel_open(void) { } static int setup_machine_id(const char *directory) { + const char *etc_machine_id; sd_id128_t id; int r; @@ -2838,7 +2839,9 @@ static int setup_machine_id(const char *directory) { * in the container and our idea of the container UUID will always be in sync (at least if PID 1 in the * container behaves nicely). */ - r = id128_read(directory, "/etc/machine-id", ID128_FORMAT_PLAIN, &id); + etc_machine_id = prefix_roota(directory, "/etc/machine-id"); + + r = id128_read(etc_machine_id, ID128_FORMAT_PLAIN, &id); if (r < 0) { if (!ERRNO_IS_MACHINE_ID_UNSET(r)) /* If the file is missing, empty, or uninitialized, we don't mind */ return log_error_errno(r, "Failed to read machine ID from container image: %m"); |