X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fhexdump.c;h=7016faf49e373227e401fb6177f36aa441366fd6;hp=ae7df924be1c8c13c6447772d59633dc1b4f47d2;hb=b3035e8d7c04a71d9a54ab7e52bc9e169ecf0b47;hpb=56bef498f46ac3dd580f4bde3c8f3ed2fe688826 diff --git a/daemon/hexdump.c b/daemon/hexdump.c index ae7df92..7016faf 100644 --- a/daemon/hexdump.c +++ b/daemon/hexdump.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 @@ -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) {