From e770766cc8f49499d1c3a7f2a10283ae71d8dc0f Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sat, 26 Mar 2016 12:41:08 +0100 Subject: [PATCH] Fix tix archive owner, group and permissions. tix-build recorded the owner and group as the user building the package, rather than setting the owner and group to user 0 (root). tix-install tried to chown extracted files as the owner and group in the archive, rather than the current user. It also applied the current umask rather than restoring the same permissions. --- build-aux/build-ports.sh | 2 +- tix/tix-build.c | 3 +++ tix/tix-install.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/build-aux/build-ports.sh b/build-aux/build-ports.sh index eb6f16d8..da9ba4c1 100755 --- a/build-aux/build-ports.sh +++ b/build-aux/build-ports.sh @@ -143,7 +143,7 @@ strip_tix() { $HOST-strip -d "$DIR/data/libexec"* 2>/dev/null || true $HOST-strip -d "$DIR/data/libexec/git-core/"* 2>/dev/null || true $HOST-strip -d "$DIR/data/sbin/"* 2>/dev/null || true - (cd "$DIR" && tar -cJf port.tar.tix.xz tix data) + (cd "$DIR" && tar --numeric-owner --owner=0 --group=0 -cJf port.tar.tix.xz tix data) cp "$DIR/port.tar.tix.xz" "$1" rm -rf "$DIR" } diff --git a/tix/tix-build.c b/tix/tix-build.c index 7750a306..15fe295a 100644 --- a/tix/tix-build.c +++ b/tix/tix-build.c @@ -738,6 +738,9 @@ void BuildPackage(metainfo_t* minfo) "--remove-files", "--create", "--xz", + "--numeric-owner", + "--owner=0", + "--group=0", "--file", package_tix, "tix", "data", diff --git a/tix/tix-install.c b/tix/tix-install.c index 4178fad0..e5fe91ff 100644 --- a/tix/tix-install.c +++ b/tix/tix-install.c @@ -364,6 +364,8 @@ void InstallPackage(const char* tix_path) "--extract", "--file", tix_path, "--keep-directory-symlink", + "--same-permissions", + "--no-same-owner", data_and_prefix, NULL };