X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Finitrd.c;h=392b811ed6270855976b63980da03752580bcf8d;hb=7a14e0509d5cc976deda9b5299f56930e0317502;hp=7b32a08a8c46d4adac82df18d62dc5bc427c5a26;hpb=a7b73d4a1e09f12b2002083618056f0c823c1dcf;p=libguestfs.git diff --git a/daemon/initrd.c b/daemon/initrd.c index 7b32a08..392b811 100644 --- a/daemon/initrd.c +++ b/daemon/initrd.c @@ -41,14 +41,15 @@ do_initrd_list (char *path) ABS_PATH (path, NULL); /* "zcat /sysroot/ | cpio --quiet -it", but path must be quoted. */ - len = 64 + 2 * strlen (path); + len = 64 + sysroot_len + 2 * strlen (path); cmd = malloc (len); if (!cmd) { reply_with_perror ("malloc"); return NULL; } - strcpy (cmd, "zcat /sysroot"); + strcpy (cmd, "zcat "); + strcat (cmd, sysroot); shell_quote (cmd+13, len-13, path); strcat (cmd, " | cpio --quiet -it");