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:
Richard W.M. Jones
2013-04-29 15:23:27 +01:00
parent 79688aff74
commit c5f356a603
2 changed files with 2 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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" : "",