X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fhexdump.c;h=1b33eeb3acec7a33138cd138d11cb42866649f60;hp=a582c57db047e31ffbebdba877da3552a99a4e79;hb=66477d07e37ffe66cd6fea1105dd92b616d3cd27;hpb=a7b73d4a1e09f12b2002083618056f0c823c1dcf diff --git a/daemon/hexdump.c b/daemon/hexdump.c index a582c57..1b33eeb 100644 --- a/daemon/hexdump.c +++ b/daemon/hexdump.c @@ -26,29 +26,22 @@ #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) { - reply_with_error ("hexdump: %s: %s", path, err); + reply_with_error ("%s: %s", path, err); free (err); free (out); return NULL;