From: Tim Kientzle Date: Thu, 25 Feb 2010 17:03:28 +0000 (-0500) Subject: archive_write_disk uses a series of chdir() operations to shorten path X-Git-Tag: v3.0.0a~1181 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bbb7fde3f0a5e5f1596df44b9154a6cd796c1e05;p=thirdparty%2Flibarchive.git archive_write_disk uses a series of chdir() operations to shorten path arguments to PATH_MAX. If there is no PATH_MAX definition (as on HURD), just skip this. POSIX does provide a more complex way to deal with this concern using fpathconf() to query the maximum relative pathname starting in any particular directory. Someday, this code should probably be augmented to use that mechanism. SVN-Revision: 1991 --- diff --git a/libarchive/archive_write_disk.c b/libarchive/archive_write_disk.c index fcab99612..5f5ade9de 100644 --- a/libarchive/archive_write_disk.c +++ b/libarchive/archive_write_disk.c @@ -465,7 +465,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) if (ret != ARCHIVE_OK) goto done; } -#ifdef HAVE_FCHDIR +#if defined(HAVE_FCHDIR) && defined(PATH_MAX) /* If path exceeds PATH_MAX, shorten the path. */ edit_deep_directories(a); #endif @@ -942,7 +942,7 @@ archive_write_disk_new(void) * object creation is likely to fail, but any error will get handled * at that time. */ -#ifdef HAVE_FCHDIR +#if defined(HAVE_FCHDIR) && defined(PATH_MAX) static void edit_deep_directories(struct archive_write_disk *a) {