]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
Omit devmajor and devminor for non-special files
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 12 Dec 2021 20:40:03 +0000 (12:40 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 13 Dec 2021 08:44:57 +0000 (00:44 -0800)
* src/create.c (start_header): Leave the devmajor and devminor
fields empty for files that are not character and block special
devices, even when the archive format is pax, ustar or v7.
This avoids generating irrelevant differences which helps with
reproducible builds, and is more compatible with what Solaris 10
tar does.

src/create.c

index 8ee63e1ea23353a8a76456230ac56228fff6800d..c88c248dd58249305c0db55861a4962a2a254fb4 100644 (file)
@@ -881,12 +881,6 @@ start_header (struct tar_stat_info *st)
       if (!MINOR_TO_CHARS (devminor, header->header.devminor))
        return NULL;
     }
-  else if (archive_format != GNU_FORMAT && archive_format != OLDGNU_FORMAT)
-    {
-      if (!(MAJOR_TO_CHARS (0, header->header.devmajor)
-           && MINOR_TO_CHARS (0, header->header.devminor)))
-       return NULL;
-    }
 
   if (archive_format == POSIX_FORMAT)
     {