summaryrefslogtreecommitdiffstats
path: root/src/machine-id-setup
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-04-03 03:39:00 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-04-04 04:46:18 +0200
commit17f9d6d806ac59161ebd78afe4979e2c6138545f (patch)
tree6ec109962294b02cad4720018190c4a81c709858 /src/machine-id-setup
parentsrc: changed usage of basename() to path_extract_filename(). (diff)
downloadsystemd-17f9d6d806ac59161ebd78afe4979e2c6138545f.tar.xz
systemd-17f9d6d806ac59161ebd78afe4979e2c6138545f.zip
Revert "sd-id128: make id128_read() optionally take root directory"
This reverts commit 830e52caa2bf1a29f56cb93e7ed85acb1bda11c3.
Diffstat (limited to 'src/machine-id-setup')
-rw-r--r--src/machine-id-setup/machine-id-setup-main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/machine-id-setup/machine-id-setup-main.c b/src/machine-id-setup/machine-id-setup-main.c
index 2d29890864..5620bf9baf 100644
--- a/src/machine-id-setup/machine-id-setup-main.c
+++ b/src/machine-id-setup/machine-id-setup-main.c
@@ -158,11 +158,14 @@ static int run(int argc, char *argv[]) {
}
if (arg_commit) {
+ const char *etc_machine_id;
+
r = machine_id_commit(arg_root);
if (r < 0)
return r;
- r = id128_read(arg_root, "/etc/machine-id", ID128_FORMAT_PLAIN, &id);
+ etc_machine_id = prefix_roota(arg_root, "/etc/machine-id");
+ r = id128_read(etc_machine_id, ID128_FORMAT_PLAIN, &id);
if (r < 0)
return log_error_errno(r, "Failed to read machine ID back: %m");
} else {