summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-08-24 05:01:01 +0000
committerkientzle <kientzle@FreeBSD.org>2008-08-24 05:01:01 +0000
commitad89b2721b6bbd7f7c52534311a2833d1656c243 (patch)
tree673def88b2cf3088dcecd8aa8a1350184449a74a /lib
parent96d726228acbea45a859130dfc29b7569c637a98 (diff)
downloadFreeBSD-src-ad89b2721b6bbd7f7c52534311a2833d1656c243.zip
FreeBSD-src-ad89b2721b6bbd7f7c52534311a2833d1656c243.tar.gz
Fix the cpio bug tested for by r182092 of usr.bin/cpio/test.
Since various 'find' incantations can emit container directories in various orders, we cannot refuse to update a dir because it's apparently the same age. MFC after: 3 days
Diffstat (limited to 'lib')
-rw-r--r--lib/libarchive/archive_write_disk.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libarchive/archive_write_disk.c b/lib/libarchive/archive_write_disk.c
index 7e44613..3fdea0e 100644
--- a/lib/libarchive/archive_write_disk.c
+++ b/lib/libarchive/archive_write_disk.c
@@ -861,7 +861,11 @@ restore_entry(struct archive_write_disk *a)
/* TODO: if it's a symlink... */
- if (a->flags & ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER) {
+ /*
+ * NO_OVERWRITE_NEWER doesn't apply to directories.
+ */
+ if ((a->flags & ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER)
+ && !S_ISDIR(a->st.st_mode)) {
if (!older(&(a->st), a->entry)) {
archive_set_error(&a->archive, 0,
"File on disk is not older; skipping.");
OpenPOWER on IntegriCloud