From 9d6bc9964988842aea8226a3d3320da452bb58ea Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 12 May 2016 19:35:32 +0200 Subject: [PATCH] builder: Untar with --no-same-owner Without this if you run as root (which is generally a poor idea) it will extract the sources with the user/group specified on the archive, which is never what you want when building code. --- builder/builder-source-archive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/builder-source-archive.c b/builder/builder-source-archive.c index 66d45272..c063b2b7 100644 --- a/builder/builder-source-archive.c +++ b/builder/builder-source-archive.c @@ -534,7 +534,7 @@ builder_source_archive_extract (BuilderSource *source, { g_autofree char *strip_components = g_strdup_printf ("--strip-components=%u", self->strip_components); /* Note: tar_decompress_flag can return NULL, so put it last */ - if (!tar (dest, error, "xf", archive_path, strip_components, tar_decompress_flag (type), NULL)) + if (!tar (dest, error, "xf", archive_path, "--no-same-owner", strip_components, tar_decompress_flag (type), NULL)) return FALSE; } else if (type == ZIP)