summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_write_set_format_pax.c
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-03-15 03:49:18 +0000
committerkientzle <kientzle@FreeBSD.org>2008-03-15 03:49:18 +0000
commit74f604455f4a78a2140be49d78601c091b2b4eac (patch)
tree7bf0483287d8b9eaf19b6a141d6540ff8b0bdd31 /lib/libarchive/archive_write_set_format_pax.c
parent2f15379ebcc3e700518bd4520ef5317ff262ff8b (diff)
downloadFreeBSD-src-74f604455f4a78a2140be49d78601c091b2b4eac.zip
FreeBSD-src-74f604455f4a78a2140be49d78601c091b2b4eac.tar.gz
Testability is more important than standards conformance.
Disable the use of PaxHeader.<pid> for the fake pax extension pathname until I can make the name here settable. Otherwise, tests that try to compare output to static pre-generated reference files break.
Diffstat (limited to 'lib/libarchive/archive_write_set_format_pax.c')
-rw-r--r--lib/libarchive/archive_write_set_format_pax.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/libarchive/archive_write_set_format_pax.c b/lib/libarchive/archive_write_set_format_pax.c
index 18b411e..3004e76 100644
--- a/lib/libarchive/archive_write_set_format_pax.c
+++ b/lib/libarchive/archive_write_set_format_pax.c
@@ -1061,7 +1061,12 @@ build_ustar_entry_name(char *dest, const char *src, size_t src_length,
/*
* The ustar header for the pax extended attributes must have a
* reasonable name: SUSv3 requires 'dirname'/PaxHeader.'pid'/'filename'
- * where 'pid' is the PID of the archiving process.
+ * where 'pid' is the PID of the archiving process. Unfortunately,
+ * that makes testing a pain since the output varies for each run,
+ * so I'm sticking with the simpler 'dirname'/PaxHeader/'filename'
+ * for now. (Someday, I'll make this settable. Then I can use the
+ * SUS recommendation as default and test harnesses can override it
+ * to get predictable results.)
*
* Joerg Schilling has argued that this is unnecessary because, in
* practice, if the pax extended attributes get extracted as regular
@@ -1123,11 +1128,11 @@ build_pax_attribute_name(char *dest, const char *src)
* recomputing it every time. That will also open the door
* to having clients override it.
*/
-#if HAVE_GETPID
+#if HAVE_GETPID && 0 /* Disable this for now; see above comment. */
sprintf(buff, "PaxHeader.%d", getpid());
#else
/* If the platform can't fetch the pid, don't include it. */
- strpcy(buff, "PaxHeader");
+ strcpy(buff, "PaxHeader");
#endif
/* General case: build a ustar-compatible name adding "/PaxHeader/". */
build_ustar_entry_name(dest, src, p - src, buff);
OpenPOWER on IntegriCloud