From c5f356a60351dd51cbd3a9aabcac2cd40562f36a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 29 Apr 2013 15:23:27 +0100 Subject: [PATCH] daemon: Properly quote arguments for tar-out, base64-out commands (RHBZ#957772). This fixes commit c78ec7e085e99bfddd0509dece72bf6a8d0188ce which was an attempt to fix RHBZ#908322. --- daemon/base64.c | 2 +- daemon/tar.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/base64.c b/daemon/base64.c index 263c87ab2..04b29fd63 100644 --- a/daemon/base64.c +++ b/daemon/base64.c @@ -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; } diff --git a/daemon/tar.c b/daemon/tar.c index 9bf85f57a..461e529ce 100644 --- a/daemon/tar.c +++ b/daemon/tar.c @@ -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" : "",