aboutsummaryrefslogtreecommitdiffstats
path: root/tools/tar/patches
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-12-19 21:06:07 +0100
committerFelix Fietkau <nbd@nbd.name>2016-12-19 21:07:39 +0100
commit2b510d97ba9f66ef1e5b40778ed85b47e3b7cbe3 (patch)
treecde528e04104ec1dc70ddbaa80244d7f44e67750 /tools/tar/patches
parentdea6baf8fa193f494acb1811b573e52886213a0d (diff)
downloadupstream-2b510d97ba9f66ef1e5b40778ed85b47e3b7cbe3.tar.gz
upstream-2b510d97ba9f66ef1e5b40778ed85b47e3b7cbe3.tar.bz2
upstream-2b510d97ba9f66ef1e5b40778ed85b47e3b7cbe3.zip
tar: fix reproducibility issue
Force root/root as names for uid0/gid0 instead of using the system names. This helps make packed download tarballs more reproducible Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'tools/tar/patches')
-rw-r--r--tools/tar/patches/100-symlink-force-root-name.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/tar/patches/100-symlink-force-root-name.patch b/tools/tar/patches/100-symlink-force-root-name.patch
new file mode 100644
index 0000000000..896b4723fc
--- /dev/null
+++ b/tools/tar/patches/100-symlink-force-root-name.patch
@@ -0,0 +1,22 @@
+Force root/root as names for uid0/gid0 instead of using the system
+names. This helps make packed download tarballs more reproducible
+
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+---
+--- a/src/create.c
++++ b/src/create.c
+@@ -545,12 +545,8 @@ write_gnu_long_link (struct tar_stat_inf
+ char *tmpname;
+
+ header = start_private_header ("././@LongLink", size, 0);
+- uid_to_uname (0, &tmpname);
+- UNAME_TO_CHARS (tmpname, header->header.uname);
+- free (tmpname);
+- gid_to_gname (0, &tmpname);
+- GNAME_TO_CHARS (tmpname, header->header.gname);
+- free (tmpname);
++ UNAME_TO_CHARS ("root", header->header.uname);
++ GNAME_TO_CHARS ("root", header->header.gname);
+
+ strcpy (header->buffer + offsetof (struct posix_header, magic),
+ OLDGNU_MAGIC);