Skip to content

Commit

Permalink
tar: fix reproducibility issue
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nbd168 committed Dec 19, 2016
1 parent dea6baf commit 2b510d9
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tools/tar/patches/100-symlink-force-root-name.patch
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
---
--- 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);

0 comments on commit 2b510d9

Please sign in to comment.