From owner-svn-src-all@FreeBSD.ORG Tue Dec 7 16:48:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C14D1065670; Tue, 7 Dec 2010 16:48:02 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C8978FC16; Tue, 7 Dec 2010 16:48:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7Gm2tM074109; Tue, 7 Dec 2010 16:48:02 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7Gm2xj074105; Tue, 7 Dec 2010 16:48:02 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201012071648.oB7Gm2xj074105@svn.freebsd.org> From: Tim Kientzle Date: Tue, 7 Dec 2010 16:48:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216258 - in head/lib/libarchive: . test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2010 16:48:02 -0000 Author: kientzle Date: Tue Dec 7 16:48:01 2010 New Revision: 216258 URL: http://svn.freebsd.org/changeset/base/216258 Log: Don't write data into an empty "file." In particular, this check avoids a warning when extracting directory entries from certain GNU tar archives that store directory contents. MFC after: 3 days Modified: head/lib/libarchive/archive_read_extract.c head/lib/libarchive/test/Makefile head/lib/libarchive/test/test_acl_freebsd.c Modified: head/lib/libarchive/archive_read_extract.c ============================================================================== --- head/lib/libarchive/archive_read_extract.c Tue Dec 7 16:30:52 2010 (r216257) +++ head/lib/libarchive/archive_read_extract.c Tue Dec 7 16:48:01 2010 (r216258) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #endif #include "archive.h" +#include "archive_entry.h" #include "archive_private.h" #include "archive_read_private.h" #include "archive_write_disk_private.h" @@ -107,7 +108,7 @@ archive_read_extract2(struct archive *_a if (r != ARCHIVE_OK) /* If _write_header failed, copy the error. */ archive_copy_error(&a->archive, ad); - else + else if (archive_entry_size(entry) > 0) /* Otherwise, pour data into the entry. */ r = copy_data(_a, ad); r2 = archive_write_finish_entry(ad); Modified: head/lib/libarchive/test/Makefile ============================================================================== --- head/lib/libarchive/test/Makefile Tue Dec 7 16:30:52 2010 (r216257) +++ head/lib/libarchive/test/Makefile Tue Dec 7 16:48:01 2010 (r216258) @@ -2,10 +2,6 @@ # Where to find the libarchive sources LA_SRCDIR=${.CURDIR}/.. -.PATH: ${LA_SRCDIR} - -# Get a list of all libarchive source files -LA_SRCS!=make -f ${LA_SRCDIR}/Makefile -V SRCS TESTS= \ test_acl_basic.c \ @@ -113,8 +109,8 @@ TESTS= \ test_write_open_memory.c -# Build the test program using all libarchive sources + the test sources. -SRCS= ${LA_SRCS} \ +# Build the test program. +SRCS= \ ${TESTS} \ list.h \ main.c \ @@ -125,14 +121,11 @@ NO_MAN=yes PROG=libarchive_test INTERNALPROG=yes # Don't install this; it's just for testing DPADD=${LIBBZ2} ${LIBZ} ${LIBMD} ${LIBCRYPTO} ${LIBBSDXML} -CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" -LDADD= -lz -lbz2 -lmd -lcrypto -lbsdxml +LDADD= -L ${.OBJDIR}/.. -larchive +LDADD+= -lz -lbz2 -llzma -lmd -lcrypto -lbsdxml CFLAGS+= -g CFLAGS+= -I${LA_SRCDIR} -I. - -# Uncomment to build and test lzma and xz support via liblzma -#CFLAGS+= -I/usr/local/include -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 -#LDADD+= -L/usr/local/lib -llzma +CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 # Uncomment to link against dmalloc #LDADD+= -L/usr/local/lib -ldmalloc Modified: head/lib/libarchive/test/test_acl_freebsd.c ============================================================================== --- head/lib/libarchive/test/test_acl_freebsd.c Tue Dec 7 16:30:52 2010 (r216257) +++ head/lib/libarchive/test/test_acl_freebsd.c Tue Dec 7 16:48:01 2010 (r216258) @@ -220,6 +220,11 @@ DEFINE_TEST(test_acl_freebsd) skipping("ACL tests require that ACL support be enabled on the filesystem"); return; } + if (n != 0 && errno == EINVAL) { + close(fd); + skipping("POSIX.1e ACL tests require that POSIX.1e ACL support be enabled on the filesystem"); + return; + } failure("acl_set_fd(): errno = %d (%s)", errno, strerror(errno)); assertEqualInt(0, n);