]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: don't load etc/machine-info from cwd
authorAlyssa Ross <hi@alyssa.is>
Wed, 21 Aug 2024 12:21:47 +0000 (14:21 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 21 Aug 2024 19:30:50 +0000 (04:30 +0900)
arg_root defaults to null, so if --root isn't given, this would try reading
etc/machine-info from the current working directory, which is likely to fail.

Fixes: 77db9ef2ab ("boot: Make sure we take --root into account everywhere.")
src/boot/bootctl-install.c

index 6f55b98d74b8a45cbcd219e58e9464b2b2b0ea1b..0612791e07cd59ad55c08b2aeae1eeb9bb9abf44 100644 (file)
@@ -45,7 +45,7 @@ static int load_etc_machine_info(void) {
         _cleanup_free_ char *p = NULL, *s = NULL, *layout = NULL;
         int r;
 
-        p = path_join(arg_root, "etc/machine-info");
+        p = path_join(arg_root, "/etc/machine-info");
         if (!p)
                 return log_oom();