Rebased from upstream / out of band repository.
[librecmc/librecmc.git] / tools / tar / patches / 100-symlink-force-root-name.patch
1 Force root/root as names for uid0/gid0 instead of using the system
2 names. This helps make packed download tarballs more reproducible
3
4 Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 ---
6 --- a/src/create.c
7 +++ b/src/create.c
8 @@ -544,17 +544,8 @@ write_gnu_long_link (struct tar_stat_inf
9    union block *header;
10  
11    header = start_private_header ("././@LongLink", size, 0);
12 -  if (! numeric_owner_option)
13 -    {
14 -      static char *uname, *gname;
15 -      if (!uname)
16 -       {
17 -         uid_to_uname (0, &uname);
18 -         gid_to_gname (0, &gname);
19 -       }
20 -      UNAME_TO_CHARS (uname, header->header.uname);
21 -      GNAME_TO_CHARS (gname, header->header.gname);
22 -    }
23 +  UNAME_TO_CHARS ("root", header->header.uname);
24 +  GNAME_TO_CHARS ("root", header->header.gname);
25  
26    strcpy (header->buffer + offsetof (struct posix_header, magic),
27           OLDGNU_MAGIC);