git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add_drive: Don't use cache=off if not supported by underlying filesystem.
[libguestfs.git]
/
daemon
/
find.c
diff --git
a/daemon/find.c
b/daemon/find.c
index
d882953
..
40f1b3b
100644
(file)
--- a/
daemon/find.c
+++ b/
daemon/find.c
@@
-83,21
+83,14
@@
do_find (char *dir)
sysrootdirlen = strlen (sysrootdir);
/* Assemble the external find command. */
sysrootdirlen = strlen (sysrootdir);
/* Assemble the external find command. */
- len = 2 * sysrootdirlen + 32;
- cmd = malloc (len);
- if (!cmd) {
+ if (asprintf_nowarn (&cmd, "find %Q -print0", sysrootdir) == -1) {
reply_with_perror ("malloc");
free (sysrootdir);
return NULL;
}
reply_with_perror ("malloc");
free (sysrootdir);
return NULL;
}
- strcpy (cmd, "find ");
- shell_quote (cmd+5, len-5, sysrootdir);
- free (sysrootdir);
- strcat (cmd, " -print0");
-
if (verbose)
if (verbose)
-
printf (
"%s\n", cmd);
+
fprintf (stderr,
"%s\n", cmd);
fp = popen (cmd, "r");
if (fp == NULL) {
fp = popen (cmd, "r");
if (fp == NULL) {