From 8d14bd8cc2317a75d8450819a5d31bb772475fca Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sun, 24 Aug 2008 05:01:01 +0000 Subject: [PATCH] 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 --- lib/libarchive/archive_write_disk.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libarchive/archive_write_disk.c b/lib/libarchive/archive_write_disk.c index 7e44613367a..3fdea0e5bdf 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.");