diff options
author | Joerg Sonnenberger <joerg@bec.de> | 2017-04-21 02:11:43 +0200 |
---|---|---|
committer | Joerg Sonnenberger <joerg@bec.de> | 2017-04-21 02:11:43 +0200 |
commit | 62eca97f3daabd19417bf353f607a8e05feeb218 (patch) | |
tree | 514e8680490dca41cccbd06ae5766db3c9fa7d39 /libarchive/archive_write_set_format_pax.c | |
parent | 7ad477ea7655f3dfcdcfa5adcb792f0ec864969d (diff) | |
download | libarchive-62eca97f3daabd19417bf353f607a8e05feeb218.tar.gz |
Complay with the spirit, if not the letter of the GNU sparse file rule.
Diffstat (limited to 'libarchive/archive_write_set_format_pax.c')
-rw-r--r-- | libarchive/archive_write_set_format_pax.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/libarchive/archive_write_set_format_pax.c b/libarchive/archive_write_set_format_pax.c index 6a301ac2..5fdfd9dd 100644 --- a/libarchive/archive_write_set_format_pax.c +++ b/libarchive/archive_write_set_format_pax.c @@ -1650,13 +1650,14 @@ build_pax_attribute_name(char *dest, const char *src) * GNU PAX Format 1.0 requires the special name, which pattern is: * <dir>/GNUSparseFile.<pid>/<original file name> * + * Since reproducable archives are more important, use 0 as pid. + * * This function is used for only Sparse file, a file type of which * is regular file. */ static char * build_gnu_sparse_name(char *dest, const char *src) { - char buff[64]; const char *p; /* Handle the null filename case. */ @@ -1682,15 +1683,9 @@ build_gnu_sparse_name(char *dest, const char *src) break; } -#if HAVE_GETPID && 0 /* Disable this as pax attribute name. */ - sprintf(buff, "GNUSparseFile.%d", getpid()); -#else - /* If the platform can't fetch the pid, don't include it. */ - strcpy(buff, "GNUSparseFile"); -#endif /* General case: build a ustar-compatible name adding * "/GNUSparseFile/". */ - build_ustar_entry_name(dest, src, p - src, buff); + build_ustar_entry_name(dest, src, p - src, "GNUSparseFile.0"); return (dest); } |