daemon: grub: Remove incorrect use of printf specifier %R

This code is attempting to construct a grub-install command like:

  grub-install --root-directory=/sysroot/boot /dev/sda

In fact it was adding quoting to the --root-directory parameter where
it was not needed (because our "command" function uses exec).

Remove use of %R here (to avoid the extra quoting) and just use the
sysroot prefix directly.
This commit is contained in:
Richard W.M. Jones
2022-08-16 10:19:17 +01:00
parent 0e784824e8
commit ad8b1b09ee

View File

@@ -38,7 +38,7 @@ do_grub_install (const char *root, const char *device)
int r;
CLEANUP_FREE char *err = NULL, *buf = NULL, *out = NULL;
if (asprintf_nowarn (&buf, "--root-directory=%R", root) == -1) {
if (asprintf (&buf, "--root-directory=%s%s", sysroot, root) == -1) {
reply_with_perror ("asprintf");
return -1;
}