summaryrefslogtreecommitdiffstats
path: root/lib/libarchive
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2006-03-22 02:42:17 +0000
committerkientzle <kientzle@FreeBSD.org>2006-03-22 02:42:17 +0000
commit91783fa04a17c7e51e2e70d89494167a88a543ad (patch)
tree972d0cdb903beedbaa182e331827488576fd94b7 /lib/libarchive
parent49444cf98e5e796e0c4a7679c1fc72597791656e (diff)
downloadFreeBSD-src-91783fa04a17c7e51e2e70d89494167a88a543ad.zip
FreeBSD-src-91783fa04a17c7e51e2e70d89494167a88a543ad.tar.gz
Even if a system does not support restoring extended attributes,
it's only a failure if there were actually attributes to be restored. In particular, this fixes the problem where tar -xp always returned a failure code on FreeBSD (which doesn't yet have all of the extended attribute support). Thanks to: Diego "Flameeyes" Petteno
Diffstat (limited to 'lib/libarchive')
-rw-r--r--lib/libarchive/archive_read_extract.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libarchive/archive_read_extract.c b/lib/libarchive/archive_read_extract.c
index f7127f9..9f1b04c 100644
--- a/lib/libarchive/archive_read_extract.c
+++ b/lib/libarchive/archive_read_extract.c
@@ -1484,8 +1484,10 @@ set_xattrs(struct archive *a, int fd, struct archive_entry *entry)
static int warning_done = 0;
(void)a; /* UNUSED */
(void)fd; /* UNUSED */
- (void)entry; /* UNUSED */
- if (!warning_done) {
+
+ /* If there aren't any extended attributes, then it's okay not
+ * to extract them, otherwise, issue a single warning. */
+ if (archive_entry_xattr_count(entry) != 0 && !warning_done) {
warning_done = 1;
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
"Cannot restore extended attributes on this system");
OpenPOWER on IntegriCloud