void-packages/srcpkgs/xbps/patches/0004-xbps-create-also-set-s...

30 lines
822 B
Diff

From a6c26f6c12c9abb8789e4ed01c188f83221e985b Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Fri, 15 Mar 2013 13:14:57 +0100
Subject: [PATCH 1/2] xbps-create: also set st_{uid,gid} to 0:0 in archived
files.
---
bin/xbps-create/main.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/bin/xbps-create/main.c b/bin/xbps-create/main.c
index fad76fd..22e0e34 100644
--- bin/xbps-create/main.c
+++ bin/xbps-create/main.c
@@ -429,6 +429,11 @@ process_entry_file(struct archive *ar,
entry = archive_entry_new();
assert(entry);
archive_entry_set_pathname(entry, xe->file);
+ if (st.st_uid == geteuid())
+ st.st_uid = 0;
+ if (st.st_gid == getegid())
+ st.st_gid = 0;
+
archive_entry_copy_stat(entry, &st);
archive_entry_copy_sourcepath(entry, p);
if (st.st_uid == geteuid())
--
1.8.1.3