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