git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hivex: Add flags argument to internal get_children() function.
[libguestfs.git]
/
daemon
/
hexdump.c
diff --git
a/daemon/hexdump.c
b/daemon/hexdump.c
index
a582c57
..
7016faf
100644
(file)
--- a/
daemon/hexdump.c
+++ b/
daemon/hexdump.c
@@
-26,25
+26,18
@@
#include "actions.h"
char *
#include "actions.h"
char *
-do_hexdump (char *path)
+do_hexdump (c
onst c
har *path)
{
{
- int len;
char *buf;
int r;
char *out, *err;
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;
}
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) {
r = command (&out, &err, "hexdump", "-C", buf, NULL);
free (buf);
if (r == -1) {