X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Finitrd.c;h=392b811ed6270855976b63980da03752580bcf8d;hb=22eb7fc966bafebedfde437c9b9c9fb903a8bc35;hp=2d6cbddec010a758ce819adb53d2328fcfa55b55;hpb=3e2d925717d1dac6b3862e98192c12d1080c2152;p=libguestfs.git diff --git a/daemon/initrd.c b/daemon/initrd.c index 2d6cbdd..392b811 100644 --- a/daemon/initrd.c +++ b/daemon/initrd.c @@ -1,5 +1,5 @@ /* libguestfs - the guestfsd daemon - * Copyright (C) 2009 Red Hat Inc. + * Copyright (C) 2009 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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");