X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fcpmv.c;h=289a2dabe9922d03cbcedbabbe54589f5c7aa79b;hp=b87d7a46a4b4664ad47d3c7d47ed4514c9ae691d;hb=0f2e9c84e9ff1071260770930068642ecc8ac0d9;hpb=56bef498f46ac3dd580f4bde3c8f3ed2fe688826 diff --git a/daemon/cpmv.c b/daemon/cpmv.c index b87d7a4..289a2da 100644 --- a/daemon/cpmv.c +++ b/daemon/cpmv.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 @@ -49,7 +49,6 @@ static int cpmv_cmd (const char *cmd, const char *flags, const char *src, const char *dest) { char *srcbuf, *destbuf; - int srclen, destlen; char *err; int r; @@ -57,24 +56,19 @@ cpmv_cmd (const char *cmd, const char *flags, const char *src, const char *dest) ABS_PATH (src, -1); ABS_PATH (dest, -1); - srclen = strlen (src) + 32; - srcbuf = malloc (srclen); + srcbuf = sysroot_path (src); if (srcbuf == NULL) { reply_with_perror ("malloc"); return -1; } - destlen = strlen (dest) + 32; - destbuf = malloc (destlen); + destbuf = sysroot_path (dest); if (destbuf == NULL) { reply_with_perror ("malloc"); free (srcbuf); return -1; } - snprintf (srcbuf, srclen, "/sysroot%s", src); - snprintf (destbuf, destlen, "/sysroot%s", dest); - if (flags) r = command (NULL, &err, cmd, flags, srcbuf, destbuf, NULL); else