X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fhexdump.c;h=7016faf49e373227e401fb6177f36aa441366fd6;hp=a582c57db047e31ffbebdba877da3552a99a4e79;hb=2b891ceef355ce2d6532d65f8febbe3833d4399e;hpb=a7b73d4a1e09f12b2002083618056f0c823c1dcf diff --git a/daemon/hexdump.c b/daemon/hexdump.c index a582c57..7016faf 100644 --- a/daemon/hexdump.c +++ b/daemon/hexdump.c @@ -26,25 +26,18 @@ #include "actions.h" char * -do_hexdump (char *path) +do_hexdump (const char *path) { - int len; char *buf; int r; char *out, *err; - NEED_ROOT (NULL); - ABS_PATH (path, NULL); - - len = strlen (path) + 9; - buf = malloc (len); + buf = sysroot_path (path); if (!buf) { reply_with_perror ("malloc"); return NULL; } - snprintf (buf, len, "/sysroot%s", path); - r = command (&out, &err, "hexdump", "-C", buf, NULL); free (buf); if (r == -1) {