mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
daemon: Properly quote arguments for tar-out, base64-out commands (RHBZ#957772).
This fixes commit c78ec7e085
which was an attempt to fix RHBZ#908322.
This commit is contained in:
@@ -125,7 +125,7 @@ do_base64_out (const char *file)
|
||||
}
|
||||
|
||||
/* Construct the command. */
|
||||
if (asprintf_nowarn (&cmd, "%s %s", str_base64, buf) == -1) {
|
||||
if (asprintf_nowarn (&cmd, "%s %Q", str_base64, buf) == -1) {
|
||||
reply_with_perror ("asprintf");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -342,7 +342,7 @@ do_tar_out (const char *dir, const char *compress, int numericowner,
|
||||
}
|
||||
|
||||
/* "tar -C /sysroot%s -cf - ." but we have to quote the dir. */
|
||||
if (asprintf_nowarn (&cmd, "%s -C %s%s%s%s -cf - .",
|
||||
if (asprintf_nowarn (&cmd, "%s -C %Q%s%s%s -cf - .",
|
||||
str_tar,
|
||||
buf, filter,
|
||||
numericowner ? " --numeric-owner" : "",
|
||||
|
||||
Reference in New Issue
Block a user