2
0

100-symlink-force-root-name.patch 830 B

123456789101112131415161718192021222324252627
  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. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  4. ---
  5. --- a/src/create.c
  6. +++ b/src/create.c
  7. @@ -543,17 +543,8 @@ write_gnu_long_link (struct tar_stat_inf
  8. union block *header;
  9. header = start_private_header ("././@LongLink", size, 0);
  10. - if (! numeric_owner_option)
  11. - {
  12. - static char *uname, *gname;
  13. - if (!uname)
  14. - {
  15. - uid_to_uname (0, &uname);
  16. - gid_to_gname (0, &gname);
  17. - }
  18. - UNAME_TO_CHARS (uname, header->header.uname);
  19. - GNAME_TO_CHARS (gname, header->header.gname);
  20. - }
  21. + UNAME_TO_CHARS ("root", header->header.uname);
  22. + GNAME_TO_CHARS ("root", header->header.gname);
  23. strcpy (header->buffer + offsetof (struct posix_header, magic),
  24. OLDGNU_MAGIC);