git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
inotify-add-watch does not need to explicitly check for ABS_PATH.
[libguestfs.git]
/
daemon
/
checksum.c
diff --git
a/daemon/checksum.c
b/daemon/checksum.c
index
bb30b05
..
2423265
100644
(file)
--- a/
daemon/checksum.c
+++ b/
daemon/checksum.c
@@
-28,15
+28,13
@@
#include "actions.h"
char *
#include "actions.h"
char *
-do_checksum (c
har *csumtype,
char *path)
+do_checksum (c
onst char *csumtype, const
char *path)
{
const char *program;
char *buf;
char *out, *err;
{
const char *program;
char *buf;
char *out, *err;
- int r, len;
-
- NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ int r;
+ int len;
if (strcasecmp (csumtype, "crc") == 0)
program = "cksum";
if (strcasecmp (csumtype, "crc") == 0)
program = "cksum";
@@
-58,13
+56,11
@@
do_checksum (char *csumtype, char *path)
}
/* Make the path relative to /sysroot. */
}
/* Make the path relative to /sysroot. */
- 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, program, buf, NULL);
free (buf);
r = command (&out, &err, program, buf, NULL);
free (buf);