<pre style='margin:0'>
Mihai Moldovan (Ionic) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/04aecffe45e179d1c4f133856cbaaba14fbb873e">https://github.com/macports/macports-ports/commit/04aecffe45e179d1c4f133856cbaaba14fbb873e</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 04aecff libarchive: add patch to fix build on older Mac OS X
</span>04aecff is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 04aecffe45e179d1c4f133856cbaaba14fbb873e
</span>Author: Michael Dickens <michaelld@macports.org>
AuthorDate: Fri Mar 31 04:58:29 2017 +0200
<span style='display:block; white-space:pre;color:#404040;'> libarchive: add patch to fix build on older Mac OS X
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Fixes: https://trac.macports.org/ticket/53712
</span>---
archivers/libarchive/Portfile | 25 +-
.../libarchive/files/patch-3.3.1_to_master.diff | 10571 +++++++++++++++++++
archivers/libarchive/files/patch-Makefile.am.diff | 13 +
...hive__archive_read_support_format_lha.c_p1.diff | 22 +
4 files changed, 10629 insertions(+), 2 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/archivers/libarchive/Portfile b/archivers/libarchive/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 3678221..7b29447 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/archivers/libarchive/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/archivers/libarchive/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -23,11 +23,32 @@ depends_lib port:bzip2 port:zlib port:libxml2 port:xz \
</span> port:lzo2 port:libiconv \
port:lz4 port:expat
<span style='display:block; white-space:pre;background:#ffe0e0;'>-patchfiles patch-libarchive__archive_read_support_format_lha.c.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# patchfiles patch-libarchive__archive_read_support_format_lha.c.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+####
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# the following section is to be removed when 3.3.2 is released. it is
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# a temporary fix for older Mac OS X versions, and is already upstream.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# comment back in the above patchfile, too.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-3.3.1_to_master.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-Makefile.am.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-libarchive__archive_read_support_format_lha.c_p1.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patch.pre_args -p1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+depends_build port:autoconf port:automake port:libtool
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+post-patch {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system -W ${worksrcpath} "build/autogen.sh"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+####
</span>
configure.args --enable-bsdtar=shared --enable-bsdcpio=shared \
--disable-silent-rules --without-nettle \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- --without-openssl --without-lzmadec
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ --without-openssl
</span>
livecheck.type regex
livecheck.regex libarchive-(\[0-9.\]+)\\.tar.gz
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/archivers/libarchive/files/patch-3.3.1_to_master.diff b/archivers/libarchive/files/patch-3.3.1_to_master.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..acdfba1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/archivers/libarchive/files/patch-3.3.1_to_master.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,10571 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+commit 4476a775c2241a43a471e7b5a5819dd7e51b4f6c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Author: Tim Kientzle <kientzle@acm.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Sat Feb 25 11:39:55 2017 -0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ After the 3.3.1 release, bump the version to 3.3.2dev and go back to debug building.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Use types consistent with the prototypes in the header.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bsdtar manpage: be more precise what -p and --no-same-permissions does
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bsdtar tests: add test_option_fflags
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Mark functions that don't return as dead.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Use ctype macros with unsigned char arguments.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Be more friendly to format string checkers.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Mark functions that don't return as dead.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Add format function annotation.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Mark function that doesn't return as dead.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ mdoc should not contain empty lines.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test_main: compact canNodump() source code a bit
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Fix typos.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Drop trailing comma.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Drop documentation for functions with their own man page.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Move documentation from archive_write_disk(3) into individual man pages.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Fix markup
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Fix markup
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Missing commas
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Compare full file flags in test_option_fflags
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Fix compilation on Mac OS X versions without ACL_SYNCHRONIZE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Change Solaris ACL support to use acl() and facl()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ This removes dependency on libsec and enables compilation on Solaris 10.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Reorganize ACL defines and fix detection of ACL_SYNCHRONIZE on Mac OS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Adjust MacOS part of test_acl_platform_nfs4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ New tar test: test_option_acls
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Add sunacl_get() and setTestAcl() to common test code
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Test for membership.h on Mac OS X and make it a requirement for ACLs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Solaris: use aclp instead of acl to not shadow global acl()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar: test_option_fflags adjustments
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ - Clear fflags on created directories
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ - FreeBSD ZFS workaround - ZFS sets uarch on all touched files
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Fix typos
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ The "size" pax header keyword overrides tar header's size field.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Fixes #880
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Darwin ACL: avoid using mbr_identifier_to_uuid()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Use mbr_uid_to_uuid() and mbr_gid_to_uuid() for backwards compatibility
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ instead. These functions have been introduced together with membership.h.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Fixes #882
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Darwin ACL: avoid unnecessary use of getpwuuid() and getgruuid()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Darwin ACL: fix legacy support in tar/test_option_acls.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Remove ACL_FLAG_DEFER_INHERIT and ACL_FLAG_NO_INHERIT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ OSS-Fuzz Issue 806: integer overflow in mtree_atol10
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Rework the mtree_atol10 integer parser so it can parse
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ INT64_MIN without overflowing the intermediate value.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ While here, make this function behave a little more predictably for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ too-large input: It now always advances the pointer to the first
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ non-digit character.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Break out the library version functions into a separate source file.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ This breaks a static dependency on libbz2. Before this,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ any use of libarchive that ended up linking archive_util.c would
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ require libbz2. (And since archive_util.c contains a bunch of
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ very core functions, this is pretty much everybody.)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Now you only require libbz2 if you request library version information
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ or actually use some other feature that involves bzip2 support.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Note that most of the libraries provide version information via
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ compile-time macros -- libbz2 only provides such information via
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ a function call, which is why this issue only arises with libbz2.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ In particular, the libbz2 version reports the version that we
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ are currently linked against; the other library versions report
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ the version we were compiled with (which may not be the same as
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ what we are currently using).
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bsdcpio: ignore ENOENT for get{grg,pwu}id()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Starting from glibc 2.25, those calls set errno to ENOENT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ when the requested id is not found. So let's stop throwing
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ warning in this expected case.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Also rework the api of lookup_* functions so it is guaranteed that
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lookup_name never returns NULL (unless ENOMEM).
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Changes to configure.ac from MSYS2 Pacman project for mingw-w64. This allows you to use Bcrypt for CNG with autotools.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Add bcrypt to libaries if BCrypt.h exists to enable Crypto-Next-Generation (CNG).
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ seekable zip backend: Accept files with valid ZIP64 EOCD headers
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Previously, a ZIP64 file needed to have a valid classic EOCD header.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ This is not the case at least for archives generated by PHPZipStreamer.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ This commit allows for a bit more than necessary: While PHPZipStreamer
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sets the classic EOCD header to all -1's, the bidding function now
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ succeeds also if the EOCD header values have arbitrary values, as long
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ as the ZIP64 EOCD header seems plausible. This simplifies the logic and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ should not do any harm in practice.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ This fixes #869.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Move platform-specific ACL code to individual source files.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ This makes the code much more readable and eases the addition of new
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ACL implementatons in the future.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Additional changes:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ - most of ACL detection is now done at configure stage
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ - configuration now reports what ACL was detected
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ - NFSv4 ACL tests now test INHERIT_ONLY and NO_PROPAGATE_INHERIT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Add NFSv4 ACL support for Linux via librichacl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Richacls are interpreted as NFSv4 ACLs and stored in archive_acl (Richacl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ flags and masks are not stored). Analog to mac_metadata, NFSv4 ACLs do not
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ get extracted when the extraction of extended attributes is enabled and the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "trusted.richacl" extended attribute is present.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ RichACL masks and are calculated from file mode on extraction.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ mac_metadata acl check has been moved in the code to be together with the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ richacl check.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Do not treat archive_read_disk_entry_setup_acls() as static
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Deduplicate working path code in archive_read_disk_entry_from_file
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ As per Cryptographic Requirements published on Wikileaks on March 2017.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ We discard more bytes of the first keystream
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ to reduce the possibility of non-random bytes.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Similar to:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ freebsd/freebsd@9395fdf
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/CMakeLists.txt b/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 1ca9d8fd..f62153cb 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -15,7 +15,7 @@ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # RelWithDebInfo : Release build with Debug Info
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # MinSizeRel : Release Min Size build
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ IF(NOT CMAKE_BUILD_TYPE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ENDIF(NOT CMAKE_BUILD_TYPE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Set a value type to properly display CMAKE_BUILD_TYPE on GUI if the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # value type is "UNINITIALIZED".
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -579,6 +579,7 @@ int main(void) { return FS_IOC_GETFLAGS; }" HAVE_WORKING_FS_IOC_GETFLAGS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LA_CHECK_INCLUDE_FILE("linux/magic.h" HAVE_LINUX_MAGIC_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LA_CHECK_INCLUDE_FILE("locale.h" HAVE_LOCALE_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++LA_CHECK_INCLUDE_FILE("membership.h" HAVE_MEMBERSHIP_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LA_CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LA_CHECK_INCLUDE_FILE("paths.h" HAVE_PATHS_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LA_CHECK_INCLUDE_FILE("poll.h" HAVE_POLL_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -601,6 +602,7 @@ LA_CHECK_INCLUDE_FILE("sys/mkdev.h" HAVE_SYS_MKDEV_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LA_CHECK_INCLUDE_FILE("sys/mount.h" HAVE_SYS_MOUNT_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LA_CHECK_INCLUDE_FILE("sys/param.h" HAVE_SYS_PARAM_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LA_CHECK_INCLUDE_FILE("sys/poll.h" HAVE_SYS_POLL_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++LA_CHECK_INCLUDE_FILE("sys/richacl.h" HAVE_SYS_RICHACL_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LA_CHECK_INCLUDE_FILE("sys/select.h" HAVE_SYS_SELECT_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LA_CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LA_CHECK_INCLUDE_FILE("sys/statfs.h" HAVE_SYS_STATFS_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -618,6 +620,9 @@ LA_CHECK_INCLUDE_FILE("wctype.h" HAVE_WCTYPE_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LA_CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ IF(ENABLE_CNG)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LA_CHECK_INCLUDE_FILE("Bcrypt.h" HAVE_BCRYPT_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_BCRYPT_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND ADDITIONAL_LIBS "Bcrypt")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF(HAVE_BCRYPT_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ELSE(ENABLE_CNG)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ UNSET(HAVE_BCRYPT_H CACHE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ENDIF(ENABLE_CNG)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1592,78 +1597,212 @@ ENDIF(ENABLE_XATTR)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # which makes the following checks rather more complex than I would like.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ IF(ENABLE_ACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # Solaris and derivates ACLs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(acl HAVE_ACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(facl HAVE_FACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # Libacl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ CHECK_LIBRARY_EXISTS(acl "acl_get_file" "" HAVE_LIBACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ IF(HAVE_LIBACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ SET(CMAKE_REQUIRED_LIBRARIES "acl")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ FIND_LIBRARY(ACL_LIBRARY NAMES acl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LIST(APPEND ADDITIONAL_LIBS ${ACL_LIBRARY})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ENDIF(HAVE_LIBACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_FUNCTION_EXISTS_GLIBC(acl_create_entry HAVE_ACL_CREATE_ENTRY)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_FUNCTION_EXISTS_GLIBC(acl_init HAVE_ACL_INIT)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_FUNCTION_EXISTS_GLIBC(acl_set_fd HAVE_ACL_SET_FD)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_FUNCTION_EXISTS_GLIBC(acl_set_fd_np HAVE_ACL_SET_FD_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_FUNCTION_EXISTS_GLIBC(acl_set_file HAVE_ACL_SET_FILE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_TYPE_EXISTS(acl_permset_t "${INCLUDES}" HAVE_ACL_PERMSET_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # The "acl_get_perm()" function was omitted from the POSIX draft.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # (It's a pretty obvious oversight; otherwise, there's no way to
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # test for specific permissions in a permset.) Linux uses the obvious
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # name, FreeBSD adds _np to mark it as "non-Posix extension."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # Test for both as a double-check that we really have POSIX-style ACL support.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_FUNCTION_EXISTS(acl_get_fd_np HAVE_ACL_GET_FD_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_FUNCTION_EXISTS(acl_get_perm HAVE_ACL_GET_PERM)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_FUNCTION_EXISTS(acl_get_perm_np HAVE_ACL_GET_PERM_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_FUNCTION_EXISTS(acl_get_link HAVE_ACL_GET_LINK)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_FUNCTION_EXISTS(acl_get_link_np HAVE_ACL_GET_LINK_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_FUNCTION_EXISTS(acl_is_trivial_np HAVE_ACL_IS_TRIVIAL_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_FUNCTION_EXISTS(acl_set_link_np HAVE_ACL_SET_LINK_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_SYMBOL_EXISTS(ACL_TYPE_NFS4 "${INCLUDES}" HAVE_ACL_TYPE_NFS4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # MacOS has an acl.h that isn't POSIX. It can be detected by
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # checking for ACL_USER
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_SYMBOL_EXISTS(ACL_USER "${INCLUDES}" HAVE_ACL_USER)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_C_SOURCE_COMPILES("#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_TYPE_EXISTS(acl_t "sys/types.h;sys/acl.h" HAVE_ACL_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_TYPE_EXISTS(acl_entry_t "sys/types.h;sys/acl.h" HAVE_ACL_ENTRY_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_TYPE_EXISTS(acl_permset_t "sys/types.h;sys/acl.h" HAVE_ACL_PERMSET_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_TYPE_EXISTS(acl_tag_t "sys/types.h;sys/acl.h" HAVE_ACL_TAG_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_ACL AND HAVE_FACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_TYPE_EXISTS(aclent_t "sys/acl.h" HAVE_ACLENT_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_ACLENT_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_SYMBOL_EXISTS(GETACL "sys/acl.h" HAVE_DECL_GETACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_SYMBOL_EXISTS(GETACLCNT "sys/acl.h" HAVE_DECL_GETACLCNT)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_SYMBOL_EXISTS(SETACL "sys/acl.h" HAVE_DECL_SETACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_DECL_GETACL AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_DECL_GETACLCNT AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_DECL_SETACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(ARCHIVE_ACL_SUNOS TRUE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_TYPE_EXISTS(ace_t "sys/acl.h" HAVE_ACE_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_ACE_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_SYMBOL_EXISTS(ACE_GETACL "sys/acl.h" HAVE_DECL_ACE_GETACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_SYMBOL_EXISTS(ACE_GETACLCNT "sys/acl.h" HAVE_DECL_ACE_GETACLCNT)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_SYMBOL_EXISTS(ACE_SETACL "sys/acl.h" HAVE_DECL_ACE_SETACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_DECL_ACE_GETACL AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_DECL_ACE_GETACLCNT AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_DECL_ACE_SETACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(ARCHIVE_ACL_SUNOS_NFS4 TRUE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF(HAVE_ACE_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF(HAVE_ACLENT_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF(HAVE_ACL AND HAVE_FACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_ACL_T AND HAVE_ACL_ENTRY_T AND HAVE_ACL_PERMSET_T AND HAVE_ACL_TAG_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(acl_add_perm HAVE_ACL_ADD_PERM)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(acl_clear_perms HAVE_ACL_CLEAR_PERMS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(acl_create_entry HAVE_ACL_CREATE_ENTRY)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(acl_delete_def_file HAVE_ACL_DELETE_DEF_FILE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(acl_free HAVE_ACL_FREE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_entry HAVE_ACL_GET_ENTRY)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_fd HAVE_ACL_GET_FD)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_file HAVE_ACL_GET_FILE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_permset HAVE_ACL_GET_PERMSET)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_qualifier HAVE_ACL_GET_QUALIFIER)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_tag_type HAVE_ACL_GET_TAG_TYPE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(acl_init HAVE_ACL_INIT)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(acl_set_fd HAVE_ACL_SET_FD)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(acl_set_file HAVE_ACL_SET_FILE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(acl_set_qualifier HAVE_ACL_SET_QUALIFIER)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(acl_set_tag_type HAVE_ACL_SET_TAG_TYPE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_ACL_ADD_PERM AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_CLEAR_PERMS AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_CREATE_ENTRY AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_DELETE_DEF_FILE AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_FREE AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_GET_ENTRY AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_GET_FD AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_GET_FILE AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_GET_PERMSET AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_GET_QUALIFIER AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_GET_TAG_TYPE AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_INIT AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_SET_FD AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_SET_FILE AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_SET_QUALIFIER AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_SET_TAG_TYPE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(HAVE_POSIX_ACL_FUNCS 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_perm HAVE_ACL_GET_PERM)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_POSIX_ACL_FUNCS AND HAVE_ACL_LIBACL_H AND HAVE_LIBACL AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_GET_PERM)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(ARCHIVE_ACL_LIBACL TRUE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ELSE()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(acl_add_flag_np HAVE_ACL_ADD_FLAG_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(acl_clear_flags_np HAVE_ACL_CLEAR_FLAGS_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(acl_get_brand_np HAVE_ACL_GET_BRAND_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(acl_get_entry_type_np HAVE_ACL_GET_ENTRY_TYPE_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(acl_get_flag_np HAVE_ACL_GET_FLAG_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(acl_get_flagset_np HAVE_ACL_GET_FLAGSET_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(acl_get_fd_np HAVE_ACL_GET_FD_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(acl_get_link_np HAVE_ACL_GET_LINK_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(acl_get_perm_np HAVE_ACL_GET_PERM_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(acl_is_trivial_np HAVE_ACL_IS_TRIVIAL_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(acl_set_entry_type_np HAVE_ACL_SET_ENTRY_TYPE_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(acl_set_fd_np HAVE_ACL_SET_FD_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(acl_set_link_np HAVE_ACL_SET_LINK_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(mbr_gid_to_uuid HAVE_MBR_GID_TO_UUID)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(mbr_uid_to_uuid HAVE_MBR_UID_TO_UUID)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS(mbr_uuid_to_id HAVE_MBR_UUID_TO_ID)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_C_SOURCE_COMPILES("#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int main(void) { return ACL_TYPE_EXTENDED; }" HAVE_DECL_ACL_TYPE_EXTENDED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_C_SOURCE_COMPILES("#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-int main(void) { return ACL_TYPE_EXTENDED; }" HAVE_ACL_TYPE_EXTENDED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int main(void) { return ACL_SYNCHRONIZE; }" HAVE_DECL_ACL_SYNCHRONIZE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_SYMBOL_EXISTS(ACL_TYPE_NFS4 "sys/acl.h" HAVE_DECL_ACL_TYPE_NFS4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_SYMBOL_EXISTS(ACL_USER "sys/acl.h" HAVE_DECL_ACL_USER)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_POSIX_ACL_FUNCS AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_GET_FD_NP AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_GET_PERM_NP AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ NOT HAVE_ACL_GET_PERM AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_SET_FD_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_DECL_ACL_USER)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(ARCHIVE_ACL_FREEBSD TRUE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_DECL_ACL_TYPE_NFS4 AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_ADD_FLAG_NP AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_CLEAR_FLAGS_NP AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_GET_BRAND_NP AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_GET_ENTRY_TYPE_NP AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_GET_FLAGSET_NP AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_SET_ENTRY_TYPE_NP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(ARCHIVE_ACL_FREEBSD_NFS4 TRUE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ELSEIF(HAVE_DECL_ACL_TYPE_EXTENDED AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_MEMBERSHIP_H AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_ADD_FLAG_NP AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_CLEAR_FLAGS_NP AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_GET_FLAGSET_NP AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_GET_LINK_NP AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_SET_LINK_NP AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_MBR_UID_TO_UUID AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_MBR_GID_TO_UUID AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_MBR_UUID_TO_ID)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(ARCHIVE_ACL_DARWIN TRUE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF(HAVE_ACL_T AND HAVE_ACL_ENTRY_T AND HAVE_ACL_PERMSET_T AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_ACL_TAG_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # Richacl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_LIBRARY_EXISTS(richacl "richacl_get_file" "" HAVE_LIBRICHACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_LIBRICHACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(CMAKE_REQUIRED_LIBRARIES "richacl")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ FIND_LIBRARY(RICHACL_LIBRARY NAMES richacl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND ADDITIONAL_LIBS ${RICHACL_LIBRARY})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF(HAVE_LIBRICHACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_STRUCT_HAS_MEMBER("struct richace" e_type "sys/richacl.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_STRUCT_RICHACE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_STRUCT_HAS_MEMBER("struct richacl" a_flags "sys/richacl.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_STRUCT_RICHACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_LIBRICHACL AND HAVE_STRUCT_RICHACL AND HAVE_STRUCT_RICHACE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(richacl_alloc HAVE_RICHACL_ALLOC)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(richacl_equiv_mode HAVE_RICHACL_EQUIV_MODE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(richacl_free HAVE_RICHACL_FREE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(richacl_get_fd HAVE_RICHACL_GET_FD)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(richacl_get_file HAVE_RICHACL_GET_FILE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(richacl_set_fd HAVE_RICHACL_SET_FD)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CHECK_FUNCTION_EXISTS_GLIBC(richacl_set_file HAVE_RICHACL_SET_FILE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_RICHACL_ALLOC AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_RICHACL_EQUIV_MODE AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_RICHACL_FREE AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_RICHACL_GET_FD AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_RICHACL_GET_FILE AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_RICHACL_SET_FD AND
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HAVE_RICHACL_SET_FILE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(ARCHIVE_ACL_LIBRICHACL TRUE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF(HAVE_LIBRICHACL AND HAVE_STRUCT_RICHACL AND HAVE_STRUCT_RICHACE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(ARCHIVE_ACL_DARWIN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MESSAGE(STATUS "ACL support: Darwin (limited NFSv4)")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ELSEIF(ARCHIVE_ACL_FREEBSD_NFS4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MESSAGE(STATUS "ACL support: FreeBSD (POSIX.1e and NFSv4)")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ELSEIF(ARCHIVE_ACL_FREEBSD)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MESSAGE(STATUS "ACL support: FreeBSD (POSIX.1e)")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ELSEIF(ARCHIVE_ACL_LIBACL OR ARCHIVE_ACL_LIBRICHACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(ARCHIVE_ACL_LIBACL AND ARCHIVE_ACL_LIBRICHACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MESSAGE(STATUS "ACL support: libacl (POSIX.1e) + librichacl (NFSv4)")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ELSEIF(ARCHIVE_ACL_LIBRICHACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MESSAGE(STATUS "ACL support: librichacl (NFSv4)")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ELSE()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MESSAGE(STATUS "ACL support: libacl (POSIX.1e)")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ELSEIF(ARCHIVE_ACL_SUNOS_NFS4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MESSAGE(STATUS "ACL support: Solaris (POSIX.1e and NFSv4)")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ELSEIF(ARCHIVE_ACL_SUNOS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MESSAGE(STATUS "ACL support: Solaris (POSIX.1e)")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ELSE()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MESSAGE(STATUS "ACL support: none")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # Solaris and derivates ACLs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_LIBRARY_EXISTS(sec "acl_get" "" HAVE_LIBSEC)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- IF(HAVE_LIBSEC)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(CMAKE_REQUIRED_LIBRARIES "sec")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- FIND_LIBRARY(SEC_LIBRARY NAMES sec)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- LIST(APPEND ADDITIONAL_LIBS ${SEC_LIBRARY})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ENDIF(HAVE_LIBSEC)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_TYPE_EXISTS(aclent_t "${INCLUDES}" HAVE_ACLENT_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_TYPE_EXISTS(ace_t "${INCLUDES}" HAVE_ACE_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_FUNCTION_EXISTS(acl_get HAVE_FACL_GET)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_FUNCTION_EXISTS(facl_get HAVE_FACL_GET)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_FUNCTION_EXISTS(acl_set HAVE_FACL_SET)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CHECK_FUNCTION_EXISTS(facl_set HAVE_FACL_SET)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ELSE(ENABLE_ACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # If someone runs cmake, then disables ACL support, we need
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # to forcibly override the cached values for these.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACL_CREATE_ENTRY FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACL_GET_LINK FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACL_GET_LINK_NP FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACL_GET_PERM FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACL_GET_PERM_NP FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACL_INIT FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACL_LIB FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACL_PERMSET_T FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACL_SET_FD FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACL_SET_FD_NP FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACL_SET_FILE FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACL_TYPE_NFS4 FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACL_USER FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACL_TYPE_EXTENDED FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACL_GET FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACLENT_T FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACE_T FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_FACL_GET FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_ACL_SET FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- SET(HAVE_FACL_SET FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(ARCHIVE_ACL_DARWIN FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(ARCHIVE_ACL_FREEBSD FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(ARCHIVE_ACL_FREEBSD_NFS4 FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(ARCHIVE_ACL_LIBACL FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(ARCHIVE_ACL_SUNOS FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(ARCHIVE_ACL_SUNOS_NFS4 FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ENDIF(ENABLE_ACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/Makefile.am b/Makefile.am
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index f22a9187..1cbdff56 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/Makefile.am
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/Makefile.am
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -23,7 +23,7 @@ TESTS_ENVIRONMENT= $(libarchive_TESTS_ENVIRONMENT) $(bsdtar_TESTS_ENVIRONMENT) $
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # The next line is commented out by default in shipping libarchive releases.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # It is uncommented by default in trunk.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual -g
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual -g
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AM_CFLAGS=$(DEV_CFLAGS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PLATFORMCPPFLAGS = @PLATFORMCPPFLAGS@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AM_CPPFLAGS=$(PLATFORMCPPFLAGS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -127,6 +127,7 @@ libarchive_la_SOURCES= \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ libarchive/archive_pathmatch.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ libarchive/archive_pathmatch.h \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ libarchive/archive_platform.h \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_platform_acl.h \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ libarchive/archive_ppmd_private.h \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ libarchive/archive_ppmd7.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ libarchive/archive_ppmd7_private.h \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -186,9 +187,9 @@ libarchive_la_SOURCES= \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ libarchive/archive_string_composition.h \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ libarchive/archive_string_sprintf.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ libarchive/archive_util.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_version_details.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ libarchive/archive_virtual.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ libarchive/archive_write.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- libarchive/archive_write_disk_acl.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ libarchive/archive_write_disk_posix.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ libarchive/archive_write_disk_private.h \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ libarchive/archive_write_disk_set_standard_lookup.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -247,6 +248,38 @@ libarchive_la_SOURCES+= \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ libarchive/filter_fork_windows.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++if INC_LINUX_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++libarchive_la_SOURCES+= \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_acl_maps.h \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_acl_maps_linux.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_read_disk_acl_linux.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_write_disk_acl_linux.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++if INC_SUNOS_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++libarchive_la_SOURCES+= \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_acl_maps.h \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_acl_maps_sunos.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_read_disk_acl_sunos.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_write_disk_acl_sunos.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++if INC_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++libarchive_la_SOURCES+= \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_acl_maps.h \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_acl_maps_darwin.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_read_disk_acl_darwin.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_write_disk_acl_darwin.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++if INC_FREEBSD_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++libarchive_la_SOURCES+= \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_acl_maps.h \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_acl_maps_freebsd.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_read_disk_acl_freebsd.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libarchive/archive_write_disk_acl_freebsd.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # -no-undefined marks that libarchive doesn't rely on symbols
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # defined in the application. This is mandatory for cygwin.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ libarchive_la_LDFLAGS= -no-undefined -version-info $(ARCHIVE_LIBTOOL_VERSION)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -951,10 +984,12 @@ bsdtar_test_SOURCES= \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar/test/test_option_T_upper.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar/test/test_option_U_upper.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar/test/test_option_X_upper.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tar/test/test_option_acls.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar/test/test_option_a.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar/test/test_option_b.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar/test/test_option_b64encode.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar/test/test_option_exclude.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tar/test/test_option_fflags.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar/test/test_option_gid_gname.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar/test/test_option_grzip.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar/test/test_option_j.c \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/NEWS b/NEWS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 281c1768..9e517934 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/NEWS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/NEWS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,3 +1,5 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++Mar 16, 2017: NFSv4 ACL support for Linux (librichacl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Feb 26, 2017: libarchive 3.3.1 released
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Security & Feature release
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -293,7 +295,7 @@ May 04, 2008: libarchive 2.5.3b released
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * libarchive: Mark which entry strings are set; be accurate about
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ distinguishing empty strings ("") from unset ones (NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * tar: Don't crash reading entries with empty filenames
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * libarchive_test, bsdtar_test, bsdcpio_test: Better detaults:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * libarchive_test, bsdtar_test, bsdcpio_test: Better defaults:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ run all tests, delete temp dirs, summarize repeated failures
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * -no-undefined to libtool for Cygwin
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * libarchive_test: Skip large file tests on systems with 32-bit off_t
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/build/cmake/config.h.in b/build/cmake/config.h.in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 923a78e5..cfd2a5c0 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/build/cmake/config.h.in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/build/cmake/config.h.in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -179,6 +179,27 @@ typedef uint64_t uintmax_t;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Define ZLIB_WINAPI if zlib was built on Visual Studio. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine ZLIB_WINAPI 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Darwin ACL support */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine ARCHIVE_ACL_DARWIN 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* FreeBSD ACL support */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine ARCHIVE_ACL_FREEBSD 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* FreeBSD NFSv4 ACL support */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine ARCHIVE_ACL_FREEBSD_NFS4 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Linux POSIX.1e ACL support via libacl */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine ARCHIVE_ACL_LIBACL 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Linux NFSv4 ACL support via librichacl */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine ARCHIVE_ACL_LIBRICHACL 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Solaris ACL support */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine ARCHIVE_ACL_SUNOS 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Solaris NFSv4 ACL support */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine ARCHIVE_ACL_SUNOS_NFS4 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* MD5 via ARCHIVE_CRYPTO_MD5_LIBC supported. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine ARCHIVE_CRYPTO_MD5_LIBC 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -326,15 +347,6 @@ typedef uint64_t uintmax_t;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Define to 1 if you have the `acl_set_file' function. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine HAVE_ACL_SET_FILE 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/* True for FreeBSD with NFSv4 ACL support */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#cmakedefine HAVE_ACL_TYPE_NFS4 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/* True for MacOS ACL support */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#cmakedefine HAVE_ACL_TYPE_EXTENDED 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/* True for systems with POSIX ACL support */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#cmakedefine HAVE_ACL_USER 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Define to 1 if you have the `arc4random_buf' function. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine HAVE_ARC4RANDOM_BUF 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -371,6 +383,34 @@ typedef uint64_t uintmax_t;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Define to 1 if you have the `cygwin_conv_path' function. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine HAVE_CYGWIN_CONV_PATH 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Define to 1 if you have the declaration of `ACE_GETACL', and to 0 if you
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ don't. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine HAVE_DECL_ACE_GETACL 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Define to 1 if you have the declaration of `ACE_GETACLCNT', and to 0 if you
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ don't. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine HAVE_DECL_ACE_GETACLCNT 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Define to 1 if you have the declaration of `ACE_SETACL', and to 0 if you
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ don't. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine HAVE_DECL_ACE_SETACL 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Define to 1 if you have the declaration of `ACL_SYNCHRONIZE', and to 0 if
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ you don't. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine HAVE_DECL_ACL_SYNCHRONIZE 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Define to 1 if you have the declaration of `ACL_TYPE_EXTENDED', and to 0 if
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ you don't. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine HAVE_DECL_ACL_TYPE_EXTENDED 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Define to 1 if you have the declaration of `ACL_TYPE_NFS4', and to 0 if you
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ don't. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine HAVE_DECL_ACL_TYPE_NFS4 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Define to 1 if you have the declaration of `ACL_USER', and to 0 if you
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ don't. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine HAVE_DECL_ACL_USER 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Define to 1 if you have the declaration of `INT32_MAX', and to 0 if you
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ don't. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine HAVE_DECL_INT32_MAX 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -395,6 +435,10 @@ typedef uint64_t uintmax_t;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ don't. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine HAVE_DECL_INTMAX_MIN 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Define to 1 if you have the declaration of `SETACL', and to 0 if you don't.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine HAVE_DECL_SETACL 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Define to 1 if you have the declaration of `SIZE_MAX', and to 0 if you
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ don't. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine HAVE_DECL_SIZE_MAX 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -468,6 +512,14 @@ typedef uint64_t uintmax_t;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Define to 1 if EXTATTR_NAMESPACE_USER is defined in sys/extattr.h. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine HAVE_DECL_EXTATTR_NAMESPACE_USER 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Define to 1 if you have the declaration of `GETACL', and to 0 if you don't.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine HAVE_DECL_GETACL 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Define to 1 if you have the declaration of `GETACLCNT', and to 0 if you
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ don't. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine HAVE_DECL_GETACLCNT 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Define to 1 if you have the `fchdir' function. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine HAVE_FCHDIR 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -742,6 +794,9 @@ typedef uint64_t uintmax_t;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Define to 1 if you have the `mbrtowc' function. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine HAVE_MBRTOWC 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Define to 1 if you have the <membership.h> header file. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine HAVE_MEMBERSHIP_H 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Define to 1 if you have the `memmove' function. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine HAVE_MEMMOVE 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -979,6 +1034,9 @@ typedef uint64_t uintmax_t;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Define to 1 if you have the <sys/poll.h> header file. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine HAVE_SYS_POLL_H 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Define to 1 if you have the <sys/richacl.h> header file. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#cmakedefine HAVE_SYS_RICHACL_H 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Define to 1 if you have the <sys/select.h> header file. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #cmakedefine HAVE_SYS_SELECT_H 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/build/version b/build/version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index ef834572..6d36e9c1 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/build/version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/build/version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1 +1 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-3003001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++3003002dev
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/cat/test/CMakeLists.txt b/cat/test/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 7f1ce5e7..0cd3aad8 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/cat/test/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/cat/test/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -29,6 +29,16 @@ IF(ENABLE_CAT AND ENABLE_TEST)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Register target
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ADD_EXECUTABLE(bsdcat_test ${bsdcat_test_SOURCES})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(ENABLE_ACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(TEST_ACL_LIBS "")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_LIBACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND TEST_ACL_LIBS ${ACL_LIBRARY})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF(HAVE_LIBACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_LIBRICHACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND TEST_ACL_LIBS ${RICHACL_LIBRARY})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF(HAVE_LIBRICHACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ TARGET_LINK_LIBRARIES(bsdcat_test ${TEST_ACL_LIBS})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF(ENABLE_ACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ SET_PROPERTY(TARGET bsdcat_test PROPERTY COMPILE_DEFINITIONS LIST_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/configure.ac b/configure.ac
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 3a8ac6a8..05b5a099 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/configure.ac
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/configure.ac
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -4,8 +4,8 @@ dnl First, define all of the version numbers up front.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dnl In particular, this allows the version macro to be used in AC_INIT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dnl These first two version numbers are updated automatically on each release.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-m4_define([LIBARCHIVE_VERSION_S],[3.3.1])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-m4_define([LIBARCHIVE_VERSION_N],[3003001])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++m4_define([LIBARCHIVE_VERSION_S],[3.3.2dev])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++m4_define([LIBARCHIVE_VERSION_N],[3003002])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dnl bsdtar and bsdcpio versioning tracks libarchive
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m4_define([BSDTAR_VERSION_S],LIBARCHIVE_VERSION_S())
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -253,6 +253,7 @@ esac
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Checks for header files.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AC_HEADER_DIRENT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AC_HEADER_SYS_WAIT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++AC_CHECK_HEADERS([acl/libacl.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AC_CHECK_HEADERS([copyfile.h ctype.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AC_CHECK_HEADERS([errno.h ext2fs/ext2_fs.h fcntl.h grp.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -283,16 +284,16 @@ AS_VAR_IF([ac_cv_have_decl_FS_IOC_GETFLAGS], [yes],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ [AC_DEFINE_UNQUOTED([HAVE_WORKING_FS_IOC_GETFLAGS], [1],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ [Define to 1 if you have a working FS_IOC_GETFLAGS])])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-AC_CHECK_HEADERS([locale.h paths.h poll.h pthread.h pwd.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++AC_CHECK_HEADERS([locale.h membership.h paths.h poll.h pthread.h pwd.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AC_CHECK_HEADERS([readpassphrase.h signal.h spawn.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AC_CHECK_HEADERS([stdarg.h stdint.h stdlib.h string.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-AC_CHECK_HEADERS([sys/cdefs.h sys/extattr.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++AC_CHECK_HEADERS([sys/acl.h sys/cdefs.h sys/extattr.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AC_CHECK_HEADERS([sys/ioctl.h sys/mkdev.h sys/mount.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-AC_CHECK_HEADERS([sys/param.h sys/poll.h sys/select.h sys/statfs.h sys/statvfs.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++AC_CHECK_HEADERS([sys/param.h sys/poll.h sys/richacl.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++AC_CHECK_HEADERS([sys/select.h sys/statfs.h sys/statvfs.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AC_CHECK_HEADERS([sys/time.h sys/utime.h sys/utsname.h sys/vfs.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AC_CHECK_HEADERS([time.h unistd.h utime.h wchar.h wctype.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AC_CHECK_HEADERS([windows.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-AC_CHECK_HEADERS([Bcrypt.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # check windows.h first; the other headers require it.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AC_CHECK_HEADERS([wincrypt.h winioctl.h],[],[],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ [[#ifdef HAVE_WINDOWS_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -399,6 +400,9 @@ if test "x$with_lzo2" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AC_CHECK_LIB(lzo2,lzo1x_decompress_safe)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++AC_ARG_WITH([cng],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AS_HELP_STRING([--without-cng], [Don't build support of CNG(Crypto Next Generation)]))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AC_ARG_WITH([nettle],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AS_HELP_STRING([--without-nettle], [Don't build with crypto support from Nettle]))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AC_ARG_WITH([openssl],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -697,72 +701,211 @@ AC_ARG_ENABLE([acl],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ [Disable ACL support (default: check)]))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if test "x$enable_acl" != "xno"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AC_CHECK_HEADERS([acl/libacl.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AC_CHECK_HEADERS([sys/acl.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AC_CHECK_LIB([acl],[acl_get_file])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AC_CHECK_FUNCS([acl_create_entry acl_get_fd_np])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AC_CHECK_FUNCS([acl_init acl_set_fd acl_set_fd_np acl_set_file])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # Libacl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CHECK_LIB([acl], [acl_get_file])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CHECK_TYPES([acl_t, acl_entry_t, acl_permset_t, acl_tag_t], [], [], [
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #if HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #if HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CHECK_LIB([richacl], [richacl_get_file])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CHECK_TYPES([[struct richace], [struct richacl]], [], [], [
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #if HAVE_SYS_RICHACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #include <sys/richacl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AC_CHECK_TYPES(acl_permset_t,,,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- [#if HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #if HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # The "acl_get_perm()" function was omitted from the POSIX draft.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # (It's a pretty obvious oversight; otherwise, there's no way to
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # test for specific permissions in a permset.) Linux uses the obvious
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # name, FreeBSD adds _np to mark it as "non-Posix extension."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # Test for both as a double-check that we really have POSIX-style ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # support.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AC_CHECK_FUNCS(acl_get_perm_np acl_get_perm acl_get_link acl_get_link_np,,,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- [#if HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #if HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # Solaris and derivates ACLs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CHECK_FUNCS(acl facl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if test "x$ac_cv_lib_richacl_richacl_get_file" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_type_struct_richace" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_type_struct_richacl" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CACHE_VAL([ac_cv_archive_acl_librichacl],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [AC_CHECK_FUNCS(richacl_alloc \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl_equiv_mode \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl_free \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl_get_fd \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl_get_file \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl_set_fd \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl_set_file,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [ac_cv_archive_acl_librichacl=yes], [ac_cv_archive_acl_librichacl=no], [#include <sys/richacl.h>])])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # Check for acl_is_trivial_np on FreeBSD
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AC_CHECK_FUNCS(acl_is_trivial_np,,,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- [#if HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #if HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if test "x$ac_cv_func_acl" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_facl" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CHECK_TYPES([aclent_t], [], [], [[#include <sys/acl.h>]])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if test "x$ac_cv_type_aclent_t" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CACHE_VAL([ac_cv_archive_acl_sunos],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [AC_CHECK_DECLS([GETACL, SETACL, GETACLCNT],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [ac_cv_archive_acl_sunos=yes], [ac_cv_archive_acl_sunos=no],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [#include <sys/acl.h>])])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CHECK_TYPES([ace_t], [], [], [[#include <sys/acl.h>]])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if test "x$ac_cv_type_ace_t" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CACHE_VAL([ac_cv_archive_acl_sunos_nfs4],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [AC_CHECK_DECLS([ACE_GETACL, ACE_SETACL, ACE_GETACLCNT],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [ac_cv_archive_acl_sunos_nfs4=yes],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [ac_cv_archive_acl_sonos_nfs4=no],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [#include <sys/acl.h>])])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ elif test "x$ac_cv_type_acl_t" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_type_acl_entry_t" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_type_acl_permset_t" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_type_acl_tag_t" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # POSIX.1e ACL functions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CACHE_VAL([ac_cv_posix_acl_funcs],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [AC_CHECK_FUNCS(acl_add_perm \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_clear_perms \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_create_entry \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_delete_def_file \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_entry \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_fd \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_file \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_permset \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_qualifier \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_tag_type \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_init \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_fd \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_file \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_qualifier \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_tag_type,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [ac_cv_posix_acl_funcs=yes], [ac_cv_posix_acl_funcs=no],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [#if HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #if HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # Check for ACL_TYPE_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AC_CHECK_DECL([ACL_TYPE_NFS4],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- [AC_DEFINE(HAVE_ACL_TYPE_NFS4, 1, [True for FreeBSD with NFSv4 ACL support])],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- [],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- [#include <sys/acl.h>])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CHECK_FUNCS(acl_get_perm)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # MacOS has an acl.h that isn't POSIX. It can be detected by
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # checking for ACL_USER
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AC_CHECK_DECL([ACL_USER],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- [AC_DEFINE(HAVE_ACL_USER, 1, [True for systems with POSIX ACL support])],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- [],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- [#include <sys/acl.h>])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if test "x$ac_cv_posix_acl_funcs" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_header_acl_libacl_h" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_lib_acl_acl_get_file" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_acl_get_perm"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CACHE_VAL([ac_cv_archive_acl_libacl],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [ac_cv_archive_acl_libacl=yes])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_DEFINE([ARCHIVE_ACL_LIBACL], [1],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [POSIX.1e ACL support via libacl])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # FreeBSD/Darwin
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CHECK_FUNCS(acl_add_flag_np \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_clear_flags_np \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_brand_np \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_entry_type_np \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_flag_np \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_flagset_np \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_fd_np \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_link_np \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_perm_np \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_is_trivial_np \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_entry_type_np \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_fd_np \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_link_np,,,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #include <sys/acl.h>])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CHECK_FUNCS(mbr_uid_to_uuid \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mbr_uuid_to_id \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mbr_gid_to_uuid,,,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [#include <membership.h>])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CHECK_DECLS([ACL_TYPE_EXTENDED, ACL_TYPE_NFS4, ACL_USER,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_SYNCHRONIZE], [], [],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #include <sys/acl.h>])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if test "x$ac_cv_posix_acl_funcs" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_acl_get_fd_np" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_acl_get_perm" != "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_acl_get_perm_np" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_acl_set_fd_np" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if test "x$ac_cv_have_decl_ACL_USER" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CACHE_VAL([ac_cv_archive_acl_freebsd],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [ac_cv_archive_acl_freebsd=yes])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if test "x$ac_cv_have_decl_ACL_TYPE_NFS4" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_acl_add_flag_np" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_acl_get_brand_np" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_acl_get_entry_type_np" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_acl_get_flagset_np" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_acl_set_entry_type_np" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CACHE_VAL([ac_cv_archive_acl_freebsd_nfs4],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [ac_cv_archive_acl_freebsd_nfs4=yes])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ elif test "x$ac_cv_have_decl_ACL_TYPE_EXTENDED" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_acl_add_flag_np" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_acl_get_flagset_np" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_acl_get_link_np" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_acl_set_link_np" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_mbr_uid_to_uuid" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_mbr_uuid_to_id" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_func_mbr_gid_to_uuid" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CACHE_VAL([ac_cv_archive_acl_darwin],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [ac_cv_archive_acl_darwin=yes])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_MSG_CHECKING([for ACL support])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if test "x$ac_cv_archive_acl_libacl" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -a "x$ac_cv_archive_acl_librichacl" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_MSG_RESULT([libacl (POSIX.1e) + librichacl (NFSv4)])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_DEFINE([ARCHIVE_ACL_LIBACL], [1],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [Linux POSIX.1e ACL support via libacl])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_DEFINE([ARCHIVE_ACL_LIBRICHACL], [1],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [Linux NFSv4 ACL support via librichacl])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ elif test "x$ac_cv_archive_acl_libacl" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_MSG_RESULT([libacl (POSIX.1e)])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_DEFINE([ARCHIVE_ACL_LIBACL], [1],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [Linux POSIX.1e ACL support via libacl])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ elif test "x$ac_cv_archive_acl_librichacl" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_MSG_RESULT([librichacl (NFSv4)])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_DEFINE([ARCHIVE_ACL_LIBRICHACL], [1],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [Linux NFSv4 ACL support via librichacl])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ elif test "x$ac_cv_archive_acl_darwin" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_DEFINE([ARCHIVE_ACL_DARWIN], [1], [Darwin ACL support])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_MSG_RESULT([Darwin (limited NFSv4)])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ elif test "x$ac_cv_archive_acl_sunos" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_DEFINE([ARCHIVE_ACL_SUNOS], [1], [Solaris ACL support])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if test "x$ac_cv_archive_acl_sunos_nfs4" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_DEFINE([ARCHIVE_ACL_SUNOS_NFS4], [1],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [Solaris NFSv4 ACL support])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_MSG_RESULT([Solaris (POSIX.1e and NFSv4)])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_MSG_RESULT([Solaris (POSIX.1e)])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ elif test "x$ac_cv_archive_acl_freebsd" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_DEFINE([ARCHIVE_ACL_FREEBSD], [1], [FreeBSD ACL support])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if test "x$ac_cv_archive_acl_freebsd_nfs4" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_DEFINE([ARCHIVE_ACL_FREEBSD_NFS4], [1],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [FreeBSD NFSv4 ACL support])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_MSG_RESULT([FreeBSD (POSIX.1e and NFSv4)])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_MSG_RESULT([FreeBSD (POSIX.1e)])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_MSG_RESULT([none])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # MacOS has ACL_TYPE_EXTENDED instead
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AC_CHECK_DECL([ACL_TYPE_EXTENDED],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- [AC_DEFINE(HAVE_ACL_TYPE_EXTENDED, 1, [True for MacOS ACL support])],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- [],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- [#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #include <sys/acl.h>])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # Solaris and derivates ACLs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AC_CHECK_LIB([sec], [acl_get])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AC_CHECK_TYPES([aclent_t], [], [], [[#include <sys/acl.h>]])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AC_CHECK_TYPES([ace_t], [], [], [[#include <sys/acl.h>]])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AC_CHECK_FUNCS(acl_get facl_get acl_set facl_set)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++AM_CONDITIONAL([INC_LINUX_ACL],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [test "x$ac_cv_archive_acl_libacl" = "xyes" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -o "x$ac_cv_archive_acl_librichacl" = "xyes"])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++AM_CONDITIONAL([INC_SUNOS_ACL], [test "x$ac_cv_archive_acl_sunos" = "xyes"])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++AM_CONDITIONAL([INC_DARWIN_ACL],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [test "x$ac_cv_archive_acl_darwin" = "xyes"])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++AM_CONDITIONAL([INC_FREEBSD_ACL],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [test "x$ac_cv_archive_acl_freebsd" = "xyes"])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Additional requirements
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AC_SYS_LARGEFILE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -852,6 +995,16 @@ case "$host_os" in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ;;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ esac
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++if test "x$with_cng" != "xno"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ AC_CHECK_HEADERS([bcrypt.h],[
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIBS="$LIBS -lbcrypt"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ],[],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ [[#ifdef HAVE_WINDOWS_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # include <windows.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ]])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if test "x$with_nettle" != "xno"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AC_CHECK_HEADERS([nettle/md5.h nettle/ripemd160.h nettle/sha.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AC_CHECK_HEADERS([nettle/pbkdf2.h nettle/aes.h nettle/hmac.h])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/cpio/cpio.c b/cpio/cpio.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 6c20ee68..1691c756 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/cpio/cpio.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/cpio/cpio.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -108,22 +108,22 @@ static int entry_to_archive(struct cpio *, struct archive_entry *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int file_to_archive(struct cpio *, const char *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void free_cache(struct name_cache *cache);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void list_item_verbose(struct cpio *, struct archive_entry *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static void long_help(void);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void long_help(void) __LA_DEAD;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static const char *lookup_gname(struct cpio *, gid_t gid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int lookup_gname_helper(struct cpio *,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const char **name, id_t gid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static const char *lookup_uname(struct cpio *, uid_t uid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int lookup_uname_helper(struct cpio *,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const char **name, id_t uid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static void mode_in(struct cpio *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static void mode_list(struct cpio *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void mode_in(struct cpio *) __LA_DEAD;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void mode_list(struct cpio *) __LA_DEAD;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void mode_out(struct cpio *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void mode_pass(struct cpio *, const char *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static const char *remove_leading_slash(const char *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int restore_time(struct cpio *, struct archive_entry *,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const char *, int fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static void usage(void);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static void version(void);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void usage(void) __LA_DEAD;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void version(void) __LA_DEAD;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static const char * passphrase_callback(struct archive *, void *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void passphrase_free(char *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1344,23 +1344,23 @@ lookup_name(struct cpio *cpio, struct name_cache **name_cache_variable,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cache->cache[slot].name = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (lookup_fn(cpio, &name, id) == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (name == NULL || name[0] == '\0') {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* If lookup failed, format it as a number. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- snprintf(asnum, sizeof(asnum), "%u", (unsigned)id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- name = asnum;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- cache->cache[slot].name = strdup(name);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (cache->cache[slot].name != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- cache->cache[slot].id = id;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (cache->cache[slot].name);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Conveniently, NULL marks an empty slot, so
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * if the strdup() fails, we've just failed to
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * cache it. No recovery necessary.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (lookup_fn(cpio, &name, id)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* If lookup failed, format it as a number. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ snprintf(asnum, sizeof(asnum), "%u", (unsigned)id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ name = asnum;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cache->cache[slot].name = strdup(name);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (cache->cache[slot].name != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cache->cache[slot].id = id;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (cache->cache[slot].name);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Conveniently, NULL marks an empty slot, so
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * if the strdup() fails, we've just failed to
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * cache it. No recovery necessary.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1381,15 +1381,14 @@ lookup_uname_helper(struct cpio *cpio, const char **name, id_t id)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ errno = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pwent = getpwuid((uid_t)id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (pwent == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *name = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (errno != 0 && errno != ENOENT)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (errno && errno != ENOENT)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lafe_warnc(errno, "getpwuid(%s) failed",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cpio_i64toa((int64_t)id));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (errno);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *name = pwent->pw_name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static const char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1409,15 +1408,14 @@ lookup_gname_helper(struct cpio *cpio, const char **name, id_t id)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ errno = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ grent = getgrgid((gid_t)id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (grent == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *name = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (errno != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (errno && errno != ENOENT)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lafe_warnc(errno, "getgrgid(%s) failed",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cpio_i64toa((int64_t)id));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (errno);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *name = grent->gr_name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/cpio/test/CMakeLists.txt b/cpio/test/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index ec9509be..4c3fb88a 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/cpio/test/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/cpio/test/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -62,6 +62,16 @@ IF(ENABLE_CPIO AND ENABLE_TEST)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Register target
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ADD_EXECUTABLE(bsdcpio_test ${bsdcpio_test_SOURCES})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(ENABLE_ACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(TEST_ACL_LIBS "")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_LIBACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND TEST_ACL_LIBS ${ACL_LIBRARY})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF(HAVE_LIBACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_LIBRICHACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND TEST_ACL_LIBS ${RICHACL_LIBRARY})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF(HAVE_LIBRICHACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ TARGET_LINK_LIBRARIES(bsdcpio_test ${TEST_ACL_LIBS})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF(ENABLE_ACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ SET_PROPERTY(TARGET bsdcpio_test PROPERTY COMPILE_DEFINITIONS LIST_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 1f85c014..0ed3fa48 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -14,6 +14,7 @@ SET(include_HEADERS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Sources and private headers
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ SET(libarchive_SOURCES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_acl.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_acl_private.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_check_magic.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_cmdline.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_cmdline_private.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -47,6 +48,7 @@ SET(libarchive_SOURCES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_pathmatch.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_pathmatch.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_platform.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_platform_acl.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_ppmd_private.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_ppmd7.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_ppmd7_private.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -106,9 +108,9 @@ SET(libarchive_SOURCES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_string_composition.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_string_sprintf.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_util.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_version_details.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_virtual.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_write.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_write_disk_acl.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_write_disk_posix.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_write_disk_private.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_write_disk_set_standard_lookup.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -210,6 +212,28 @@ IF(WIN32 AND NOT CYGWIN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LIST(APPEND libarchive_SOURCES filter_fork_windows.c)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ENDIF(WIN32 AND NOT CYGWIN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++IF(ARCHIVE_ACL_DARWIN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND libarchive_SOURCES archive_acl_maps.h)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND libarchive_SOURCES archive_acl_maps_darwin.c)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND libarchive_SOURCES archive_read_disk_acl_darwin.c)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND libarchive_SOURCES archive_write_disk_acl_darwin.c)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ELSEIF(ARCHIVE_ACL_FREEBSD)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND libarchive_SOURCES archive_acl_maps.h)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND libarchive_SOURCES archive_acl_maps_freebsd.c)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND libarchive_SOURCES archive_read_disk_acl_freebsd.c)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND libarchive_SOURCES archive_write_disk_acl_freebsd.c)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ELSEIF(ARCHIVE_ACL_LIBACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND libarchive_SOURCES archive_acl_maps.h)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND libarchive_SOURCES archive_acl_maps_linux.c)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND libarchive_SOURCES archive_read_disk_acl_linux.c)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND libarchive_SOURCES archive_write_disk_acl_linux.c)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ELSEIF(ARCHIVE_ACL_SUNOS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND libarchive_SOURCES archive_acl_maps.h)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND libarchive_SOURCES archive_acl_maps_sunos.c)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND libarchive_SOURCES archive_read_disk_acl_sunos.c)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND libarchive_SOURCES archive_write_disk_acl_sunos.c)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ENDIF()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Libarchive is a shared library
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive.h b/libarchive/archive.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index d400735a..d6913f35 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -36,7 +36,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * assert that ARCHIVE_VERSION_NUMBER >= 2012108.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Note: Compiler will complain if this does not match archive_entry.h! */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define ARCHIVE_VERSION_NUMBER 3003001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define ARCHIVE_VERSION_NUMBER 3003002
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <sys/stat.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <stddef.h> /* for wchar_t */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Textual name/version of the library, useful for version displays.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define ARCHIVE_VERSION_ONLY_STRING "3.3.1"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define ARCHIVE_VERSION_ONLY_STRING "3.3.2dev"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ __LA_DECL const char * archive_version_string(void);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_acl_maps.h b/libarchive/archive_acl_maps.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 00000000..c9dba525
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_acl_maps.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,52 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2017 Martin Matuska
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifndef __LIBARCHIVE_BUILD
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#error This header is only to be used internally to libarchive.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifndef ARCHIVE_ACL_MAPS_H_INCLUDED
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define ARCHIVE_ACL_MAPS_H_INCLUDED
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_platform_acl.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++typedef struct {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const int a_perm; /* Libarchive permission or flag */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const int p_perm; /* Platform permission or flag */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++} acl_perm_map_t;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifndef _ARCHIVE_ACL_MAPS_DEFS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_POSIX1E
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++extern const acl_perm_map_t acl_posix_perm_map[];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++extern const int acl_posix_perm_map_size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++extern const acl_perm_map_t acl_nfs4_perm_map[];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++extern const int acl_nfs4_perm_map_size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++extern const acl_perm_map_t acl_nfs4_flag_map[];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++extern const int acl_nfs4_flag_map_size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* !_ARCHIVE_ACL_MAPS_DEFS */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_MAPS_H_INCLUDED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_acl_maps_darwin.c b/libarchive/archive_acl_maps_darwin.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 00000000..eaa046ce
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_acl_maps_darwin.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,76 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2017 Martin Matuska
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_platform.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define _ACL_PRIVATE /* For debugging */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_entry.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_read_disk_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define _ARCHIVE_ACL_MAPS_DEFS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_acl_maps.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const acl_perm_map_t acl_nfs4_perm_map[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_EXTATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_EXTATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_SECURITY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_SECURITY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_CHANGE_OWNER},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_DECL_ACL_SYNCHRONIZE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const int acl_nfs4_perm_map_size =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (int)(sizeof(acl_nfs4_perm_map)/sizeof(acl_nfs4_perm_map[0]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const acl_perm_map_t acl_nfs4_flag_map[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_LIMIT_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_ONLY_INHERIT}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const int acl_nfs4_flag_map_size =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (int)(sizeof(acl_nfs4_flag_map)/sizeof(acl_nfs4_flag_map[0]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_acl_maps_freebsd.c b/libarchive/archive_acl_maps_freebsd.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 00000000..222dcff1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_acl_maps_freebsd.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,87 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2017 Martin Matuska
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_platform.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define _ACL_PRIVATE /* For debugging */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_entry.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_read_disk_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define _ARCHIVE_ACL_MAPS_DEFS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_acl_maps.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const acl_perm_map_t acl_posix_perm_map[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ, ACL_READ},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const int acl_posix_perm_map_size =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (int)(sizeof(acl_posix_perm_map)/sizeof(acl_posix_perm_map[0]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const acl_perm_map_t acl_nfs4_perm_map[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const int acl_nfs4_perm_map_size =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (int)(sizeof(acl_nfs4_perm_map)/sizeof(acl_nfs4_perm_map[0]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const acl_perm_map_t acl_nfs4_flag_map[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACL_ENTRY_SUCCESSFUL_ACCESS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACL_ENTRY_FAILED_ACCESS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const int acl_nfs4_flag_map_size =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (int)(sizeof(acl_nfs4_flag_map)/sizeof(acl_nfs4_flag_map[0]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_FREEBSD_NFS4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_acl_maps_linux.c b/libarchive/archive_acl_maps_linux.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 00000000..3476e12c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_acl_maps_linux.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,90 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2017 Martin Matuska
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_platform.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define _ACL_PRIVATE /* For debugging */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_RICHACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/richacl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_entry.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_read_disk_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define _ARCHIVE_ACL_MAPS_DEFS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_acl_maps.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const acl_perm_map_t acl_posix_perm_map[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ, ACL_READ},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const int acl_posix_perm_map_size =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (int)(sizeof(acl_posix_perm_map)/sizeof(acl_posix_perm_map[0]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_LIBACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const acl_perm_map_t acl_nfs4_perm_map[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_EXECUTE, RICHACE_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_DATA, RICHACE_READ_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, RICHACE_LIST_DIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_DATA, RICHACE_WRITE_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ADD_FILE, RICHACE_ADD_FILE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_APPEND_DATA, RICHACE_APPEND_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, RICHACE_ADD_SUBDIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, RICHACE_READ_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, RICHACE_WRITE_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, RICHACE_DELETE_CHILD},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, RICHACE_READ_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, RICHACE_WRITE_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_DELETE, RICHACE_DELETE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_ACL, RICHACE_READ_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_ACL, RICHACE_WRITE_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, RICHACE_WRITE_OWNER},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, RICHACE_SYNCHRONIZE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const int acl_nfs4_perm_map_size =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (int)(sizeof(acl_nfs4_perm_map)/sizeof(acl_nfs4_perm_map[0]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const acl_perm_map_t acl_nfs4_flag_map[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, RICHACE_FILE_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, RICHACE_DIRECTORY_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, RICHACE_NO_PROPAGATE_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, RICHACE_INHERIT_ONLY_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, RICHACE_INHERITED_ACE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const int acl_nfs4_flag_map_size =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (int)(sizeof(acl_nfs4_flag_map)/sizeof(acl_nfs4_flag_map[0]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_LIBRICHACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_acl_maps_sunos.c b/libarchive/archive_acl_maps_sunos.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 00000000..2197d501
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_acl_maps_sunos.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,90 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2017 Martin Matuska
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_platform.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define _ACL_PRIVATE /* For debugging */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_entry.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_read_disk_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define _ARCHIVE_ACL_MAPS_DEFS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_acl_maps.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const acl_perm_map_t acl_posix_perm_map[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_EXECUTE, S_IXOTH },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE, S_IWOTH },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ, S_IROTH }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const int acl_posix_perm_map_size =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (int)(sizeof(acl_posix_perm_map)/sizeof(acl_posix_perm_map[0]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const acl_perm_map_t acl_nfs4_perm_map[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_EXECUTE, ACE_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_DATA, ACE_READ_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACE_LIST_DIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACE_WRITE_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ADD_FILE, ACE_ADD_FILE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACE_APPEND_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACE_ADD_SUBDIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACE_READ_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACE_WRITE_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACE_DELETE_CHILD},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACE_READ_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACE_WRITE_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_DELETE, ACE_DELETE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_ACL, ACE_READ_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACE_WRITE_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACE_WRITE_OWNER},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACE_SYNCHRONIZE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const int acl_nfs4_perm_map_size =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (int)(sizeof(acl_nfs4_perm_map)/sizeof(acl_nfs4_perm_map[0]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const acl_perm_map_t acl_nfs4_flag_map[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACE_FILE_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACE_DIRECTORY_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACE_NO_PROPAGATE_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACE_INHERIT_ONLY_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACE_SUCCESSFUL_ACCESS_ACE_FLAG},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACE_FAILED_ACCESS_ACE_FLAG},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef ACE_INHERITED_ACE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACE_INHERITED_ACE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const int acl_nfs4_flag_map_size =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (int)(sizeof(acl_nfs4_flag_map)/sizeof(acl_nfs4_flag_map[0]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_SUNOS_NFS4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_check_magic.c b/libarchive/archive_check_magic.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index c695e582..288ce233 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_check_magic.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_check_magic.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -62,7 +62,7 @@ errmsg(const char *m)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static __LA_DEAD void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ diediedie(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_entry.3 b/libarchive/archive_entry.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index f5e22af8..f75916c9 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_entry.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_entry.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -25,7 +25,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\" $FreeBSD$
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Dd Feburary 2, 2012
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Dd February 2, 2012
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Dt ARCHIVE_ENTRY 3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Os
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Sh NAME
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_entry.c b/libarchive/archive_entry.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 10eff11b..e2681941 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_entry.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_entry.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -401,7 +401,7 @@ archive_entry_fflags_text(struct archive_entry *entry)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-int64_t
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++la_int64_t
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_entry_gid(struct archive_entry *entry)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (entry->ae_stat.aest_gid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -502,7 +502,7 @@ _archive_entry_hardlink_l(struct archive_entry *entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (archive_mstring_get_mbs_l(&entry->ae_hardlink, p, len, sc));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-int64_t
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++la_int64_t
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_entry_ino(struct archive_entry *entry)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (entry->ae_stat.aest_ino);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -514,7 +514,7 @@ archive_entry_ino_is_set(struct archive_entry *entry)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (entry->ae_set & AE_SET_INO);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-int64_t
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++la_int64_t
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_entry_ino64(struct archive_entry *entry)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (entry->ae_stat.aest_ino);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -627,7 +627,7 @@ archive_entry_rdevminor(struct archive_entry *entry)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return minor(entry->ae_stat.aest_rdev);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-int64_t
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++la_int64_t
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_entry_size(struct archive_entry *entry)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (entry->ae_stat.aest_size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -715,7 +715,7 @@ _archive_entry_symlink_l(struct archive_entry *entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (archive_mstring_get_mbs_l( &entry->ae_symlink, p, len, sc));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-int64_t
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++la_int64_t
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_entry_uid(struct archive_entry *entry)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (entry->ae_stat.aest_uid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -819,7 +819,7 @@ archive_entry_copy_fflags_text_w(struct archive_entry *entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-archive_entry_set_gid(struct archive_entry *entry, int64_t g)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_entry_set_gid(struct archive_entry *entry, la_int64_t g)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ entry->stat_valid = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ entry->ae_stat.aest_gid = g;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -868,7 +868,7 @@ _archive_entry_copy_gname_l(struct archive_entry *entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-archive_entry_set_ino(struct archive_entry *entry, int64_t ino)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_entry_set_ino(struct archive_entry *entry, la_int64_t ino)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ entry->stat_valid = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ entry->ae_set |= AE_SET_INO;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -876,7 +876,7 @@ archive_entry_set_ino(struct archive_entry *entry, int64_t ino)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-archive_entry_set_ino64(struct archive_entry *entry, int64_t ino)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_entry_set_ino64(struct archive_entry *entry, la_int64_t ino)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ entry->stat_valid = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ entry->ae_set |= AE_SET_INO;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1209,7 +1209,7 @@ archive_entry_set_rdevminor(struct archive_entry *entry, dev_t m)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-archive_entry_set_size(struct archive_entry *entry, int64_t s)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_entry_set_size(struct archive_entry *entry, la_int64_t s)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ entry->stat_valid = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ entry->ae_stat.aest_size = s;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1306,7 +1306,7 @@ _archive_entry_copy_symlink_l(struct archive_entry *entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-archive_entry_set_uid(struct archive_entry *entry, int64_t u)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_entry_set_uid(struct archive_entry *entry, la_int64_t u)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ entry->stat_valid = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ entry->ae_stat.aest_uid = u;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_entry.h b/libarchive/archive_entry.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 7645f0cf..bcc2962b 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_entry.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_entry.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -30,7 +30,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define ARCHIVE_ENTRY_H_INCLUDED
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Note: Compiler will complain if this does not match archive.h! */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define ARCHIVE_VERSION_NUMBER 3003001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define ARCHIVE_VERSION_NUMBER 3003002
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Note: archive_entry.h is for use outside of libarchive; the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_entry_acl.3 b/libarchive/archive_entry_acl.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index c5115f72..534dbfac 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_entry_acl.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_entry_acl.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -32,7 +32,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_acl_clear ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_acl_count ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_acl_from_text ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_entry_acl_from_text_w,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Nm archive_entry_acl_from_text_w ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_acl_next ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_acl_next_w ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_acl_reset ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -267,7 +267,7 @@ Only inherit, do not apply the permission on the directory itself.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .It Dv ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT ( Sy n )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Do not propagate inherit flags. Only first-level entries inherit ACLs.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .It Dv ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS ( Sy S )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-Trigger alarm or audit on succesful access.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++Trigger alarm or audit on successful access.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .It Dv ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS ( Sy F )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Trigger alarm or audit on failed access.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .It Dv ARCHIVE_ENTRY_ACL_ENTRY_INHERITED ( Sy I )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -279,7 +279,7 @@ and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Fn archive_entry_acl_add_entry_w
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add a single ACL entry.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ For the access ACL and non-extended principals, the classic Unix permissions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-are updated. An archive enry cannot contain both POSIX.1e and NFSv4 ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++are updated. An archive entry cannot contain both POSIX.1e and NFSv4 ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ entries.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Pp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Fn archive_entry_acl_clear
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -303,7 +303,7 @@ for POSIX.1e ACLs and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for NFSv4 ACLs. For POSIX.1e ACLs if
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Dv ARCHIVE_ENTRY_ACL_TYPE_ACCESS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ is included and at least one extended ACL entry is found,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-the three non-extened ACLs are added.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++the three non-extended ACLs are added.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Pp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Fn archive_entry_acl_from_text
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -367,7 +367,7 @@ and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Fn archive_entry_acl_to_text_w
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ convert the ACL entries for the given type into a
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Pq wide
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-string of ACL entries separated by newline. If the the pointer
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++string of ACL entries separated by newline. If the pointer
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Fa len_p
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ is not NULL, then the function shall return the length of the string
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Pq not including the NULL terminator
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_entry_paths.3 b/libarchive/archive_entry_paths.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index fd22cf7e..f647212a 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_entry_paths.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_entry_paths.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -31,25 +31,25 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_set_hardlink ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_copy_hardlink ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_copy_hardlink_w ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archve_entry_update_hardlink_utf8 ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Nm archive_entry_update_hardlink_utf8 ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_set_link ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_copy_link ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_copy_link_w ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archve_entry_update_link_utf8 ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Nm archive_entry_update_link_utf8 ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_pathname ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_pathname_w ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_set_pathname ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_copy_pathname ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_copy_pathname_w ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archve_entry_update_pathname_utf8 ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Nm archive_entry_update_pathname_utf8 ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_sourcepath ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_copy_sourcepath ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_entry_symlink,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_entry_symlink_w,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Nm archive_entry_symlink ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Nm archive_entry_symlink_w ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_set_symlink ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_copy_symlink ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_copy_symlink_w ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archve_entry_update_symlink_utf8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Nm archive_entry_update_symlink_utf8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nd functions for manipulating path names in archive entry descriptions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Sh LIBRARY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Streaming Archive Library (libarchive, -larchive)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_entry_perms.3 b/libarchive/archive_entry_perms.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 340c5ea7..aae3648b 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_entry_perms.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_entry_perms.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -34,8 +34,8 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_perm ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_set_perm ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_strmode ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_entry_uname
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_entry_uname_w
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Nm archive_entry_uname ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Nm archive_entry_uname_w ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_set_uname ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_copy_uname ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_entry_copy_uname_w ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_platform.h b/libarchive/archive_platform.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index c9a96020..34be8eda 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_platform.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_platform.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -143,32 +143,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * If this platform has <sys/acl.h>, acl_create(), acl_init(),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * acl_set_file(), and ACL_USER, we assume it has the rest of the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * POSIX.1e draft functions used in archive_read_extract.c.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SYS_ACL_H && HAVE_ACL_CREATE_ENTRY && HAVE_ACL_INIT && HAVE_ACL_SET_FILE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_USER
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define HAVE_POSIX_ACL 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_ACL_TYPE_EXTENDED
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define HAVE_DARWIN_ACL 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * If this platform has <sys/acl.h>, acl_get(), facl_get(), acl_set(),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * facl_set() and types aclent_t and ace_t it uses Solaris-style ACL functions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SYS_ACL_H && HAVE_ACL_GET && HAVE_FACL_GET && HAVE_ACL_SET && HAVE_FACL_SET && HAVE_ACLENT_T && HAVE_ACE_T
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define HAVE_SUN_ACL 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/* Define if platform supports NFSv4 ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if (HAVE_POSIX_ACL && HAVE_ACL_TYPE_NFS4) || HAVE_SUN_ACL || HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define HAVE_NFS4_ACL 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * If we can't restore metadata using a file descriptor, then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * for compatibility's sake, close files before trying to restore metadata.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_platform_acl.h b/libarchive/archive_platform_acl.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 00000000..3498f78b
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_platform_acl.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,49 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2017 Martin Matuska
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * $FreeBSD$
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* !!ONLY FOR USE INTERNALLY TO LIBARCHIVE!! */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifndef ARCHIVE_PLATFORM_ACL_H_INCLUDED
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define ARCHIVE_PLATFORM_ACL_H_INCLUDED
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Determine what ACL types are supported
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_SUNOS || ARCHIVE_ACL_LIBACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define ARCHIVE_ACL_POSIX1E 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD_NFS4 || ARCHIVE_ACL_SUNOS_NFS4 || \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ACL_DARWIN || ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define ARCHIVE_ACL_NFS4 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_POSIX1E || ARCHIVE_ACL_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define ARCHIVE_ACL_SUPPORT 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_PLATFORM_ACL_H_INCLUDED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_random.c b/libarchive/archive_random.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 357f9733..65ea6915 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_random.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_random.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -221,8 +221,11 @@ arc4_stir(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Discard early keystream, as per recommendations in:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * "(Not So) Random Shuffles of RC4" by Ilya Mironov.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * As per the Network Operations Division, cryptographic requirements
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * published on wikileaks on March 2017.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i = 0; i < 1024; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < 3072; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)arc4_getbyte();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ arc4_count = 1600000;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_read_disk.3 b/libarchive/archive_read_disk.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 2a5c1305..55e4bbbd 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_read_disk.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_read_disk.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -37,10 +37,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_read_disk_uname ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_read_disk_set_uname_lookup ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_read_disk_set_gname_lookup ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_read_disk_set_standard_lookup ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_read_close ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_read_finish ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_read_free
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Nm archive_read_disk_set_standard_lookup
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nd functions for reading objects from disk
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Sh LIBRARY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Streaming Archive Library (libarchive, -larchive)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -81,12 +78,6 @@ Streaming Archive Library (libarchive, -larchive)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Fa "int fd"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Fa "const struct stat *"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Fc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Ft int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fn archive_read_close "struct archive *"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Ft int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fn archive_read_finish "struct archive *"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Ft int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fn archive_read_free "struct archive *"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Sh DESCRIPTION
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ These functions provide an API for reading information about
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ objects on disk.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -181,17 +172,6 @@ using the currently registered lookup functions above.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ This affects the file ownership fields and ACL values in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Tn struct archive_entry
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ object.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.It Fn archive_read_close
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-Does nothing for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Tn archive_read_disk
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-handles.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.It Fn archive_read_finish
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-This is a deprecated synonym for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fn archive_read_free .
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.It Fn archive_read_free
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-Invokes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fn archive_read_close
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-if it was not invoked manually, then releases all resources.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .El
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ More information about the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Va struct archive
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_read_disk_acl_darwin.c b/libarchive/archive_read_disk_acl_darwin.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 00000000..8de33b91
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_read_disk_acl_darwin.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,337 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2017 Martin Matuska
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_platform.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_FCNTL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <fcntl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_ERRNO_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <errno.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_MEMBERSHIP_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <membership.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define _ACL_PRIVATE /* For debugging */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_entry.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_read_disk_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_acl_maps.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Darwin-specific ACL functions and helper functions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Exported functions:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * none
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int translate_guid(struct archive *a, acl_entry_t acl_entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int *ae_id, int *ae_tag, const char **ae_name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ void *q;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ uid_t ugid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int r, idtype;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ q = acl_get_qualifier(acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (q == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = mbr_uuid_to_id((const unsigned char *)q, &ugid, &idtype);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(q);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (idtype == ID_TYPE_UID) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *ae_tag = ARCHIVE_ENTRY_ACL_USER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *ae_id = ugid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *ae_name = archive_read_disk_uname(a, *ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if (idtype == ID_TYPE_GID) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *ae_id = ugid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *ae_name = archive_read_disk_gname(a, *ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(q);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (r);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Add trivial NFSv4 ACL entries from mode
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++add_trivial_nfs4_acl(struct archive_entry *entry)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mode_t mode;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const int rperm = ARCHIVE_ENTRY_ACL_READ_DATA;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const int wperm = ARCHIVE_ENTRY_ACL_WRITE_DATA |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_APPEND_DATA;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const int eperm = ARCHIVE_ENTRY_ACL_EXECUTE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const int pubset = ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_READ_ACL |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const int ownset = pubset | ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_WRITE_ACL |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_WRITE_OWNER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const int type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const int tag;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int permset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } tacl_entry[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_USER_OBJ, 0},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_USER_OBJ, 0},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_USER_OBJ, ownset},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_GROUP_OBJ, pubset},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EVERYONE, pubset}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mode = archive_entry_mode(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Permissions for everyone@ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0004)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[5].permset |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0002)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[5].permset |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0001)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[5].permset |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Permissions for group@ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0040)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[4].permset |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if (mode & 0004)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[2].permset |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0020)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[4].permset |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if (mode & 0002)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[2].permset |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0010)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[4].permset |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if (mode & 0001)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[2].permset |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Permissions for owner@ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0400) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[3].permset |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!(mode & 0040) && (mode & 0004))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[0].permset |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if ((mode & 0040) || (mode & 0004))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[1].permset |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0200) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[3].permset |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!(mode & 0020) && (mode & 0002))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[0].permset |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if ((mode & 0020) || (mode & 0002))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[1].permset |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0100) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[3].permset |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!(mode & 0010) && (mode & 0001))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[0].permset |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if ((mode & 0010) || (mode & 0001))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[1].permset |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < 6; i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (tacl_entry[i].permset != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_entry_acl_add_entry(entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[i].type, tacl_entry[i].permset,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tacl_entry[i].tag, -1, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++translate_acl(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_entry *entry, acl_t acl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_tag_t acl_tag;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_flagset_t acl_flagset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_entry_t acl_entry;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_permset_t acl_permset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int i, entry_acl_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int r, s, ae_id, ae_tag, ae_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *ae_name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (s == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get first ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (s == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_name = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_get_tag_type(acl_entry, &acl_tag) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get ACL tag type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (acl_tag) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_EXTENDED_ALLOW:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = translate_guid(&a->archive, acl_entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &ae_id, &ae_tag, &ae_name);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_EXTENDED_DENY:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = translate_guid(&a->archive, acl_entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &ae_id, &ae_tag, &ae_name);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Skip types that libarchive can't support. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Skip if translate_guid() above failed */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Libarchive stores "flag" (NFSv4 inheritance bits)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * in the ae_perm bitmap.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * acl_get_flagset_np() fails with non-NFSv4 ACLs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get flagset from a NFSv4 ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_get_flag_np(acl_flagset,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_nfs4_flag_map[i].p_perm);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to check flag in a NFSv4 "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "ACL flagset");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if (r)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm |= acl_nfs4_flag_map[i].a_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get ACL permission set");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < acl_nfs4_perm_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * acl_get_perm() is spelled differently on different
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * platforms; see above.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_get_perm_np(acl_permset,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_nfs4_perm_map[i].p_perm);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to check permission in an ACL "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "permission set");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if (r)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm |= acl_nfs4_perm_map[i].a_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !HAVE_DECL_ACL_SYNCHRONIZE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* On Mac OS X without ACL_SYNCHRONIZE assume it is set */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm |= ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_entry_acl_add_entry(entry, entry_acl_type,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm, ae_tag,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id, ae_name);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_read_disk_entry_setup_acls(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_entry *entry, int *fd)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *accpath;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_t acl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int r;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ accpath = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (*fd < 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ accpath = archive_read_disk_entry_setup_path(a, entry, fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (accpath == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_entry_acl_clear(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (*fd >= 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_get_fd_np(*fd, ACL_TYPE_EXTENDED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if (!a->follow_symlinks)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_get_link_np(accpath, ACL_TYPE_EXTENDED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_get_file(accpath, ACL_TYPE_EXTENDED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = translate_acl(a, entry, acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r != ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Couldn't translate NFSv4 ACLs");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Because Mac OS doesn't support owner@, group@ and everyone@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * ACLs we need to add NFSv4 ACLs mirroring the file mode to
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * the archive entry. Otherwise extraction on non-Mac platforms
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * would lead to an invalid file mode.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((archive_entry_acl_types(entry) &
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ add_trivial_nfs4_acl(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (r);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_read_disk_acl_freebsd.c b/libarchive/archive_read_disk_acl_freebsd.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 00000000..c09c3e1c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_read_disk_acl_freebsd.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,371 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2003-2009 Tim Kientzle
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2010-2012 Michihiro NAKAJIMA
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2016-2017 Martin Matuska
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_platform.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_ERRNO_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <errno.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_FCNTL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <fcntl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define _ACL_PRIVATE /* For debugging */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_entry.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_read_disk_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_acl_maps.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Translate FreeBSD ACLs into libarchive internal structure
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++translate_acl(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_entry *entry, acl_t acl, int default_entry_acl_type)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int brand;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_flagset_t acl_flagset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_tag_t acl_tag;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_entry_t acl_entry;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_permset_t acl_permset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_entry_type_t acl_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int i, entry_acl_type, perm_map_size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const acl_perm_map_t *perm_map;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int r, s, ae_id, ae_tag, ae_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ void *q;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *ae_name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // FreeBSD "brands" ACLs as POSIX.1e or NFSv4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Make sure the "brand" on this ACL is consistent
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // with the default_entry_acl_type bits provided.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_get_brand_np(acl, &brand) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to read ACL brand");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (brand) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_BRAND_POSIX:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (default_entry_acl_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Invalid ACL entry type for POSIX.1e ACL");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_BRAND_NFS4:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (default_entry_acl_type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Invalid ACL entry type for NFSv4 ACL");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Unknown ACL brand");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (s == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get first ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (s == 1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_name = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_get_tag_type(acl_entry, &acl_tag) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get ACL tag type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (acl_tag) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_USER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ q = acl_get_qualifier(acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (q != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id = (int)*(uid_t *)q;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(q);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_name = archive_read_disk_uname(&a->archive,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_USER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ q = acl_get_qualifier(acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (q != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id = (int)*(gid_t *)q;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(q);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_name = archive_read_disk_gname(&a->archive,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_MASK:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_MASK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_OTHER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_EVERYONE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Skip types that libarchive can't support. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // XXX acl_type maps to allow/deny/audit/YYYY bits
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entry_acl_type = default_entry_acl_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * acl_get_entry_type_np() fails with non-NFSv4 ACLs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_get_entry_type_np(acl_entry, &acl_type) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno, "Failed "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "to get ACL type from a NFSv4 ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (acl_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_ENTRY_TYPE_ALLOW:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_ENTRY_TYPE_DENY:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_ENTRY_TYPE_AUDIT:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_ENTRY_TYPE_ALARM:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Invalid NFSv4 ACL entry type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Libarchive stores "flag" (NFSv4 inheritance bits)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * in the ae_perm bitmap.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * acl_get_flagset_np() fails with non-NFSv4 ACLs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get flagset from a NFSv4 "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_get_flag_np(acl_flagset,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_nfs4_flag_map[i].p_perm);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to check flag in a NFSv4 "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "ACL flagset");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if (r)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm |= acl_nfs4_flag_map[i].a_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get ACL permission set");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_map_size = acl_nfs4_perm_map_size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_map = acl_nfs4_perm_map;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_map_size = acl_posix_perm_map_size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_map = acl_posix_perm_map;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < perm_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_get_perm_np(acl_permset, perm_map[i].p_perm);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to check permission in an ACL "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "permission set");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if (r)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm |= perm_map[i].a_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_entry_acl_add_entry(entry, entry_acl_type,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm, ae_tag,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id, ae_name);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (s == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get next ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_read_disk_entry_setup_acls(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_entry *entry, int *fd)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *accpath;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_t acl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int r;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ accpath = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (*fd < 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ accpath = archive_read_disk_entry_setup_path(a, entry, fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (accpath == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_entry_acl_clear(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Try NFSv4 ACL first. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (*fd >= 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_get_fd_np(*fd, ACL_TYPE_NFS4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if (!a->follow_symlinks)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_get_link_np(accpath, ACL_TYPE_NFS4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_get_file(accpath, ACL_TYPE_NFS4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Ignore "trivial" ACLs that just mirror the file mode. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl != NULL && acl_is_trivial_np(acl, &r) == 0 && r == 1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r != ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Couldn't translate NFSv4 ACLs");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (r);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Retrieve access ACL from file. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (*fd >= 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_get_fd_np(*fd, ACL_TYPE_ACCESS);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_ACL_GET_LINK_NP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if (!a->follow_symlinks)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_get_link_np(accpath, ACL_TYPE_ACCESS);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if ((!a->follow_symlinks)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ && (archive_entry_filetype(entry) == AE_IFLNK))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* We can't get the ACL of a symlink, so we assume it can't
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ have one. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_get_file(accpath, ACL_TYPE_ACCESS);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_ACL_IS_TRIVIAL_NP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Ignore "trivial" ACLs that just mirror the file mode. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl != NULL && acl_is_trivial_np(acl, &r) == 0 && r == 1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r != ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Couldn't translate access ACLs");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (r);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Only directories can have default ACLs. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (S_ISDIR(archive_entry_mode(entry))) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (*fd >= 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_get_fd_np(*fd, ACL_TYPE_DEFAULT);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_get_file(accpath, ACL_TYPE_DEFAULT);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = translate_acl(a, entry, acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r != ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Couldn't translate default ACLs");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (r);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_read_disk_acl_linux.c b/libarchive/archive_read_disk_acl_linux.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 00000000..033e68a1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_read_disk_acl_linux.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,352 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2003-2009 Tim Kientzle
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2010-2012 Michihiro NAKAJIMA
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2016-2017 Martin Matuska
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_platform.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_ERRNO_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <errno.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_FCNTL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <fcntl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_ACL_LIBACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <acl/libacl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_SYS_RICHACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/richacl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_entry.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_read_disk_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_acl_maps.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_LIBACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <acl/libacl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Translate POSIX.1e ACLs into libarchive internal structure
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++translate_acl(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_entry *entry, acl_t acl, int default_entry_acl_type)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_tag_t acl_tag;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_entry_t acl_entry;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_permset_t acl_permset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int i, entry_acl_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int r, s, ae_id, ae_tag, ae_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ void *q;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *ae_name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (s == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get first ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (s == 1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_name = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_get_tag_type(acl_entry, &acl_tag) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get ACL tag type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (acl_tag) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_USER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ q = acl_get_qualifier(acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (q != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id = (int)*(uid_t *)q;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(q);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_name = archive_read_disk_uname(&a->archive,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_USER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ q = acl_get_qualifier(acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (q != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id = (int)*(gid_t *)q;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(q);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_name = archive_read_disk_gname(&a->archive,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_MASK:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_MASK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACL_OTHER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Skip types that libarchive can't support. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // XXX acl_type maps to allow/deny/audit/YYYY bits
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entry_acl_type = default_entry_acl_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get ACL permission set");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < acl_posix_perm_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_get_perm(acl_permset,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_posix_perm_map[i].p_perm);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to check permission in an ACL "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "permission set");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if (r)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm |= acl_posix_perm_map[i].a_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_entry_acl_add_entry(entry, entry_acl_type,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm, ae_tag,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id, ae_name);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (s == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get next ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_LIBACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Translate RichACL into libarchive internal ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++translate_richacl(struct archive_read_disk *a, struct archive_entry *entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct richacl *richacl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ae_id, ae_tag, ae_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int entry_acl_type, i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *ae_name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct richace *richace;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl_for_each_entry(richace, richacl) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_name = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (richace->e_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case RICHACE_ACCESS_ALLOWED_ACE_TYPE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case RICHACE_ACCESS_DENIED_ACE_TYPE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default: /* Unknown entry type, skip */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Unsupported */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (richace->e_flags & RICHACE_UNMAPPED_WHO)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (richace->e_flags & RICHACE_SPECIAL_WHO) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (richace->e_id) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case RICHACE_OWNER_SPECIAL_ID:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case RICHACE_GROUP_SPECIAL_ID:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case RICHACE_EVERYONE_SPECIAL_ID:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default: /* Unknown special ID type */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id = richace->e_id;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (richace->e_flags & RICHACE_IDENTIFIER_GROUP) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_name = archive_read_disk_gname(&a->archive,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (gid_t)(richace->e_id));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_USER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_name = archive_read_disk_uname(&a->archive,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (uid_t)(richace->e_id));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((richace->e_flags &
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_nfs4_flag_map[i].p_perm) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm |= acl_nfs4_flag_map[i].a_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < acl_nfs4_perm_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((richace->e_mask &
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_nfs4_perm_map[i].p_perm) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm |=
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_nfs4_perm_map[i].a_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_entry_acl_add_entry(entry, entry_acl_type,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm, ae_tag, ae_id, ae_name);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_LIBRICHACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_read_disk_entry_setup_acls(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_entry *entry, int *fd)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *accpath;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int r;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_t acl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct richacl *richacl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mode_t mode;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ accpath = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* For default ACLs we need reachable accpath */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (*fd < 0 || S_ISDIR(archive_entry_mode(entry))) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ accpath = archive_read_disk_entry_setup_path(a, entry, fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (accpath == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_entry_acl_clear(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Try NFSv4 ACL first. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (*fd >= 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl = richacl_get_fd(*fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if ((!a->follow_symlinks)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ && (archive_entry_filetype(entry) == AE_IFLNK))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* We can't get the ACL of a symlink, so we assume it can't
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ have one */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl = richacl_get_file(accpath);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Ignore "trivial" ACLs that just mirror the file mode. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (richacl != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mode = archive_entry_mode(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (richacl_equiv_mode(richacl, &mode) == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl_free(richacl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (richacl != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = translate_richacl(a, entry, richacl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl_free(richacl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r != ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Couldn't translate NFSv4 ACLs");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (r);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_LIBRICHACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Retrieve access ACL from file. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (*fd >= 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_get_fd(*fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if ((!a->follow_symlinks)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ && (archive_entry_filetype(entry) == AE_IFLNK))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* We can't get the ACL of a symlink, so we assume it can't
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ have one. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_get_file(accpath, ACL_TYPE_ACCESS);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r != ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Couldn't translate access ACLs");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (r);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Only directories can have default ACLs. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (S_ISDIR(archive_entry_mode(entry))) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_get_file(accpath, ACL_TYPE_DEFAULT);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = translate_acl(a, entry, acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r != ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Couldn't translate default ACLs");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (r);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_LIBACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (r);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_read_disk_acl_sunos.c b/libarchive/archive_read_disk_acl_sunos.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 00000000..066c3037
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_read_disk_acl_sunos.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,482 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2017 Martin Matuska
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_platform.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_ERRNO_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <errno.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_FCNTL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <fcntl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_entry.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_read_disk_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_acl_maps.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Solaris-specific ACL functions and helper functions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Exported functions:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * translate_acl()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++sunacl_get(int cmd, int *aclcnt, int fd, const char *path)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int cnt, cntcmd;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ size_t size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ void *aclp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (cmd == GETACL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cntcmd = GETACLCNT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ size = sizeof(aclent_t);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if (cmd == ACE_GETACL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cntcmd = ACE_GETACLCNT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ size = sizeof(ace_t);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ errno = EINVAL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *aclcnt = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cnt = -2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (cnt == -2 || (cnt == -1 && errno == ENOSPC)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (path != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cnt = acl(path, cntcmd, 0, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cnt = facl(fd, cntcmd, 0, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (cnt > 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclp == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = malloc(cnt * size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = realloc(NULL, cnt * size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclp != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (path != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cnt = acl(path, cmd, cnt, aclp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cnt = facl(fd, cmd, cnt, aclp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclp != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ free(aclp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *aclcnt = cnt;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (aclp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Check if acl is trivial
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * This is a FreeBSD acl_is_trivial_np() implementation for Solaris
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++sun_acl_is_trivial(void *aclp, int aclcnt, mode_t mode, int is_nfs4,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int is_dir, int *trivialp)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int i, p;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const uint32_t rperm = ACE_READ_DATA;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const uint32_t wperm = ACE_WRITE_DATA | ACE_APPEND_DATA;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const uint32_t eperm = ACE_EXECUTE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const uint32_t pubset = ACE_READ_ATTRIBUTES | ACE_READ_NAMED_ATTRS |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACE_READ_ACL | ACE_SYNCHRONIZE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const uint32_t ownset = pubset | ACE_WRITE_ATTRIBUTES |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACE_WRITE_NAMED_ATTRS | ACE_WRITE_ACL | ACE_WRITE_OWNER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace_t *ace;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace_t tace[6];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclp == NULL || trivialp == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *trivialp = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * POSIX.1e ACLs marked with ACL_IS_TRIVIAL are compatible with
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * FreeBSD acl_is_trivial_np(). On Solaris they have 4 entries,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * including mask.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!is_nfs4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclcnt == 4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *trivialp = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Continue with checking NFSv4 ACLs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Create list of trivial ace's to be compared
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* owner@ allow pre */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[0].a_flags = ACE_OWNER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[0].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[0].a_access_mask = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* owner@ deny */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[1].a_flags = ACE_OWNER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[1].a_type = ACE_ACCESS_DENIED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[1].a_access_mask = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* group@ deny */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[2].a_flags = ACE_GROUP | ACE_IDENTIFIER_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[2].a_type = ACE_ACCESS_DENIED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[2].a_access_mask = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* owner@ allow */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[3].a_flags = ACE_OWNER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[3].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[3].a_access_mask = ownset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* group@ allow */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[4].a_flags = ACE_GROUP | ACE_IDENTIFIER_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[4].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[4].a_access_mask = pubset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* everyone@ allow */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[5].a_flags = ACE_EVERYONE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[5].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[5].a_access_mask = pubset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Permissions for everyone@ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0004)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[5].a_access_mask |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0002)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[5].a_access_mask |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0001)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[5].a_access_mask |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Permissions for group@ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0040)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[4].a_access_mask |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if (mode & 0004)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[2].a_access_mask |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0020)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[4].a_access_mask |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if (mode & 0002)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[2].a_access_mask |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0010)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[4].a_access_mask |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if (mode & 0001)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[2].a_access_mask |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Permissions for owner@ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0400) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[3].a_access_mask |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!(mode & 0040) && (mode & 0004))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[0].a_access_mask |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if ((mode & 0040) || (mode & 0004))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[1].a_access_mask |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0200) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[3].a_access_mask |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!(mode & 0020) && (mode & 0002))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[0].a_access_mask |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if ((mode & 0020) || (mode & 0002))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[1].a_access_mask |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & 0100) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[3].a_access_mask |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!(mode & 0010) && (mode & 0001))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[0].a_access_mask |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if ((mode & 0010) || (mode & 0001))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tace[1].a_access_mask |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Check if the acl count matches */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ p = 3;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < 3; i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (tace[i].a_access_mask != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ p++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclcnt != p)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ p = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < 6; i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (tace[i].a_access_mask != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace = &((ace_t *)aclp)[p];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Illumos added ACE_DELETE_CHILD to write perms for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * directories. We have to check against that, too.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ace->a_flags != tace[i].a_flags ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_type != tace[i].a_type ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (ace->a_access_mask != tace[i].a_access_mask &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (!is_dir || (tace[i].a_access_mask & wperm) == 0 ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_access_mask !=
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (tace[i].a_access_mask | ACE_DELETE_CHILD))))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ p++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *trivialp = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else /* !ARCHIVE_ACL_SUNOS_NFS4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)is_dir; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)aclp; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* !ARCHIVE_ACL_SUNOS_NFS4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Translate Solaris POSIX.1e and NFSv4 ACLs into libarchive internal ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++translate_acl(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_entry *entry, void *aclp, int aclcnt,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int default_entry_acl_type)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int e, i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ae_id, ae_tag, ae_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int entry_acl_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *ae_name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent_t *aclent;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace_t *ace;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclcnt <= 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (e = 0; e < aclcnt; e++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_name = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (default_entry_acl_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace = &((ace_t *)aclp)[e];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id = ace->a_who;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch(ace->a_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACE_ACCESS_ALLOWED_ACE_TYPE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACE_ACCESS_DENIED_ACE_TYPE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACE_SYSTEM_AUDIT_ACE_TYPE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ACE_SYSTEM_ALARM_ACE_TYPE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Unknown entry type, skip */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((ace->a_flags & ACE_OWNER) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if ((ace->a_flags & ACE_GROUP) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if ((ace->a_flags & ACE_EVERYONE) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if ((ace->a_flags & ACE_IDENTIFIER_GROUP) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_name = archive_read_disk_gname(&a->archive,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_USER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_name = archive_read_disk_uname(&a->archive,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((ace->a_flags &
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_nfs4_flag_map[i].p_perm) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm |= acl_nfs4_flag_map[i].a_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < acl_nfs4_perm_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((ace->a_access_mask &
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_nfs4_perm_map[i].p_perm) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm |= acl_nfs4_perm_map[i].a_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_SUNOS_NFS4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (default_entry_acl_type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent = &((aclent_t *)aclp)[e];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((aclent->a_type & ACL_DEFAULT) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id = aclent->a_id;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch(aclent->a_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case DEF_USER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case USER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_name = archive_read_disk_uname(&a->archive,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_USER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case DEF_GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_name = archive_read_disk_gname(&a->archive,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case DEF_CLASS_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case CLASS_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_MASK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case DEF_USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case DEF_GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case DEF_OTHER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case OTHER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Unknown tag type, skip */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < acl_posix_perm_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((aclent->a_perm &
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_posix_perm_map[i].p_perm) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm |= acl_posix_perm_map[i].a_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_entry_acl_add_entry(entry, entry_acl_type,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_perm, ae_tag, ae_id, ae_name);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_read_disk_entry_setup_acls(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_entry *entry, int *fd)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *accpath;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ void *aclp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int aclcnt;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int r;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ accpath = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (*fd < 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ accpath = archive_read_disk_entry_setup_path(a, entry, fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (accpath == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_entry_acl_clear(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (*fd >= 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = sunacl_get(ACE_GETACL, &aclcnt, *fd, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if ((!a->follow_symlinks)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ && (archive_entry_filetype(entry) == AE_IFLNK))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* We can't get the ACL of a symlink, so we assume it can't
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ have one. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = sunacl_get(ACE_GETACL, &aclcnt, 0, accpath);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclp != NULL && sun_acl_is_trivial(aclp, aclcnt,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_entry_mode(entry), 1, S_ISDIR(archive_entry_mode(entry)),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &r) == 0 && r == 1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ free(aclp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclp != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = translate_acl(a, entry, aclp, aclcnt,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_NFS4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ free(aclp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r != ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Couldn't translate NFSv4 ACLs");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (r);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_SUNOS_NFS4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Retrieve POSIX.1e ACLs from file. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (*fd >= 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = sunacl_get(GETACL, &aclcnt, *fd, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if ((!a->follow_symlinks)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ && (archive_entry_filetype(entry) == AE_IFLNK))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* We can't get the ACL of a symlink, so we assume it can't
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ have one. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = sunacl_get(GETACL, &aclcnt, 0, accpath);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Ignore "trivial" ACLs that just mirror the file mode. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclp != NULL && sun_acl_is_trivial(aclp, aclcnt,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_entry_mode(entry), 0, S_ISDIR(archive_entry_mode(entry)),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &r) == 0 && r == 1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ free(aclp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclp != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = translate_acl(a, entry, aclp, aclcnt,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ free(aclp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r != ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Couldn't translate access ACLs");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (r);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_read_disk_entry_from_file.c b/libarchive/archive_read_disk_entry_from_file.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index b2f1d17d..154dd0f6 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_read_disk_entry_from_file.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_read_disk_entry_from_file.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -26,23 +26,14 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "archive_platform.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_disk_entry_from_file.c 201084 2009-12-28 02:14:09Z kientzle $");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++__FBSDID("$FreeBSD");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* This is the tree-walking code for POSIX systems. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if !defined(_WIN32) || defined(__CYGWIN__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/* Mac OSX requires sys/types.h before sys/acl.h. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <membership.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <grp.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <pwd.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef HAVE_SYS_EXTATTR_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <sys/extattr.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -63,9 +54,6 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_disk_entry_from_file.c 2010
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef HAVE_SYS_EA_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <sys/ea.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAVE_ACL_LIBACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <acl/libacl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef HAVE_COPYFILE_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <copyfile.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -113,27 +101,6 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_disk_entry_from_file.c 2010
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define O_CLOEXEC 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Linux and FreeBSD plug this obvious hole in POSIX.1e in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * different ways.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_GET_PERM
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define ACL_GET_PERM acl_get_perm
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_ACL_GET_PERM_NP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define ACL_GET_PERM acl_get_perm_np
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/* NFSv4 platform ACL type */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define ARCHIVE_PLATFORM_ACL_TYPE_NFS4 ACE_T
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define ARCHIVE_PLATFORM_ACL_TYPE_NFS4 ACL_TYPE_EXTENDED
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_ACL_TYPE_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define ARCHIVE_PLATFORM_ACL_TYPE_NFS4 ACL_TYPE_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static int setup_acls(struct archive_read_disk *,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- struct archive_entry *, int *fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int setup_mac_metadata(struct archive_read_disk *,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct archive_entry *, int *fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int setup_xattrs(struct archive_read_disk *,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -145,6 +112,45 @@ static int setup_sparse_fiemap(struct archive_read_disk *,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct archive_entry *, int *fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !ARCHIVE_ACL_SUPPORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_read_disk_entry_setup_acls(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_entry *entry, int *fd)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)a; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)entry; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)fd; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Enter working directory and return working pathname of archive_entry.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * If a pointer to an integer is provided and its value is below zero
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * open a file descriptor on this pahtname.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_read_disk_entry_setup_path(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_entry *entry, int *fd)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *path;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ path = archive_entry_sourcepath(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (path == NULL || (a->tree != NULL &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ a->tree_enter_working_dir(a->tree) != 0))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ path = archive_entry_pathname(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (path == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Couldn't determine path");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if (fd != NULL && *fd < 0 && a->tree != NULL &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (a->follow_symlinks || archive_entry_filetype(entry) != AE_IFLNK)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *fd = a->open_on_current_dir(a->tree, path,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ O_RDONLY | O_NONBLOCK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_read_disk_entry_from_file(struct archive *_a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct archive_entry *entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -279,7 +285,7 @@ archive_read_disk_entry_from_file(struct archive *_a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ r = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((a->flags & ARCHIVE_READDISK_NO_ACL) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = setup_acls(a, entry, &fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = archive_read_disk_entry_setup_acls(a, entry, &fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((a->flags & ARCHIVE_READDISK_NO_XATTR) == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ r1 = setup_xattrs(a, entry, &fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (r1 < r)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -328,19 +334,10 @@ setup_mac_metadata(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct archive_string tempfile;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)fd; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- name = archive_entry_sourcepath(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ name = archive_read_disk_entry_setup_path(a, entry, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (name == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- name = archive_entry_pathname(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if (a->tree != NULL && a->tree_enter_working_dir(a->tree) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Can't change dir to read extended attributes");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (name == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Can't open file to read extended attributes: No name");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Short-circuit if there's nothing to do. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ have_attrs = copyfile(name, NULL, 0, copyfile_flags | COPYFILE_CHECK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -426,990 +423,6 @@ setup_mac_metadata(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static int translate_guid(struct archive *, acl_entry_t,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int *, int *, const char **);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static void add_trivial_nfs4_acl(struct archive_entry *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-sun_acl_is_trivial(acl_t *, mode_t, int *trivialp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_POSIX_ACL || HAVE_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static int translate_acl(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- struct archive_entry *entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_t *acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_t acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int archive_entry_acl_type);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-setup_acls(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- struct archive_entry *entry, int *fd)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const char *accpath;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_t *acl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_t acl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int r;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- accpath = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL || HAVE_DARWIN_ACL || HAVE_ACL_GET_FD_NP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (*fd < 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* For default ACLs on Linux we need reachable accpath */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (*fd < 0 || S_ISDIR(archive_entry_mode(entry)))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- accpath = archive_entry_sourcepath(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (accpath == NULL || (a->tree != NULL &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- a->tree_enter_working_dir(a->tree) != 0))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- accpath = archive_entry_pathname(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (accpath == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Couldn't determine file path to read ACLs");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (a->tree != NULL &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_SUN_ACL && !HAVE_DARWIN_ACL && !HAVE_ACL_GET_FD_NP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *fd < 0 &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (a->follow_symlinks ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_entry_filetype(entry) != AE_IFLNK)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *fd = a->open_on_current_dir(a->tree,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- accpath, O_RDONLY | O_NONBLOCK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_entry_acl_clear(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Try NFSv4 ACL first. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (*fd >= 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Solaris reads both POSIX.1e and NFSv4 ACL here */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- facl_get(*fd, 0, &acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_ACL_GET_FD_NP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = acl_get_fd_np(*fd, ARCHIVE_PLATFORM_ACL_TYPE_NFS4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = acl_get_fd(*fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_GET_LINK_NP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if (!a->follow_symlinks)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = acl_get_link_np(accpath, ARCHIVE_PLATFORM_ACL_TYPE_NFS4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if ((!a->follow_symlinks)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- && (archive_entry_filetype(entry) == AE_IFLNK))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* We can't get the ACL of a symlink, so we assume it can't
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- have one. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Solaris reads both POSIX.1e and NFSv4 ACLs here */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_get(accpath, 0, &acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = acl_get_file(accpath, ARCHIVE_PLATFORM_ACL_TYPE_NFS4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_IS_TRIVIAL_NP || HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Ignore "trivial" ACLs that just mirror the file mode. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (sun_acl_is_trivial(acl, archive_entry_mode(entry),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- &r) == 0 && r == 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_ACL_IS_TRIVIAL_NP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_is_trivial_np(acl, &r) == 0 && r == 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Simultaneous NFSv4 and POSIX.1e ACLs for the same
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * entry are not allowed, so we should return here
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_ACL_IS_TRIVIAL_NP || HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (r != ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Couldn't translate "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "NFSv4 "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "ACLs");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Because Mac OS doesn't support owner@, group@ and everyone@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * ACLs we need to add NFSv4 ACLs mirroring the file mode to
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * the archive entry. Otherwise extraction on non-Mac platforms
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * would lead to an invalid file mode.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((archive_entry_acl_types(entry) &
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- add_trivial_nfs4_acl(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (r);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_NFS4_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_POSIX_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* This code path is skipped on MacOS and Solaris */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Retrieve access ACL from file. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (*fd >= 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = acl_get_fd(*fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_GET_LINK_NP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if (!a->follow_symlinks)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = acl_get_link_np(accpath, ACL_TYPE_ACCESS);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if ((!a->follow_symlinks)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- && (archive_entry_filetype(entry) == AE_IFLNK))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* We can't get the ACL of a symlink, so we assume it can't
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- have one. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = acl_get_file(accpath, ACL_TYPE_ACCESS);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_IS_TRIVIAL_NP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Ignore "trivial" ACLs that just mirror the file mode. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl != NULL && acl_is_trivial_np(acl, &r) == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (r) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (r != ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Couldn't translate access ACLs");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (r);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Only directories can have default ACLs. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (S_ISDIR(archive_entry_mode(entry))) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_GET_FD_NP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (*fd >= 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = acl_get_fd_np(*fd, ACL_TYPE_DEFAULT);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = acl_get_file(accpath, ACL_TYPE_DEFAULT);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = translate_acl(a, entry, acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (r != ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Couldn't translate default ACLs");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (r);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_POSIX_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Translate system ACL permissions into libarchive internal structure
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static const struct {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int archive_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int platform_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-} acl_perm_map[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL /* Solaris NFSv4 ACL permissions */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_EXECUTE, ACE_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_DATA, ACE_READ_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACE_LIST_DIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACE_WRITE_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ADD_FILE, ACE_ADD_FILE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACE_APPEND_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACE_ADD_SUBDIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACE_READ_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACE_WRITE_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACE_DELETE_CHILD},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACE_READ_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACE_WRITE_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_DELETE, ACE_DELETE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_ACL, ACE_READ_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACE_WRITE_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACE_WRITE_OWNER},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACE_SYNCHRONIZE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_DARWIN_ACL /* MacOS ACL permissions */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_EXTATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_EXTATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_SECURITY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_SECURITY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_CHANGE_OWNER},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* POSIX.1e ACL permissions */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ, ACL_READ},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_TYPE_NFS4 /* FreeBSD NFSv4 ACL permissions */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_SUN_ACL && !HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Translate system NFSv4 inheritance flags into libarchive internal structure
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static const struct {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int archive_inherit;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int platform_inherit;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-} acl_inherit_map[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL /* Solaris ACL inheritance flags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACE_FILE_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACE_DIRECTORY_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACE_NO_PROPAGATE_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACE_INHERIT_ONLY_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACE_SUCCESSFUL_ACCESS_ACE_FLAG},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACE_FAILED_ACCESS_ACE_FLAG},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACE_INHERITED_ACE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_DARWIN_ACL /* MacOS NFSv4 inheritance flags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_LIMIT_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_ONLY_INHERIT}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* FreeBSD NFSv4 ACL inheritance flags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACL_ENTRY_SUCCESSFUL_ACCESS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACL_ENTRY_FAILED_ACCESS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_SUN_ACL && !HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_NFS4_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static int translate_guid(struct archive *a, acl_entry_t acl_entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int *ae_id, int *ae_tag, const char **ae_name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- void *q;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- uid_t ugid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int r, idtype;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- struct passwd *pwd;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- struct group *grp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- q = acl_get_qualifier(acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (q == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = mbr_uuid_to_id((const unsigned char *)q, &ugid, &idtype);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (r != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(q);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (idtype == ID_TYPE_UID) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *ae_tag = ARCHIVE_ENTRY_ACL_USER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pwd = getpwuuid(q);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (pwd == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *ae_id = ugid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *ae_name = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *ae_id = pwd->pw_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *ae_name = archive_read_disk_uname(a, *ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else if (idtype == ID_TYPE_GID) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- grp = getgruuid(q);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (grp == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *ae_id = ugid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *ae_name = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *ae_id = grp->gr_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *ae_name = archive_read_disk_gname(a, *ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(q);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (r);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Add trivial NFSv4 ACL entries from mode
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-add_trivial_nfs4_acl(struct archive_entry *entry)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mode_t mode;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int rperm = ARCHIVE_ENTRY_ACL_READ_DATA;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int wperm = ARCHIVE_ENTRY_ACL_WRITE_DATA |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ARCHIVE_ENTRY_ACL_APPEND_DATA;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int eperm = ARCHIVE_ENTRY_ACL_EXECUTE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int pubset = ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ARCHIVE_ENTRY_ACL_READ_ACL |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int ownset = pubset | ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ARCHIVE_ENTRY_ACL_WRITE_ACL |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ARCHIVE_ENTRY_ACL_WRITE_OWNER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- struct {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int tag;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int permset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } tacl_entry[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_USER_OBJ, 0},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_USER_OBJ, 0},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_USER_OBJ, ownset},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_GROUP_OBJ, pubset},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EVERYONE, pubset}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mode = archive_entry_mode(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Permissions for everyone@ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0004)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[5].permset |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0002)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[5].permset |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0001)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[5].permset |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Permissions for group@ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0040)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[4].permset |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if (mode & 0004)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[2].permset |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0020)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[4].permset |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if (mode & 0002)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[2].permset |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0010)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[4].permset |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if (mode & 0001)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[2].permset |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Permissions for owner@ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0400) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[3].permset |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!(mode & 0040) && (mode & 0004))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[0].permset |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else if ((mode & 0040) || (mode & 0004))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[1].permset |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0200) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[3].permset |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!(mode & 0020) && (mode & 0002))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[0].permset |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else if ((mode & 0020) || (mode & 0002))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[1].permset |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0100) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[3].permset |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!(mode & 0010) && (mode & 0001))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[0].permset |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else if ((mode & 0010) || (mode & 0001))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[1].permset |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i = 0; i < 6; i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (tacl_entry[i].permset != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_entry_acl_add_entry(entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[i].type, tacl_entry[i].permset,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tacl_entry[i].tag, -1, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Check if acl is trivial
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * This is a FreeBSD acl_is_trivial_np() implementation for Solaris
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-sun_acl_is_trivial(acl_t *acl, mode_t mode, int *trivialp)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int i, p;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const uint32_t rperm = ACE_READ_DATA;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const uint32_t wperm = ACE_WRITE_DATA | ACE_APPEND_DATA;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const uint32_t eperm = ACE_EXECUTE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const uint32_t pubset = ACE_READ_ATTRIBUTES | ACE_READ_NAMED_ATTRS |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ACE_READ_ACL | ACE_SYNCHRONIZE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const uint32_t ownset = pubset | ACE_WRITE_ATTRIBUTES |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ACE_WRITE_NAMED_ATTRS | ACE_WRITE_ACL | ACE_WRITE_OWNER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace_t *ace;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace_t tace[6];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl == NULL || trivialp == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *trivialp = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* ACL_IS_TRIVIAL flag must be set for both POSIX.1e and NFSv4 ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((acl->acl_flags & ACL_IS_TRIVIAL) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * POSIX.1e ACLs marked with ACL_IS_TRIVIAL are compatible with
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * FreeBSD acl_is_trivial_np(). On Solaris they have 4 entries,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * including mask.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl->acl_type == ACLENT_T) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl->acl_cnt == 4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *trivialp = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl->acl_type != ACE_T || acl->acl_entry_size != sizeof(ace_t))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Continue with checking NFSv4 ACLs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Create list of trivial ace's to be compared
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* owner@ allow pre */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[0].a_flags = ACE_OWNER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[0].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[0].a_access_mask = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* owner@ deny */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[1].a_flags = ACE_OWNER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[1].a_type = ACE_ACCESS_DENIED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[1].a_access_mask = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* group@ deny */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[2].a_flags = ACE_GROUP | ACE_IDENTIFIER_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[2].a_type = ACE_ACCESS_DENIED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[2].a_access_mask = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* owner@ allow */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[3].a_flags = ACE_OWNER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[3].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[3].a_access_mask = ownset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* group@ allow */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[4].a_flags = ACE_GROUP | ACE_IDENTIFIER_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[4].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[4].a_access_mask = pubset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* everyone@ allow */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[5].a_flags = ACE_EVERYONE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[5].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[5].a_access_mask = pubset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Permissions for everyone@ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0004)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[5].a_access_mask |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0002)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[5].a_access_mask |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0001)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[5].a_access_mask |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Permissions for group@ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0040)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[4].a_access_mask |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if (mode & 0004)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[2].a_access_mask |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0020)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[4].a_access_mask |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if (mode & 0002)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[2].a_access_mask |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0010)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[4].a_access_mask |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if (mode & 0001)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[2].a_access_mask |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Permissions for owner@ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0400) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[3].a_access_mask |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!(mode & 0040) && (mode & 0004))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[0].a_access_mask |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else if ((mode & 0040) || (mode & 0004))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[1].a_access_mask |= rperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0200) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[3].a_access_mask |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!(mode & 0020) && (mode & 0002))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[0].a_access_mask |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else if ((mode & 0020) || (mode & 0002))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[1].a_access_mask |= wperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mode & 0100) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[3].a_access_mask |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!(mode & 0010) && (mode & 0001))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[0].a_access_mask |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else if ((mode & 0010) || (mode & 0001))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tace[1].a_access_mask |= eperm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Check if the acl count matches */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- p = 3;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i = 0; i < 3; i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (tace[i].a_access_mask != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- p++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl->acl_cnt != p)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- p = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i = 0; i < 6; i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (tace[i].a_access_mask != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace = &((ace_t *)acl->acl_aclp)[p];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Illumos added ACE_DELETE_CHILD to write perms for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * directories. We have to check against that, too.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (ace->a_flags != tace[i].a_flags ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_type != tace[i].a_type ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (ace->a_access_mask != tace[i].a_access_mask &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ((acl->acl_flags & ACL_IS_DIR) == 0 ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (tace[i].a_access_mask & wperm) == 0 ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_access_mask !=
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (tace[i].a_access_mask | ACE_DELETE_CHILD))))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- p++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *trivialp = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Translate Solaris POSIX.1e and NFSv4 ACLs into libarchive internal ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-translate_acl(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- struct archive_entry *entry, acl_t *acl, int default_entry_acl_type)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int e, i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int ae_id, ae_tag, ae_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int entry_acl_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const char *ae_name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent_t *aclent;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace_t *ace;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (void)default_entry_acl_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl->acl_cnt <= 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (e = 0; e < acl->acl_cnt; e++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_name = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_perm = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl->acl_type == ACE_T) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace = &((ace_t *)acl->acl_aclp)[e];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_id = ace->a_who;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- switch(ace->a_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACE_ACCESS_ALLOWED_ACE_TYPE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACE_ACCESS_DENIED_ACE_TYPE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACE_SYSTEM_AUDIT_ACE_TYPE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACE_SYSTEM_ALARM_ACE_TYPE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Unknown entry type, skip */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((ace->a_flags & ACE_OWNER) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if ((ace->a_flags & ACE_GROUP) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if ((ace->a_flags & ACE_EVERYONE) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if ((ace->a_flags & ACE_IDENTIFIER_GROUP) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_name = archive_read_disk_gname(&a->archive,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_USER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_name = archive_read_disk_uname(&a->archive,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i = 0; i < (int)(sizeof(acl_inherit_map) /
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sizeof(acl_inherit_map[0])); ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((ace->a_flags &
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_inherit_map[i].platform_inherit) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_perm |=
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_inherit_map[i].archive_inherit;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i = 0; i < (int)(sizeof(acl_perm_map) /
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sizeof(acl_perm_map[0])); ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((ace->a_access_mask &
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_perm_map[i].platform_perm) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_perm |=
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_perm_map[i].archive_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent = &((aclent_t *)acl->acl_aclp)[e];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((aclent->a_type & ACL_DEFAULT) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_id = aclent->a_id;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- switch(aclent->a_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case DEF_USER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case USER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_name = archive_read_disk_uname(&a->archive,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_USER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case DEF_GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_name = archive_read_disk_gname(&a->archive,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case DEF_CLASS_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case CLASS_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_MASK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case DEF_USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case DEF_GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case DEF_OTHER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case OTHER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Unknown tag type, skip */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((aclent->a_perm & 1) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_perm |= ARCHIVE_ENTRY_ACL_EXECUTE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((aclent->a_perm & 2) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_perm |= ARCHIVE_ENTRY_ACL_WRITE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((aclent->a_perm & 4) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_perm |= ARCHIVE_ENTRY_ACL_READ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } /* default_entry_acl_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_entry_acl_add_entry(entry, entry_acl_type,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_perm, ae_tag, ae_id, ae_name);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Translate POSIX.1e (Linux), FreeBSD (both POSIX.1e and NFSv4) and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * MacOS (NFSv4 only) ACLs into libarchive internal structure
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-translate_acl(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- struct archive_entry *entry, acl_t acl, int default_entry_acl_type)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_tag_t acl_tag;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_TYPE_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_entry_type_t acl_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int brand;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_TYPE_NFS4 || HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_flagset_t acl_flagset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_entry_t acl_entry;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_permset_t acl_permset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int i, entry_acl_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int r, s, ae_id, ae_tag, ae_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- void *q;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const char *ae_name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_TYPE_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // FreeBSD "brands" ACLs as POSIX.1e or NFSv4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Make sure the "brand" on this ACL is consistent
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // with the default_entry_acl_type bits provided.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_get_brand_np(acl, &brand) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to read ACL brand");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- switch (brand) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACL_BRAND_POSIX:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- switch (default_entry_acl_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Invalid ACL entry type for POSIX.1e ACL");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACL_BRAND_NFS4:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (default_entry_acl_type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Invalid ACL entry type for NFSv4 ACL");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Unknown ACL brand");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (s == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to get first ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- while (s == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* FreeBSD, Linux */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- while (s == 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_id = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_name = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_perm = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_get_tag_type(acl_entry, &acl_tag) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to get ACL tag type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- switch (acl_tag) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_DARWIN_ACL /* FreeBSD, Linux */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACL_USER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- q = acl_get_qualifier(acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (q != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_id = (int)*(uid_t *)q;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(q);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_name = archive_read_disk_uname(&a->archive,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_USER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACL_GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- q = acl_get_qualifier(acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (q != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_id = (int)*(gid_t *)q;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(q);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_name = archive_read_disk_gname(&a->archive,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACL_MASK:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_MASK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACL_USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACL_GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACL_OTHER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_TYPE_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACL_EVERYONE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACL_EXTENDED_ALLOW:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = translate_guid(&a->archive, acl_entry, &ae_id,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- &ae_tag, &ae_name);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACL_EXTENDED_DENY:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = translate_guid(&a->archive, acl_entry, &ae_id,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- &ae_tag, &ae_name);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Skip types that libarchive can't support. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Skip if translate_guid() above failed */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (r != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // XXX acl_type maps to allow/deny/audit/YYYY bits
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entry_acl_type = default_entry_acl_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_TYPE_NFS4 || HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_TYPE_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * acl_get_entry_type_np() fails with non-NFSv4 ACLs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_get_entry_type_np(acl_entry, &acl_type) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, errno, "Failed "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "to get ACL type from a NFSv4 ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- switch (acl_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACL_ENTRY_TYPE_ALLOW:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACL_ENTRY_TYPE_DENY:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACL_ENTRY_TYPE_AUDIT:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ACL_ENTRY_TYPE_ALARM:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Invalid NFSv4 ACL entry type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_ACL_TYPE_NFS4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Libarchive stores "flag" (NFSv4 inheritance bits)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * in the ae_perm bitmap.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * acl_get_flagset_np() fails with non-NFSv4 ACLs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to get flagset from a NFSv4 ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = acl_get_flag_np(acl_flagset,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_inherit_map[i].platform_inherit);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (r == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to check flag in a NFSv4 "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "ACL flagset");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else if (r)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_perm |= acl_inherit_map[i].archive_inherit;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_ACL_TYPE_NFS4 || HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_get_permset(acl_entry, &acl_permset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to get ACL permission set");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * acl_get_perm() is spelled differently on different
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * platforms; see above.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = ACL_GET_PERM(acl_permset, acl_perm_map[i].platform_perm);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (r == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to check permission in an ACL permission set");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else if (r)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_perm |= acl_perm_map[i].archive_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_entry_acl_add_entry(entry, entry_acl_type,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_perm, ae_tag,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_id, ae_name);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (s == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to get next ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* !HAVE_POSIX_ACL && !HAVE_NFS4_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-setup_acls(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- struct archive_entry *entry, int *fd)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (void)a; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (void)entry; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (void)fd; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_POSIX_ACL && !HAVE_NFS4_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if (HAVE_FGETXATTR && HAVE_FLISTXATTR && HAVE_LISTXATTR && \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HAVE_LLISTXATTR && HAVE_GETXATTR && HAVE_LGETXATTR) || \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (HAVE_FGETEA && HAVE_FLISTEA && HAVE_LISTEA)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1499,21 +512,9 @@ setup_xattrs(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ path = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (*fd < 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- path = archive_entry_sourcepath(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (path == NULL || (a->tree != NULL &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- a->tree_enter_working_dir(a->tree) != 0))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- path = archive_entry_pathname(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (path == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Couldn't determine file path to read "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "extended attributes");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ path = archive_read_disk_entry_setup_path(a, entry, fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (path == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (a->tree != NULL && (a->follow_symlinks ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_entry_filetype(entry) != AE_IFLNK)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *fd = a->open_on_current_dir(a->tree,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- path, O_RDONLY | O_NONBLOCK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if HAVE_FLISTXATTR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1658,21 +659,9 @@ setup_xattrs(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ path = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (*fd < 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- path = archive_entry_sourcepath(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (path == NULL || (a->tree != NULL &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- a->tree_enter_working_dir(a->tree) != 0))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- path = archive_entry_pathname(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (path == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Couldn't determine file path to read "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "extended attributes");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ path = archive_read_disk_entry_setup_path(a, entry, fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (path == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (ARCHIVE_WARN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (a->tree != NULL && (a->follow_symlinks ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_entry_filetype(entry) != AE_IFLNK)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *fd = a->open_on_current_dir(a->tree,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- path, O_RDONLY | O_NONBLOCK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (*fd >= 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1773,6 +762,7 @@ setup_sparse_fiemap(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int64_t size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int count, do_fiemap, iters;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int exit_sts = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *path;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (archive_entry_filetype(entry) != AE_IFREG
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ || archive_entry_size(entry) <= 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1780,11 +770,10 @@ setup_sparse_fiemap(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (*fd < 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const char *path;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- path = archive_entry_sourcepath(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ path = archive_read_disk_entry_setup_path(a, entry, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (path == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- path = archive_entry_pathname(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (a->tree != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *fd = a->open_on_current_dir(a->tree, path,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ O_RDONLY | O_NONBLOCK | O_CLOEXEC);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1880,6 +869,7 @@ setup_sparse(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ off_t off_s, off_e;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int exit_sts = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int check_fully_sparse = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *path;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (archive_entry_filetype(entry) != AE_IFREG
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ || archive_entry_size(entry) <= 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1887,19 +877,10 @@ setup_sparse(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Does filesystem support the reporting of hole ? */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (*fd < 0 && a->tree != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const char *path;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- path = archive_entry_sourcepath(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (*fd < 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ path = archive_read_disk_entry_setup_path(a, entry, fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (path == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- path = archive_entry_pathname(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *fd = a->open_on_current_dir(a->tree, path,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- O_RDONLY | O_NONBLOCK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (*fd < 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(&a->archive, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Can't open `%s'", path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (*fd >= 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1911,12 +892,6 @@ setup_sparse(struct archive_read_disk *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (initial_off != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lseek(*fd, 0, SEEK_SET);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const char *path;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- path = archive_entry_sourcepath(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (path == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- path = archive_entry_pathname(entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef _PC_MIN_HOLE_SIZE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (pathconf(path, _PC_MIN_HOLE_SIZE) <= 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_read_disk_private.h b/libarchive/archive_read_disk_private.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index b5a8328b..f03a0a9c 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_read_disk_private.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_read_disk_private.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -33,6 +33,8 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifndef ARCHIVE_READ_DISK_PRIVATE_H_INCLUDED
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define ARCHIVE_READ_DISK_PRIVATE_H_INCLUDED
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_platform_acl.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct tree;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct archive_entry;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -86,4 +88,11 @@ struct archive_read_disk {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void *excluded_cb_data;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_read_disk_entry_setup_path(struct archive_read_disk *,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_entry *, int *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_read_disk_entry_setup_acls(struct archive_read_disk *,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_entry *, int *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_read_format.3 b/libarchive/archive_read_format.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 53b9a7e0..91c5d2cf 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_read_format.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_read_format.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -37,9 +37,9 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_read_support_format_empty ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_read_support_format_iso9660 ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_read_support_format_lha ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_read_support_format_mtree,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_read_support_format_rar,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_read_support_format_raw,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Nm archive_read_support_format_mtree ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Nm archive_read_support_format_rar ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Nm archive_read_support_format_raw ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_read_support_format_tar ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_read_support_format_xar ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_read_support_format_zip
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_read_open.3 b/libarchive/archive_read_open.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 4d8272ca..02494560 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_read_open.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_read_open.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -33,7 +33,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_read_open_fd ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_read_open_FILE ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_read_open_filename ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_read_open_memory ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Nm archive_read_open_memory
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nd functions for reading streaming archives
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Sh LIBRARY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Streaming Archive Library (libarchive, -larchive)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_read_support_format_mtree.c b/libarchive/archive_read_support_format_mtree.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 4231ff50..00d32507 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_read_support_format_mtree.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_read_support_format_mtree.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1857,33 +1857,38 @@ mtree_atol8(char **p)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Note that this implementation does not (and should not!) obey
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * locale settings; you cannot simply substitute strtol here, since
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * it does obey locale.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Convert the number pointed to by 'p' into a 64-bit signed integer.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * On return, 'p' points to the first non-digit following the number.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * On overflow, the function returns INT64_MIN or INT64_MAX.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int64_t
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ mtree_atol10(char **p)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int64_t l, limit, last_digit_limit;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int base, digit, sign;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- base = 10;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const int base = 10;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const int64_t limit = INT64_MAX / base;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const int64_t last_digit_limit = INT64_MAX % base;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int64_t l;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int sign;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (**p == '-') {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sign = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- limit = ((uint64_t)(INT64_MAX) + 1) / base;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- last_digit_limit = ((uint64_t)(INT64_MAX) + 1) % base;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ++(*p);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sign = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- limit = INT64_MAX / base;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- last_digit_limit = INT64_MAX % base;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ l = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- digit = **p - '0';
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- while (digit >= 0 && digit < base) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (l > limit || (l == limit && digit > last_digit_limit))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (**p >= '0' && **p < '0' + base) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int digit = **p - '0';
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (l > limit || (l == limit && digit > last_digit_limit)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (**p >= '0' && **p < '0' + base) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ++(*p);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (sign < 0) ? INT64_MIN : INT64_MAX;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ l = (l * base) + digit;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- digit = *++(*p) - '0';
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ++(*p);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (sign < 0) ? -l : l;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_read_support_format_tar.c b/libarchive/archive_read_support_format_tar.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index bd7f13d5..30d5bc83 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_read_support_format_tar.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_read_support_format_tar.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -155,6 +155,7 @@ struct tar {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int compat_2x;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int process_mac_extensions;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int read_concatenated_archives;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int realsize_override;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int archive_block_is_null(const char *p);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -527,6 +528,7 @@ archive_read_format_tar_read_header(struct archive_read *a,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar->entry_offset = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ gnu_clear_sparse_list(tar);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar->realsize = -1; /* Mark this as "unset" */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tar->realsize_override = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Setup default string conversion. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar->sconv = tar->opt_sconv;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1894,6 +1896,7 @@ pax_attribute(struct archive_read *a, struct tar *tar,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (strcmp(key, "GNU.sparse.size") == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar->realsize = tar_atol10(value, strlen(value));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_entry_set_size(entry, tar->realsize);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tar->realsize_override = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* GNU "0.1" sparse pax format. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1925,6 +1928,7 @@ pax_attribute(struct archive_read *a, struct tar *tar,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (strcmp(key, "GNU.sparse.realsize") == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar->realsize = tar_atol10(value, strlen(value));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_entry_set_size(entry, tar->realsize);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tar->realsize_override = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case 'L':
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1977,6 +1981,7 @@ pax_attribute(struct archive_read *a, struct tar *tar,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar_atol10(value, strlen(value)));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else if (strcmp(key, "SCHILY.realsize") == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar->realsize = tar_atol10(value, strlen(value));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tar->realsize_override = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_entry_set_size(entry, tar->realsize);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else if (strncmp(key, "SCHILY.xattr.", 13) == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pax_attribute_schily_xattr(entry, key, value,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2055,14 +2060,12 @@ pax_attribute(struct archive_read *a, struct tar *tar,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar->entry_bytes_remaining
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ = tar_atol10(value, strlen(value));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * But, "size" is not necessarily the size of
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * the file on disk; if this is a sparse file,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * the disk size may have already been set from
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * GNU.sparse.realsize or GNU.sparse.size or
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * an old GNU header field or SCHILY.realsize
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * or ....
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * The "size" pax header keyword always overrides the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * "size" field in the tar header.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * GNU.sparse.realsize, GNU.sparse.size and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * SCHILY.realsize override this value.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (tar->realsize < 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!tar->realsize_override) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_entry_set_size(entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar->entry_bytes_remaining);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar->realsize
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2206,6 +2209,7 @@ header_gnutar(struct archive_read *a, struct tar *tar,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tar->realsize
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ = tar_atol(header->realsize, sizeof(header->realsize));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_entry_set_size(entry, tar->realsize);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tar->realsize_override = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (header->sparse[0].offset[0] != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_read_support_format_warc.c b/libarchive/archive_read_support_format_warc.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index b1624651..e8753853 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_read_support_format_warc.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_read_support_format_warc.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -600,9 +600,10 @@ _warc_rdver(const char *buf, size_t bsz)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* looks good so far, read the version number for a laugh */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ buf += sizeof(magic) - 1U;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (isdigit(buf[0U]) && (buf[1U] == '.') && isdigit(buf[2U])) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (isdigit((unsigned char)buf[0U]) && (buf[1U] == '.') &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ isdigit((unsigned char)buf[2U])) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* we support a maximum of 2 digits in the minor version */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (isdigit(buf[3U]))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (isdigit((unsigned char)buf[3U]))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ end = 1U;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* set up major version */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ver = (buf[0U] - '0') * 10000U;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -686,7 +687,7 @@ _warc_rduri(const char *buf, size_t bsz)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* spaces inside uri are not allowed, CRLF should follow */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (p = val; p < eol; p++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (isspace(*p))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (isspace((unsigned char)*p))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return res;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -736,7 +737,7 @@ _warc_rdlen(const char *buf, size_t bsz)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ while (val < eol && (*val == ' ' || *val == '\t'))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ val++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* there must be at least one digit */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!isdigit(*val))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!isdigit((unsigned char)*val))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ len = strtol(val, &on, 10);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (on != eol) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_read_support_format_zip.c b/libarchive/archive_read_support_format_zip.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 08bcf1f5..e62f99c8 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_read_support_format_zip.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_read_support_format_zip.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2407,7 +2407,7 @@ read_eocd(struct zip *zip, const char *p, int64_t current_offset)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Examine Zip64 EOCD locator: If it's valid, store the information
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * from it.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ read_zip64_eocd(struct archive_read *a, struct zip *zip, const char *p)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int64_t eocd64_offset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2417,35 +2417,37 @@ read_zip64_eocd(struct archive_read *a, struct zip *zip, const char *p)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Central dir must be on first volume. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (archive_le32dec(p + 4) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Must be only a single volume. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (archive_le32dec(p + 16) != 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Find the Zip64 EOCD record. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ eocd64_offset = archive_le64dec(p + 8);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (__archive_read_seek(a, eocd64_offset, SEEK_SET) < 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((p = __archive_read_ahead(a, 56, NULL)) == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Make sure we can read all of it. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ eocd64_size = archive_le64dec(p + 4) + 12;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (eocd64_size < 56 || eocd64_size > 16384)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((p = __archive_read_ahead(a, (size_t)eocd64_size, NULL)) == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Sanity-check the EOCD64 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (archive_le32dec(p + 16) != 0) /* Must be disk #0 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (archive_le32dec(p + 20) != 0) /* CD must be on disk #0 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* CD can't be split. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (archive_le64dec(p + 24) != archive_le64dec(p + 32))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Save the central directory offset for later use. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ zip->central_directory_offset = archive_le64dec(p + 48);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 32;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2483,15 +2485,14 @@ archive_read_format_zip_seekable_bid(struct archive_read *a, int best_bid)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (memcmp(p + i, "PK\005\006", 4) == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int ret = read_eocd(zip, p + i,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ current_offset + i);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (ret > 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Zip64 EOCD locator precedes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * regular EOCD if present. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (i >= 20
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- && memcmp(p + i - 20, "PK\006\007", 4) == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- read_zip64_eocd(a, zip, p + i - 20);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Zip64 EOCD locator precedes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * regular EOCD if present. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (i >= 20 && memcmp(p + i - 20, "PK\006\007", 4) == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ret_zip64 = read_zip64_eocd(a, zip, p + i - 20);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ret_zip64 > ret)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ret_zip64;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ i -= 4;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_util.c b/libarchive/archive_util.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 6b3bd611..a751868f 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_util.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_util.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -89,88 +89,6 @@ archive_version_string(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (ARCHIVE_VERSION_STRING);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-const char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-archive_version_details(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- static struct archive_string str;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- static int init = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const char *zlib = archive_zlib_version();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const char *liblzma = archive_liblzma_version();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const char *bzlib = archive_bzlib_version();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const char *liblz4 = archive_liblz4_version();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!init) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_string_init(&str);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_strcat(&str, ARCHIVE_VERSION_STRING);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (zlib != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_strcat(&str, " zlib/");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_strcat(&str, zlib);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (liblzma) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_strcat(&str, " liblzma/");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_strcat(&str, liblzma);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (bzlib) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const char *p = bzlib;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const char *sep = strchr(p, ',');
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (sep == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sep = p + strlen(p);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_strcat(&str, " bz2lib/");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_strncat(&str, p, sep - p);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (liblz4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_strcat(&str, " liblz4/");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_strcat(&str, liblz4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return str.s;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-const char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-archive_zlib_version(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAVE_ZLIB_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return ZLIB_VERSION;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-const char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-archive_liblzma_version(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAVE_LZMA_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return LZMA_VERSION_STRING;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-const char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-archive_bzlib_version(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAVE_BZLIB_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return BZ2_bzlibVersion();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-const char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-archive_liblz4_version(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if defined(HAVE_LZ4_H) && defined(HAVE_LIBLZ4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define str(s) #s
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define NUMBER(x) str(x)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return NUMBER(LZ4_VERSION_MAJOR) "." NUMBER(LZ4_VERSION_MINOR) "." NUMBER(LZ4_VERSION_RELEASE);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#undef NUMBER
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#undef str
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_errno(struct archive *a)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_version_details.c b/libarchive/archive_version_details.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 00000000..813f0f3f
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_version_details.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,133 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2009-2012,2014 Michihiro NAKAJIMA
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2003-2007 Tim Kientzle
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_platform.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++__FBSDID("$FreeBSD: head/lib/libarchive/archive_util.c 201098 2009-12-28 02:58:14Z kientzle $");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_STDLIB_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <stdlib.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_STRING_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <string.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_ZLIB_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <zlib.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_LZMA_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <lzma.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_BZLIB_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <bzlib.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_LZ4_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <lz4.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_string.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_version_details(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ static struct archive_string str;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ static int init = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *zlib = archive_zlib_version();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *liblzma = archive_liblzma_version();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *bzlib = archive_bzlib_version();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *liblz4 = archive_liblz4_version();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!init) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_string_init(&str);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_strcat(&str, ARCHIVE_VERSION_STRING);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (zlib != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_strcat(&str, " zlib/");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_strcat(&str, zlib);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (liblzma) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_strcat(&str, " liblzma/");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_strcat(&str, liblzma);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (bzlib) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *p = bzlib;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *sep = strchr(p, ',');
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (sep == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sep = p + strlen(p);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_strcat(&str, " bz2lib/");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_strncat(&str, p, sep - p);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (liblz4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_strcat(&str, " liblz4/");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_strcat(&str, liblz4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return str.s;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_zlib_version(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_ZLIB_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return ZLIB_VERSION;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_liblzma_version(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_LZMA_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return LZMA_VERSION_STRING;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_bzlib_version(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_BZLIB_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return BZ2_bzlibVersion();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++const char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_liblz4_version(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(HAVE_LZ4_H) && defined(HAVE_LIBLZ4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define str(s) #s
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define NUMBER(x) str(x)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return NUMBER(LZ4_VERSION_MAJOR) "." NUMBER(LZ4_VERSION_MINOR) "." NUMBER(LZ4_VERSION_RELEASE);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#undef NUMBER
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#undef str
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_write_data.3 b/libarchive/archive_write_data.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 0cdd25f1..9c16cd9b 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_write_data.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_write_data.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -24,11 +24,12 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\" $FreeBSD$
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Dd February 2, 2012
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Dd February 28, 2017
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Dt ARCHIVE_WRITE_DATA 3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Os
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Sh NAME
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_write_data
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Nm archive_write_data ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Nm archive_write_data_block
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nd functions for creating archives
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Sh LIBRARY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Streaming Archive Library (libarchive, -larchive)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -36,8 +37,27 @@ Streaming Archive Library (libarchive, -larchive)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .In archive.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Ft la_ssize_t
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Fn archive_write_data "struct archive *" "const void *" "size_t"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Ft la_ssize_t
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Fn archive_write_data_block "struct archive *" "const void *" "size_t size" "int64_t offset"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Sh DESCRIPTION
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Bl -tag -width indent
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.It Fn archive_write_data
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++Write data corresponding to the header just written.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.It Fn archive_write_data_block
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Write data corresponding to the header just written.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++This is like
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Fn archive_write_data
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++except that it performs a seek on the file being
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++written to the specified offset before writing the data.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++This is useful when restoring sparse files from archive
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++formats that support sparse files.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++Returns number of bytes written or -1 on error.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++(Note: This is currently not supported for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Tn archive_write
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++handles, only for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Tn archive_write_disk
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++handles.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.El
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\" .Sh EXAMPLE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Sh RETURN VALUES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_write_disk.3 b/libarchive/archive_write_disk.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index ba6c9706..4891b857 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_write_disk.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_write_disk.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -24,7 +24,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\" $FreeBSD$
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Dd February 2, 2012
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Dd February 28, 2017
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Dt ARCHIVE_WRITE_DISK 3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Os
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Sh NAME
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -33,14 +33,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_write_disk_set_skip_file ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_write_disk_set_group_lookup ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm archive_write_disk_set_standard_lookup ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_write_disk_set_user_lookup ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_write_header ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_write_data ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_write_data_block ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_write_finish_entry ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_write_close ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_write_finish
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm archive_write_free
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Nm archive_write_disk_set_user_lookup
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nd functions for creating objects on disk
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Sh LIBRARY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Streaming Archive Library (libarchive, -larchive)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -68,20 +61,6 @@ Streaming Archive Library (libarchive, -larchive)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Fa "uid_t (*)(void *, const char *uname, uid_t uid)"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Fa "void (*cleanup)(void *)"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Fc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Ft int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fn archive_write_header "struct archive *" "struct archive_entry *"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Ft la_ssize_t
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fn archive_write_data "struct archive *" "const void *" "size_t"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Ft la_ssize_t
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fn archive_write_data_block "struct archive *" "const void *" "size_t size" "int64_t offset"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Ft int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fn archive_write_finish_entry "struct archive *"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Ft int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fn archive_write_close "struct archive *"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Ft int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fn archive_write_finish "struct archive *"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Ft int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fn archive_write_free "struct archive *"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Sh DESCRIPTION
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ These functions provide a complete API for creating objects on
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ disk from
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -223,60 +202,6 @@ the number of calls to
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Xr getpwnam 3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Xr getgrnam 3 .
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.It Fn archive_write_header
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-Build and write a header using the data in the provided
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Tn struct archive_entry
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-structure.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-See
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Xr archive_entry 3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-for information on creating and populating
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Tn struct archive_entry
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-objects.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.It Fn archive_write_data
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-Write data corresponding to the header just written.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-Returns number of bytes written or -1 on error.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.It Fn archive_write_data_block
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-Write data corresponding to the header just written.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-This is like
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fn archive_write_data
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-except that it performs a seek on the file being
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-written to the specified offset before writing the data.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-This is useful when restoring sparse files from archive
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-formats that support sparse files.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-Returns number of bytes written or -1 on error.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-(Note: This is currently not supported for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Tn archive_write
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-handles, only for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Tn archive_write_disk
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-handles.)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.It Fn archive_write_finish_entry
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-Close out the entry just written.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-Ordinarily, clients never need to call this, as it
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-is called automatically by
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fn archive_write_next_header
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fn archive_write_close
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-as needed.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-However, some file attributes are written to disk only
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-after the file is closed, so this can be necessary
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-if you need to work with the file on disk right away.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.It Fn archive_write_close
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-Set any attributes that could not be set during the initial restore.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-For example, directory timestamps are not restored initially because
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-restoring a subsequent file would alter that timestamp.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-Similarly, non-writable directories are initially created with
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-write permissions (so that their contents can be restored).
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-The
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Nm
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-library maintains a list of all such deferred attributes and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-sets them when this function is invoked.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.It Fn archive_write_finish
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-This is a deprecated synonym for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fn archive_write_free .
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.It Fn archive_write_free
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-Invokes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fn archive_write_close
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-if it was not invoked manually, then releases all resources.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .El
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ More information about the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Va struct archive
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_write_disk_acl.c b/libarchive/archive_write_disk_acl.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+deleted file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 144ab7e7..00000000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_write_disk_acl.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,654 +0,0 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Copyright (c) 2003-2010 Tim Kientzle
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * notice, this list of conditions and the following disclaimer
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * in this position and unchanged.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include "archive_platform.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_disk.c 201159 2009-12-29 05:35:40Z kientzle $");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define _ACL_PRIVATE /* For debugging */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <membership.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAVE_ERRNO_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <errno.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include "archive.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include "archive_entry.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include "archive_acl_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include "archive_write_disk_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_POSIX_ACL && !HAVE_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/* Default empty function body to satisfy mainline code. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- struct archive_acl *abstract_acl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (void)a; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (void)fd; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (void)name; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (void)abstract_acl; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* HAVE_POSIX_ACL || HAVE_NFS4_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define ARCHIVE_PLATFORM_ACL_TYPE_NFS4 ACE_T
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define ARCHIVE_PLATFORM_ACL_TYPE_NFS4 ACL_TYPE_EXTENDED
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_ACL_TYPE_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define ARCHIVE_PLATFORM_ACL_TYPE_NFS4 ACL_TYPE_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static int set_acl(struct archive *, int fd, const char *,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- struct archive_acl *,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_type_t, int archive_entry_acl_type, const char *tn);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- struct archive_acl *abstract_acl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((archive_acl_types(abstract_acl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Solaris writes POSIX.1e access and default ACLs together */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = set_acl(a, fd, name, abstract_acl, ACLENT_T,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, "posix1e");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* HAVE_POSIX_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((archive_acl_types(abstract_acl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = set_acl(a, fd, name, abstract_acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "access");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (ret != ARCHIVE_OK)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((archive_acl_types(abstract_acl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = set_acl(a, fd, name, abstract_acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "default");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Simultaneous POSIX.1e and NFSv4 is not supported */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((archive_acl_types(abstract_acl) &
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = set_acl(a, fd, name, abstract_acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ARCHIVE_PLATFORM_ACL_TYPE_NFS4,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_NFS4_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Translate system ACL permissions into libarchive internal structure
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static const struct {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int archive_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int platform_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-} acl_perm_map[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL /* Solaris NFSv4 ACL permissions */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_EXECUTE, ACE_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_DATA, ACE_READ_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACE_LIST_DIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACE_WRITE_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ADD_FILE, ACE_ADD_FILE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACE_APPEND_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACE_ADD_SUBDIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACE_READ_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACE_WRITE_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACE_DELETE_CHILD},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACE_READ_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACE_WRITE_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_DELETE, ACE_DELETE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_ACL, ACE_READ_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACE_WRITE_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACE_WRITE_OWNER},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACE_SYNCHRONIZE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_DARWIN_ACL /* MacOS ACL permissions */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_EXTATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_EXTATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_SECURITY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_SECURITY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_CHANGE_OWNER},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* POSIX.1e ACL permissions */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ, ACL_READ},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_TYPE_NFS4 /* FreeBSD NFSv4 ACL permissions */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_SUN_ACL && !HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Translate system NFSv4 inheritance flags into libarchive internal structure
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static const struct {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int archive_inherit;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int platform_inherit;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-} acl_inherit_map[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL /* Solaris NFSv4 inheritance flags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACE_FILE_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACE_DIRECTORY_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACE_NO_PROPAGATE_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACE_INHERIT_ONLY_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACE_SUCCESSFUL_ACCESS_ACE_FLAG},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACE_FAILED_ACCESS_ACE_FLAG},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACE_INHERITED_ACE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_DARWIN_ACL /* MacOS NFSv4 inheritance flags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_LIMIT_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_ONLY_INHERIT}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* FreeBSD NFSv4 ACL inheritance flags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACL_ENTRY_SUCCESSFUL_ACCESS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACL_ENTRY_FAILED_ACCESS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_SUN_ACL && !HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_NFS4_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-set_acl(struct archive *a, int fd, const char *name,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- struct archive_acl *abstract_acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_type_t acl_type, int ae_requested_type, const char *tname)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent_t *aclent;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace_t *ace;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int e, r;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_t *acl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_t acl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_entry_t acl_entry;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_permset_t acl_permset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_TYPE_NFS4 || HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_flagset_t acl_flagset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_TYPE_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int r;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int ae_type, ae_permset, ae_tag, ae_id;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- uuid_t ae_uuid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- uid_t ae_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- gid_t ae_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const char *ae_name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int entries;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entries = archive_acl_reset(abstract_acl, ae_requested_type);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (entries == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = malloc(sizeof(acl_t));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(a, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Invalid ACL type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_type == ACE_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl->acl_entry_size = sizeof(ace_t);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if (acl_type == ACLENT_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl->acl_entry_size = sizeof(aclent_t);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(a, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Invalid ACL type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl->acl_type = acl_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl->acl_cnt = entries;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl->acl_aclp = malloc(entries * acl->acl_entry_size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl->acl_aclp == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Can't allocate memory for acl buffer");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = acl_init(entries);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl == (acl_t)NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to initialize ACL working storage");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- e = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl->acl_type == ACE_T) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace = &((ace_t *)acl->acl_aclp)[e];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_who = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_access_mask = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_flags = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent = &((aclent_t *)acl->acl_aclp)[e];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent->a_id = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent->a_type = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent->a_perm = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * Mac OS doesn't support NFSv4 ACLs for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * owner@, group@ and everyone@.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * We skip any of these ACLs found.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (ae_tag == ARCHIVE_ENTRY_ACL_USER_OBJ ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_tag == ARCHIVE_ENTRY_ACL_EVERYONE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_create_entry(&acl, &acl_entry) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to create a new ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- switch (ae_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_set_tag_type(acl_entry, ACL_EXTENDED_ALLOW);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_TYPE_DENY:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_set_tag_type(acl_entry, ACL_EXTENDED_DENY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* We don't support any other types on MacOS */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- switch (ae_tag) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_USER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl->acl_type == ACE_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_who = ae_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent->a_id = ae_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent->a_type |= USER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl->acl_type == ACE_T) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_who = ae_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_flags |= ACE_IDENTIFIER_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent->a_id = ae_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent->a_type |= GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl->acl_type == ACE_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_flags |= ACE_OWNER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent->a_type |= USER_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl->acl_type == ACE_T) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_flags |= ACE_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_flags |= ACE_IDENTIFIER_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent->a_type |= GROUP_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_MASK:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent->a_type |= CLASS_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_OTHER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent->a_type |= OTHER_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_EVERYONE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_flags |= ACE_EVERYONE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_USER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_DARWIN_ACL /* FreeBSD, Linux */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_set_tag_type(acl_entry, ACL_USER);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_set_qualifier(acl_entry, &ae_uid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* MacOS */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mbr_identifier_to_uuid(ID_TYPE_UID, &ae_uid,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sizeof(uid_t), ae_uuid) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_set_qualifier(acl_entry, &ae_uuid) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_DARWIN_ACL /* FreeBSD, Linux */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_set_tag_type(acl_entry, ACL_GROUP);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_set_qualifier(acl_entry, &ae_gid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* MacOS */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mbr_identifier_to_uuid(ID_TYPE_GID, &ae_gid,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sizeof(gid_t), ae_uuid) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_set_qualifier(acl_entry, &ae_uuid) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_DARWIN_ACL /* FreeBSD, Linux */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_set_tag_type(acl_entry, ACL_USER_OBJ);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_set_tag_type(acl_entry, ACL_GROUP_OBJ);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_MASK:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_set_tag_type(acl_entry, ACL_MASK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_OTHER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_set_tag_type(acl_entry, ACL_OTHER);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_TYPE_NFS4 /* FreeBSD only */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_EVERYONE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_set_tag_type(acl_entry, ACL_EVERYONE);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(a, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Unknown ACL tag");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_TYPE_NFS4 || HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- switch (ae_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (ace != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_TYPE_DENY:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (ace != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_type = ACE_ACCESS_DENIED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (ace != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_type = ACE_SYSTEM_AUDIT_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (ace != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_type = ACE_SYSTEM_ALARM_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (aclent == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (aclent != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent->a_type |= ACL_DEFAULT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALLOW);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_TYPE_DENY:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_DENY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_AUDIT);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALARM);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // These don't translate directly into the system ACL.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(a, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Unknown ACL entry type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (r != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- errno = EINVAL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to set ACL entry type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_ACL_TYPE_NFS4 || HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl->acl_type == ACLENT_T) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (ae_permset & ARCHIVE_ENTRY_ACL_EXECUTE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent->a_perm |= 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (ae_permset & ARCHIVE_ENTRY_ACL_WRITE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent->a_perm |= 2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (ae_permset & ARCHIVE_ENTRY_ACL_READ)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aclent->a_perm |= 4;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_get_permset(acl_entry, &acl_permset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to get ACL permission set");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_clear_perms(acl_permset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to clear ACL permissions");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (ae_permset & acl_perm_map[i].archive_perm) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_access_mask |=
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_perm_map[i].platform_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_add_perm(acl_permset,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_perm_map[i].platform_perm) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to add ACL permission");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_type == ACE_T)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_type == ACL_TYPE_EXTENDED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* FreeBSD */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_type == ACL_TYPE_NFS4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_POSIX_ACL || HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * acl_get_flagset_np() fails with non-NFSv4 ACLs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to get flagset from an NFSv4 ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_clear_flags_np(acl_flagset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to clear flags from an NFSv4 ACL flagset");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_POSIX_ACL || HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i = 0; i < (int)(sizeof(acl_inherit_map) /sizeof(acl_inherit_map[0])); ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (ae_permset & acl_inherit_map[i].archive_inherit) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ace->a_flags |=
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_inherit_map[i].platform_inherit;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_add_flag_np(acl_flagset,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_inherit_map[i].platform_inherit) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to add flag to NFSv4 ACL flagset");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_NFS4_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- e++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_SET_FD_NP || HAVE_ACL_SET_FD || HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Try restoring the ACL through 'fd' if we can. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL || HAVE_ACL_SET_FD_NP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (fd >= 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* !HAVE_SUN_ACL && !HAVE_ACL_SET_FD_NP */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (fd >= 0 && acl_type == ACL_TYPE_ACCESS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (facl_set(fd, acl) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_ACL_SET_FD_NP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_set_fd_np(fd, acl, acl_type) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* !HAVE_SUN_ACL && !HAVE_ACL_SET_FD_NP */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_set_fd(fd, acl) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (errno == EOPNOTSUPP) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Filesystem doesn't support ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Failed to set %s acl on fd", tname);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_ACL_SET_FD_NP || HAVE_ACL_SET_FD || HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_set(name, acl) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_ACL_SET_LINK_NP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_set_link_np(name, acl_type, acl) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* TODO: Skip this if 'name' is a symlink. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_set_file(name, acl_type, acl) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (errno == EOPNOTSUPP) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Filesystem doesn't support ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_set_error(a, errno, "Failed to set %s acl",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tname);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ret = ARCHIVE_WARN;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-exit_free:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_POSIX_ACL || HAVE_NFS4_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_write_disk_acl_darwin.c b/libarchive/archive_write_disk_acl_darwin.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 00000000..4ffdd66b
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_write_disk_acl_darwin.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,234 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2017 Martin Matuska
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * in this position and unchanged.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_platform.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_MEMBERSHIP_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <membership.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_ERRNO_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <errno.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define _ACL_PRIVATE /* For debugging */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_entry.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_write_disk_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_acl_maps.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++set_acl(struct archive *a, int fd, const char *name,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_acl *abstract_acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ae_requested_type, const char *tname)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_t acl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_entry_t acl_entry;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_permset_t acl_permset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_flagset_t acl_flagset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ae_type, ae_permset, ae_tag, ae_id;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ uuid_t ae_uuid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ uid_t ae_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ gid_t ae_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *ae_name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int entries;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entries = archive_acl_reset(abstract_acl, ae_requested_type);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (entries == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ae_requested_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ errno = ENOENT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno, "Unsupported ACL type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_init(entries);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl == (acl_t)NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to initialize ACL working storage");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Mac OS doesn't support NFSv4 ACLs for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * owner@, group@ and everyone@.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * We skip any of these ACLs found.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ae_tag == ARCHIVE_ENTRY_ACL_USER_OBJ ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_tag == ARCHIVE_ENTRY_ACL_EVERYONE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_create_entry(&acl, &acl_entry) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to create a new ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (ae_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_tag_type(acl_entry, ACL_EXTENDED_ALLOW);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_DENY:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_tag_type(acl_entry, ACL_EXTENDED_DENY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* We don't support any other types on MacOS */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (ae_tag) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_USER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mbr_uid_to_uuid(ae_uid, ae_uuid) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_set_qualifier(acl_entry, &ae_uuid) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mbr_gid_to_uuid(ae_gid, ae_uuid) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_set_qualifier(acl_entry, &ae_uuid) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Unsupported ACL tag");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get ACL permission set");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_clear_perms(acl_permset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to clear ACL permissions");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < acl_nfs4_perm_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ae_permset & acl_nfs4_perm_map[i].a_perm) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_add_perm(acl_permset,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_nfs4_perm_map[i].p_perm) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to add ACL permission");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * acl_get_flagset_np() fails with non-NFSv4 ACLs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get flagset from an NFSv4 ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_clear_flags_np(acl_flagset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to clear flags from an NFSv4 ACL flagset");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ae_permset & acl_nfs4_flag_map[i].a_perm) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_add_flag_np(acl_flagset,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_nfs4_flag_map[i].p_perm) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to add flag to "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "NFSv4 ACL flagset");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (fd >= 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_set_fd_np(fd, acl, ACL_TYPE_EXTENDED) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (errno == EOPNOTSUPP) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Filesystem doesn't support ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to set acl on fd: %s", tname);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_WARN;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if (acl_set_link_np(name, ACL_TYPE_EXTENDED, acl) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (errno == EOPNOTSUPP) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Filesystem doesn't support ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno, "Failed to set acl: %s",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tname);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_WARN;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++exit_free:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_acl *abstract_acl, __LA_MODE_T mode)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)mode; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((archive_acl_types(abstract_acl) &
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = set_acl(a, fd, name, abstract_acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_write_disk_acl_freebsd.c b/libarchive/archive_write_disk_acl_freebsd.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 00000000..29e64adf
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_write_disk_acl_freebsd.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,321 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2003-2010 Tim Kientzle
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * in this position and unchanged.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_platform.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++__FBSDID("$FreeBSD$");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_ERRNO_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <errno.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define _ACL_PRIVATE /* For debugging */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_entry.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_write_disk_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_acl_maps.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++set_acl(struct archive *a, int fd, const char *name,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_acl *abstract_acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ae_requested_type, const char *tname)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int acl_type = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_t acl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_entry_t acl_entry;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_permset_t acl_permset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_flagset_t acl_flagset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int r;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ae_type, ae_permset, ae_tag, ae_id;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int perm_map_size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const acl_perm_map_t *perm_map;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ uid_t ae_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ gid_t ae_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *ae_name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int entries;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entries = archive_acl_reset(abstract_acl, ae_requested_type);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (entries == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (ae_requested_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_type = ACL_TYPE_ACCESS;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_type = ACL_TYPE_DEFAULT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_NFS4:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_type = ACL_TYPE_NFS4;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ errno = ENOENT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno, "Unsupported ACL type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_init(entries);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl == (acl_t)NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to initialize ACL working storage");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_create_entry(&acl, &acl_entry) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to create a new ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (ae_tag) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_USER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_tag_type(acl_entry, ACL_USER);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_qualifier(acl_entry, &ae_uid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_tag_type(acl_entry, ACL_GROUP);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_qualifier(acl_entry, &ae_gid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_tag_type(acl_entry, ACL_USER_OBJ);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_tag_type(acl_entry, ACL_GROUP_OBJ);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_MASK:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_tag_type(acl_entry, ACL_MASK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_OTHER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_tag_type(acl_entry, ACL_OTHER);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_EVERYONE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_tag_type(acl_entry, ACL_EVERYONE);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Unsupported ACL tag");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (ae_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_set_entry_type_np(acl_entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ENTRY_TYPE_ALLOW);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_DENY:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_set_entry_type_np(acl_entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ENTRY_TYPE_DENY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_set_entry_type_np(acl_entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ENTRY_TYPE_AUDIT);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_set_entry_type_np(acl_entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ENTRY_TYPE_ALARM);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // These don't translate directly into the system ACL.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Unsupported ACL entry type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to set ACL entry type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get ACL permission set");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_clear_perms(acl_permset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to clear ACL permissions");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_map_size = acl_nfs4_perm_map_size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_map = acl_nfs4_perm_map;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_map_size = acl_posix_perm_map_size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_map = acl_posix_perm_map;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < perm_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ae_permset & perm_map[i].a_perm) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_add_perm(acl_permset,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_map[i].p_perm) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to add ACL permission");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * acl_get_flagset_np() fails with non-NFSv4 ACLs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get flagset from an NFSv4 "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_clear_flags_np(acl_flagset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to clear flags from an NFSv4 "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "ACL flagset");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ae_permset & acl_nfs4_flag_map[i].a_perm) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_add_flag_np(acl_flagset,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_nfs4_flag_map[i].p_perm) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to add flag to "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "NFSv4 ACL flagset");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Try restoring the ACL through 'fd' if we can. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (fd >= 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_set_fd_np(fd, acl, acl_type) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (errno == EOPNOTSUPP) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Filesystem doesn't support ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to set acl on fd: %s", tname);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_WARN;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_ACL_SET_LINK_NP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if (acl_set_link_np(name, acl_type, acl) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* FreeBSD older than 8.0 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if (acl_set_file(name, acl_type, acl) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (errno == EOPNOTSUPP) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Filesystem doesn't support ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno, "Failed to set acl: %s",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tname);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_WARN;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++exit_free:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_acl *abstract_acl, __LA_MODE_T mode)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)mode; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((archive_acl_types(abstract_acl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((archive_acl_types(abstract_acl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = set_acl(a, fd, name, abstract_acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, "access");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ret != ARCHIVE_OK)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((archive_acl_types(abstract_acl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = set_acl(a, fd, name, abstract_acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, "default");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Simultaneous POSIX.1e and NFSv4 is not supported */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if ((archive_acl_types(abstract_acl) &
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = set_acl(a, fd, name, abstract_acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_write_disk_acl_linux.c b/libarchive/archive_write_disk_acl_linux.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 00000000..2239df6c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_write_disk_acl_linux.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,388 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2003-2010 Tim Kientzle
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * in this position and unchanged.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_platform.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_ERRNO_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <errno.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_FCNTL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <fcntl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_ACL_LIBACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <acl/libacl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_SYS_RICHACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/richacl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_entry.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_write_disk_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_acl_maps.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++_richacl_mode_to_mask(short mode)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int mask = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & S_IROTH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mask |= RICHACE_POSIX_MODE_READ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & S_IWOTH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mask |= RICHACE_POSIX_MODE_WRITE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mode & S_IXOTH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mask |= RICHACE_POSIX_MODE_EXEC;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (mask);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++_richacl_mode_to_masks(struct richacl *richacl, __LA_MODE_T mode)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl->a_owner_mask = _richacl_mode_to_mask((mode & 0700) >> 6);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl->a_group_mask = _richacl_mode_to_mask((mode & 0070) >> 3);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl->a_other_mask = _richacl_mode_to_mask(mode & 0007);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_LIBRICHACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++set_richacl(struct archive *a, int fd, const char *name,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_acl *abstract_acl, __LA_MODE_T mode,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ae_requested_type, const char *tname)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ae_type, ae_permset, ae_tag, ae_id;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ uid_t ae_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ gid_t ae_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *ae_name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int entries;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int e = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct richacl *richacl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct richace *richace;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entries = archive_acl_reset(abstract_acl, ae_requested_type);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (entries == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ae_requested_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ errno = ENOENT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno, "Unsupported ACL type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl = richacl_alloc(entries);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (richacl == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to initialize RichACL working storage");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ e = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richace = &(richacl->a_entries[e]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richace->e_flags = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richace->e_mask = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (ae_tag) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_USER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richace->e_id = ae_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richace->e_id = ae_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richace->e_flags |= RICHACE_IDENTIFIER_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richace->e_flags |= RICHACE_SPECIAL_WHO;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richace->e_id = RICHACE_OWNER_SPECIAL_ID;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richace->e_flags |= RICHACE_SPECIAL_WHO;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richace->e_id = RICHACE_GROUP_SPECIAL_ID;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_EVERYONE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richace->e_flags |= RICHACE_SPECIAL_WHO;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richace->e_id = RICHACE_EVERYONE_SPECIAL_ID;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Unsupported ACL tag");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (ae_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richace->e_type =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ RICHACE_ACCESS_ALLOWED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_DENY:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richace->e_type =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ RICHACE_ACCESS_DENIED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Unsupported ACL entry type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < acl_nfs4_perm_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ae_permset & acl_nfs4_perm_map[i].a_perm)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richace->e_mask |= acl_nfs4_perm_map[i].p_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ae_permset &
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_nfs4_flag_map[i].a_perm)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richace->e_flags |= acl_nfs4_flag_map[i].p_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ e++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Fill RichACL masks */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ _richacl_mode_to_masks(richacl, mode);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (fd >= 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (richacl_set_fd(fd, richacl) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (errno == EOPNOTSUPP) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Filesystem doesn't support ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to set richacl on fd: %s", tname);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_WARN;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if (richacl_set_file(name, richacl) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (errno == EOPNOTSUPP) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Filesystem doesn't support ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno, "Failed to set richacl: %s",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tname);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_WARN;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++exit_free:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl_free(richacl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_RICHACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++set_acl(struct archive *a, int fd, const char *name,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_acl *abstract_acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ae_requested_type, const char *tname)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int acl_type = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ae_type, ae_permset, ae_tag, ae_id;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ uid_t ae_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ gid_t ae_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *ae_name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int entries;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_t acl = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_entry_t acl_entry;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_permset_t acl_permset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entries = archive_acl_reset(abstract_acl, ae_requested_type);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (entries == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (ae_requested_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_type = ACL_TYPE_ACCESS;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_type = ACL_TYPE_DEFAULT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ errno = ENOENT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno, "Unsupported ACL type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_init(entries);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl == (acl_t)NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to initialize ACL working storage");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_create_entry(&acl, &acl_entry) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to create a new ACL entry");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (ae_tag) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_USER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_tag_type(acl_entry, ACL_USER);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_qualifier(acl_entry, &ae_uid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_tag_type(acl_entry, ACL_GROUP);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_qualifier(acl_entry, &ae_gid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_tag_type(acl_entry, ACL_USER_OBJ);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_tag_type(acl_entry, ACL_GROUP_OBJ);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_MASK:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_tag_type(acl_entry, ACL_MASK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_OTHER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_set_tag_type(acl_entry, ACL_OTHER);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Unsupported ACL tag");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to get ACL permission set");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_clear_perms(acl_permset) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to clear ACL permissions");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < acl_posix_perm_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ae_permset & acl_posix_perm_map[i].a_perm) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_add_perm(acl_permset,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_posix_perm_map[i].p_perm) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to add ACL permission");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (fd >= 0 && ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_set_fd(fd, acl) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (errno == EOPNOTSUPP) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Filesystem doesn't support ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to set acl on fd: %s", tname);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_WARN;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if (acl_set_file(name, acl_type, acl) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (errno == EOPNOTSUPP) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Filesystem doesn't support ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno, "Failed to set acl: %s",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tname);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_WARN;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++exit_free:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_LIBACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_acl *abstract_acl, __LA_MODE_T mode)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)mode; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((archive_acl_types(abstract_acl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = set_richacl(a, fd, name, abstract_acl, mode,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_LIBRICHACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((archive_acl_types(abstract_acl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((archive_acl_types(abstract_acl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = set_acl(a, fd, name, abstract_acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, "access");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ret != ARCHIVE_OK)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((archive_acl_types(abstract_acl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = set_acl(a, fd, name, abstract_acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, "default");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_LIBACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_write_disk_acl_sunos.c b/libarchive/archive_write_disk_acl_sunos.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 00000000..ebc0b095
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_write_disk_acl_sunos.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,329 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2017 Martin Matuska
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * in this position and unchanged.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_platform.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_ERRNO_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <errno.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define _ACL_PRIVATE /* For debugging */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_entry.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_write_disk_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_acl_maps.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++set_acl(struct archive *a, int fd, const char *name,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_acl *abstract_acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ae_requested_type, const char *tname)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent_t *aclent;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace_t *ace;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int cmd, e, r;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ void *aclp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ae_type, ae_permset, ae_tag, ae_id;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int perm_map_size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const acl_perm_map_t *perm_map;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ uid_t ae_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ gid_t ae_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *ae_name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int entries;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entries = archive_acl_reset(abstract_acl, ae_requested_type);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (entries == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (ae_requested_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_POSIX1E:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cmd = SETACL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = malloc(entries * sizeof(aclent_t));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_NFS4:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cmd = ACE_SETACL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = malloc(entries * sizeof(ace_t));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ errno = ENOENT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno, "Unsupported ACL type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclp == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Can't allocate memory for acl buffer");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ e = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (cmd == SETACL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent = &((aclent_t *)aclp)[e];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent->a_id = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent->a_type = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent->a_perm = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else { /* cmd == ACE_SETACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace = &((ace_t *)aclp)[e];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_who = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_access_mask = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_flags = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_SUNOS_NFS4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (ae_tag) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_USER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclent != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent->a_id = ae_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent->a_type |= USER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_who = ae_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclent != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent->a_id = ae_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent->a_type |= GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_who = ae_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_flags |= ACE_IDENTIFIER_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclent != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent->a_type |= USER_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_flags |= ACE_OWNER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclent != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent->a_type |= GROUP_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_flags |= ACE_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_flags |= ACE_IDENTIFIER_GROUP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_MASK:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclent != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent->a_type |= CLASS_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_OTHER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclent != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent->a_type |= OTHER_OBJ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_EVERYONE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ace != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_flags |= ACE_EVERYONE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Unsupported ACL tag");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (ae_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ace != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_DENY:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ace != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_type = ACE_ACCESS_DENIED_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ace != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_type = ACE_SYSTEM_AUDIT_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ace != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_type = ACE_SYSTEM_ALARM_ACE_TYPE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclent == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclent != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent->a_type |= ACL_DEFAULT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, ARCHIVE_ERRNO_MISC,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Unsupported ACL entry type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ errno = EINVAL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to set ACL entry type");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_map_size = acl_nfs4_perm_map_size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_map = acl_nfs4_perm_map;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_map_size = acl_posix_perm_map_size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_map = acl_posix_perm_map;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < perm_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ae_permset & perm_map[i].a_perm) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ae_requested_type ==
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_NFS4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_access_mask |=
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_map[i].p_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent->a_perm |= perm_map[i].p_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ae_permset & acl_nfs4_flag_map[i].a_perm) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace->a_flags |=
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_nfs4_flag_map[i].p_perm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ e++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Try restoring the ACL through 'fd' if we can. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (fd >= 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (facl(fd, cmd, entries, aclp) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (errno == EOPNOTSUPP) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Filesystem doesn't support ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Failed to set acl on fd: %s", tname);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_WARN;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if (acl(name, cmd, entries, aclp) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (errno == EOPNOTSUPP) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Filesystem doesn't support ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_set_error(a, errno, "Failed to set acl: %s",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tname);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = ARCHIVE_WARN;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++exit_free:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ free(aclp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_acl *abstract_acl, __LA_MODE_T mode)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ret = ARCHIVE_OK;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)mode; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((archive_acl_types(abstract_acl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Solaris writes POSIX.1e access and default ACLs together */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = set_acl(a, fd, name, abstract_acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, "posix1e");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Simultaneous POSIX.1e and NFSv4 is not supported */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if ((archive_acl_types(abstract_acl) &
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = set_acl(a, fd, name, abstract_acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 5a01e845..adb15c0e 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_write_disk_posix.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_write_disk_posix.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -575,10 +575,55 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (a->flags & ARCHIVE_EXTRACT_TIME)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ a->todo |= TODO_TIMES;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (a->flags & ARCHIVE_EXTRACT_ACL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_DARWIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * On MacOS, platform ACLs get stored in mac_metadata, too.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * If we intend to extract mac_metadata and it is present
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * we skip extracting libarchive NFSv4 ACLs.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ size_t metadata_size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((a->flags & ARCHIVE_EXTRACT_MAC_METADATA) == 0 ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_entry_mac_metadata(a->entry,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &metadata_size) == NULL || metadata_size == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * RichACLs are stored in an extended attribute.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * If we intend to extract extended attributes and have this
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * attribute we skip extracting libarchive NFSv4 ACLs.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ short extract_acls = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (a->flags & ARCHIVE_EXTRACT_XATTR && (
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_entry_acl_types(a->entry) &
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_TYPE_NFS4)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *attr_name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const void *attr_value;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ size_t attr_size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int i = archive_entry_xattr_reset(a->entry);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (i--) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_entry_xattr_next(a->entry, &attr_name,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &attr_value, &attr_size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (attr_name != NULL && attr_value != NULL &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ attr_size > 0 && strcmp(attr_name,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "trusted.richacl") == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ extract_acls = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (extract_acls)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_DARWIN || ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (archive_entry_filetype(a->entry) == AE_IFDIR)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ a->deferred |= TODO_ACLS;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ a->todo |= TODO_ACLS;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_DARWIN || ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (a->flags & ARCHIVE_EXTRACT_MAC_METADATA) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (archive_entry_filetype(a->entry) == AE_IFDIR)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1703,25 +1748,11 @@ _archive_write_disk_finish_entry(struct archive *_a)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (a->todo & TODO_ACLS) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int r2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * On Mac OS, platform ACLs are stored also in mac_metadata by
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * the operating system. If mac_metadata is present it takes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * precedence and we skip extracting libarchive NFSv4 ACLs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const void *metadata;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- size_t metadata_size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- metadata = archive_entry_mac_metadata(a->entry, &metadata_size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((a->todo & TODO_MAC_METADATA) == 0 ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- metadata == NULL || metadata_size == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ r2 = archive_write_disk_set_acls(&a->archive, a->fd,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_entry_pathname(a->entry),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_entry_acl(a->entry));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_entry_acl(a->entry),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_entry_mode(a->entry));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (r2 < ret) ret = r2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ finish_metadata:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2293,13 +2324,8 @@ _archive_write_disk_close(struct archive *_a)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (p->fixup & TODO_MODE_BASE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ chmod(p->name, p->mode);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (p->fixup & TODO_ACLS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((p->fixup & TODO_MAC_METADATA) == 0 ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- p->mac_metadata == NULL ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- p->mac_metadata_size == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_write_disk_set_acls(&a->archive,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- -1, p->name, &p->acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_write_disk_set_acls(&a->archive, -1, p->name,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &p->acl, p->mode);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (p->fixup & TODO_FFLAGS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set_fflags_platform(a, -1, p->name,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ p->mode, p->fflags_set, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2467,7 +2493,7 @@ fsobj_error(int *a_eno, struct archive_string *a_estr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (a_eno)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *a_eno = err;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (a_estr)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- archive_string_sprintf(a_estr, errstr, path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ archive_string_sprintf(a_estr, "%s%s", errstr, path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2573,7 +2599,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * with the deep-directory editing.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fsobj_error(a_eno, a_estr, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Could not stat %s", path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Could not stat ", path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ res = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2582,7 +2608,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (chdir(head) != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tail[0] = c;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fsobj_error(a_eno, a_estr, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Could not chdir %s", path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Could not chdir ", path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ res = (ARCHIVE_FATAL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2599,7 +2625,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (unlink(head)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tail[0] = c;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fsobj_error(a_eno, a_estr, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Could not remove symlink %s",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Could not remove symlink ",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ res = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2618,7 +2644,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!S_ISLNK(path)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fsobj_error(a_eno, a_estr, 0,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Removing symlink %s", path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Removing symlink ", path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Symlink gone. No more problem! */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2630,7 +2656,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tail[0] = c;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fsobj_error(a_eno, a_estr, 0,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "Cannot remove intervening "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "symlink %s", path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "symlink ", path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ res = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2652,7 +2678,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fsobj_error(a_eno, a_estr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Could not stat %s", path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Could not stat ", path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ res = (ARCHIVE_FAILED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2661,7 +2687,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tail[0] = c;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fsobj_error(a_eno, a_estr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Could not chdir %s", path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Could not chdir ", path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ res = (ARCHIVE_FATAL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2674,14 +2700,14 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tail[0] = c;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fsobj_error(a_eno, a_estr, 0,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "Cannot extract through "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "symlink %s", path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "symlink ", path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ res = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tail[0] = c;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fsobj_error(a_eno, a_estr, 0,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "Cannot extract through symlink %s", path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "Cannot extract through symlink ", path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ res = ARCHIVE_FAILED;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -4239,5 +4265,19 @@ older(struct stat *st, struct archive_entry *entry)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifndef ARCHIVE_ACL_SUPPORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_acl *abstract_acl, __LA_MODE_T mode)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)a; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)fd; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)name; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)abstract_acl; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)mode; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_OK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif /* !_WIN32 || __CYGWIN__ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_write_disk_private.h b/libarchive/archive_write_disk_private.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index d84e7e1c..b655dea2 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_write_disk_private.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_write_disk_private.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -33,11 +33,13 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifndef ARCHIVE_WRITE_DISK_PRIVATE_H_INCLUDED
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define ARCHIVE_WRITE_DISK_PRIVATE_H_INCLUDED
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_platform_acl.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "archive_acl_private.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_entry.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct archive_write_disk;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-archive_write_disk_set_acls(struct archive *, int /* fd */, const char * /* pathname */, struct archive_acl *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int archive_write_disk_set_acls(struct archive *, int, const char *,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_acl *, __LA_MODE_T);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_write_finish_entry.3 b/libarchive/archive_write_finish_entry.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index c5ef69eb..dc1b94b8 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_write_finish_entry.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_write_finish_entry.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -24,7 +24,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\" $FreeBSD$
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Dd February 2, 2012
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Dd February 28, 2017
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Dt ARCHIVE_WRITE_FINISH_ENTRY 3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Os
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Sh NAME
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -45,6 +45,9 @@ is called automatically by
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Fn archive_write_close
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ as needed.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++For
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Tn archive_write_disk
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++handles, this flushes pending file attribute changes like modification time.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\" .Sh EXAMPLE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Sh RETURN VALUES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ This function returns
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_write_format.3 b/libarchive/archive_write_format.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index d4ba6abf..aaafb0a8 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_write_format.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_write_format.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -108,7 +108,6 @@ Streaming Archive Library (libarchive, -larchive)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ These functions set the format that will be used for the archive.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Pp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ The library can write a variety of common archive formats.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Bl -tag -width indent
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .It Fn archive_write_set_format
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Sets the format based on the format code (see
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/mtree.5 b/libarchive/mtree.5
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 16c8abec..e607e4a8 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/mtree.5
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/mtree.5
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -48,7 +48,7 @@ Leading whitespace is always ignored.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Pp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ When encoding file or pathnames, any backslash character or
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ character outside of the 95 printable ASCII characters must be
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-encoded as a a backslash followed by three
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++encoded as a backslash followed by three
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ octal digits.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ When reading mtree files, any appearance of a backslash
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ followed by three octal digits should be converted into the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/test/test_acl_platform_nfs4.c b/libarchive/test/test_acl_platform_nfs4.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 01c1dc58..a3868a62 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/test/test_acl_platform_nfs4.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/test/test_acl_platform_nfs4.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -26,15 +26,18 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "test.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ __FBSDID("$FreeBSD$");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_POSIX_ACL || HAVE_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define _ACL_PRIVATE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <membership.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_SYS_RICHACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/richacl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_MEMBERSHIP_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <membership.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct myacl_t {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int permset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -44,7 +47,7 @@ struct myacl_t {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static struct myacl_t acls_reg[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !ARCHIVE_ACL_DARWIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* For this test, we need the file owner to be able to read and write the ACL. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_READ_ACL | ARCHIVE_ENTRY_ACL_WRITE_ACL | ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS | ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -91,7 +94,7 @@ static struct myacl_t acls_reg[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ARCHIVE_ENTRY_ACL_GROUP, 136, "group136" },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !ARCHIVE_ACL_DARWIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -134,7 +137,7 @@ static const int acls_reg_cnt = (int)(sizeof(acls_reg)/sizeof(acls_reg[0]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static struct myacl_t acls_dir[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* For this test, we need to be able to read and write the ACL. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !ARCHIVE_ACL_DARWIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_READ_ACL,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ARCHIVE_ENTRY_ACL_USER_OBJ, -1, ""},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -180,13 +183,17 @@ static struct myacl_t acls_dir[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ARCHIVE_ENTRY_ACL_USER, 302, "user302" },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_READ_DATA |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ARCHIVE_ENTRY_ACL_USER, 303, "user303" },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_READ_DATA |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ARCHIVE_ENTRY_ACL_USER, 304, "user304" },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !defined(ARCHIVE_ACL_SUNOS_NFS4) || defined(ACE_INHERITED_ACE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_INHERITED,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ARCHIVE_ENTRY_ACL_USER, 305, "user305" },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -207,7 +214,7 @@ static struct myacl_t acls_dir[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ARCHIVE_ENTRY_ACL_USER, 501, "user501" },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ARCHIVE_ENTRY_ACL_GROUP, 502, "group502" },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !ARCHIVE_ACL_DARWIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -254,12 +261,14 @@ set_acls(struct archive_entry *ae, struct myacl_t *acls, int start, int end)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_entry_acl_clear(ae);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !ARCHIVE_ACL_DARWIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (start > 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertEqualInt(ARCHIVE_OK,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_entry_acl_add_entry(ae,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acls[0].type, acls[0].permset, acls[0].tag,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acls[0].qual, acls[0].name));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (i = start; i < end; i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertEqualInt(ARCHIVE_OK,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_entry_acl_add_entry(ae,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -269,76 +278,96 @@ set_acls(struct archive_entry *ae, struct myacl_t *acls, int start, int end)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-acl_permset_to_bitmap(uint32_t a_access_mask)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++acl_permset_to_bitmap(uint32_t mask)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++acl_permset_to_bitmap(unsigned int mask)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_permset_to_bitmap(acl_permset_t opaque_ps)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- static struct { int machine; int portable; } perms[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAVE_SUN_ACL /* Solaris NFSv4 ACL permissions */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_EXECUTE, ARCHIVE_ENTRY_ACL_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_READ_DATA, ARCHIVE_ENTRY_ACL_READ_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_LIST_DIRECTORY, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_WRITE_DATA, ARCHIVE_ENTRY_ACL_WRITE_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_ADD_FILE, ARCHIVE_ENTRY_ACL_ADD_FILE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_APPEND_DATA, ARCHIVE_ENTRY_ACL_APPEND_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_ADD_SUBDIRECTORY, ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_READ_NAMED_ATTRS, ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_WRITE_NAMED_ATTRS, ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_DELETE_CHILD, ARCHIVE_ENTRY_ACL_DELETE_CHILD},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_READ_ATTRIBUTES, ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_WRITE_ATTRIBUTES, ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_DELETE, ARCHIVE_ENTRY_ACL_DELETE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_READ_ACL, ARCHIVE_ENTRY_ACL_READ_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_WRITE_ACL, ARCHIVE_ENTRY_ACL_WRITE_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_WRITE_OWNER, ARCHIVE_ENTRY_ACL_WRITE_OWNER},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_SYNCHRONIZE, ARCHIVE_ENTRY_ACL_SYNCHRONIZE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_DARWIN_ACL /* MacOS NFSv4 ACL permissions */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_READ_DATA, ARCHIVE_ENTRY_ACL_READ_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_LIST_DIRECTORY, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_WRITE_DATA, ARCHIVE_ENTRY_ACL_WRITE_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_ADD_FILE, ARCHIVE_ENTRY_ACL_ADD_FILE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_EXECUTE, ARCHIVE_ENTRY_ACL_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_DELETE, ARCHIVE_ENTRY_ACL_DELETE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_APPEND_DATA, ARCHIVE_ENTRY_ACL_APPEND_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_ADD_SUBDIRECTORY, ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_DELETE_CHILD, ARCHIVE_ENTRY_ACL_DELETE_CHILD},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_READ_ATTRIBUTES, ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_WRITE_ATTRIBUTES, ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_READ_EXTATTRIBUTES, ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_WRITE_EXTATTRIBUTES, ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_READ_SECURITY, ARCHIVE_ENTRY_ACL_READ_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_WRITE_SECURITY, ARCHIVE_ENTRY_ACL_WRITE_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_CHANGE_OWNER, ARCHIVE_ENTRY_ACL_WRITE_OWNER},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_SYNCHRONIZE, ARCHIVE_ENTRY_ACL_SYNCHRONIZE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ static struct { int portable; int machine; } perms[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef ARCHIVE_ACL_SUNOS_NFS4 /* Solaris NFSv4 ACL permissions */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_EXECUTE, ACE_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_DATA, ACE_READ_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACE_LIST_DIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACE_WRITE_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ADD_FILE, ACE_ADD_FILE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACE_APPEND_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACE_ADD_SUBDIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACE_READ_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACE_WRITE_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACE_DELETE_CHILD},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACE_READ_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACE_WRITE_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_DELETE, ACE_DELETE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_ACL, ACE_READ_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACE_WRITE_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACE_WRITE_OWNER},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACE_SYNCHRONIZE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_DARWIN /* MacOS NFSv4 ACL permissions */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_EXTATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_EXTATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_SECURITY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_SECURITY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_CHANGE_OWNER},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_DECL_ACL_SYNCHRONIZE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_EXECUTE, RICHACE_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_DATA, RICHACE_READ_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, RICHACE_LIST_DIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_DATA, RICHACE_WRITE_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ADD_FILE, RICHACE_ADD_FILE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_APPEND_DATA, RICHACE_APPEND_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, RICHACE_ADD_SUBDIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, RICHACE_READ_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, RICHACE_WRITE_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, RICHACE_DELETE_CHILD},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, RICHACE_READ_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, RICHACE_WRITE_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_DELETE, RICHACE_DELETE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_ACL, RICHACE_READ_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_ACL, RICHACE_WRITE_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, RICHACE_WRITE_OWNER},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, RICHACE_SYNCHRONIZE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else /* FreeBSD NFSv4 ACL permissions */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_EXECUTE, ARCHIVE_ENTRY_ACL_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_WRITE, ARCHIVE_ENTRY_ACL_WRITE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_READ, ARCHIVE_ENTRY_ACL_READ},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_READ_DATA, ARCHIVE_ENTRY_ACL_READ_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_LIST_DIRECTORY, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_WRITE_DATA, ARCHIVE_ENTRY_ACL_WRITE_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_ADD_FILE, ARCHIVE_ENTRY_ACL_ADD_FILE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_APPEND_DATA, ARCHIVE_ENTRY_ACL_APPEND_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_ADD_SUBDIRECTORY, ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_READ_NAMED_ATTRS, ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_WRITE_NAMED_ATTRS, ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_DELETE_CHILD, ARCHIVE_ENTRY_ACL_DELETE_CHILD},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_READ_ATTRIBUTES, ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_WRITE_ATTRIBUTES, ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_DELETE, ARCHIVE_ENTRY_ACL_DELETE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_READ_ACL, ARCHIVE_ENTRY_ACL_READ_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_WRITE_ACL, ARCHIVE_ENTRY_ACL_WRITE_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_WRITE_OWNER, ARCHIVE_ENTRY_ACL_WRITE_OWNER},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_SYNCHRONIZE, ARCHIVE_ENTRY_ACL_SYNCHRONIZE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int i, permset = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (i = 0; i < (int)(sizeof(perms)/sizeof(perms[0])); ++i)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (a_access_mask & perms[i].machine)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4 || ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (mask & perms[i].machine)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (acl_get_perm_np(opaque_ps, perms[i].machine))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -347,88 +376,70 @@ acl_permset_to_bitmap(acl_permset_t opaque_ps)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-acl_flagset_to_bitmap(uint16_t a_flags)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++acl_flagset_to_bitmap(uint16_t flags)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++acl_flagset_to_bitmap(int flags)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_flagset_to_bitmap(acl_flagset_t opaque_fs)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- static struct { int machine; int portable; } flags[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL /* Solaris NFSv4 ACL inheritance flags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_FILE_INHERIT_ACE, ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_DIRECTORY_INHERIT_ACE, ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_NO_PROPAGATE_INHERIT_ACE, ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_INHERIT_ONLY_ACE, ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_SUCCESSFUL_ACCESS_ACE_FLAG, ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_FAILED_ACCESS_ACE_FLAG, ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACE_INHERITED_ACE, ARCHIVE_ENTRY_ACL_ENTRY_INHERITED}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_DARWIN_ACL /* MacOS NFSv4 ACL inheritance flags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_ENTRY_INHERITED, ARCHIVE_ENTRY_ACL_ENTRY_INHERITED},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_ENTRY_FILE_INHERIT, ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_ENTRY_DIRECTORY_INHERIT, ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_ENTRY_LIMIT_INHERIT, ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_ENTRY_ONLY_INHERIT, ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ static struct { int portable; int machine; } perms[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4 /* Solaris NFSv4 ACL inheritance flags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACE_FILE_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACE_DIRECTORY_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACE_NO_PROPAGATE_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACE_INHERIT_ONLY_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACE_SUCCESSFUL_ACCESS_ACE_FLAG},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACE_FAILED_ACCESS_ACE_FLAG},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef ACE_INHERITED_ACE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACE_INHERITED_ACE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_DARWIN /* MacOS NFSv4 ACL inheritance flags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_LIMIT_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_ONLY_INHERIT}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, RICHACE_FILE_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, RICHACE_DIRECTORY_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, RICHACE_NO_PROPAGATE_INHERIT_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, RICHACE_INHERIT_ONLY_ACE},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, RICHACE_INHERITED_ACE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else /* FreeBSD NFSv4 ACL inheritance flags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_ENTRY_FILE_INHERIT, ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_ENTRY_DIRECTORY_INHERIT, ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_ENTRY_NO_PROPAGATE_INHERIT, ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_ENTRY_SUCCESSFUL_ACCESS, ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_ENTRY_NO_PROPAGATE_INHERIT, ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {ACL_ENTRY_INHERIT_ONLY, ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACL_ENTRY_SUCCESSFUL_ACCESS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACL_ENTRY_FAILED_ACCESS},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int i, flagset = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i = 0; i < (int)(sizeof(flags)/sizeof(flags[0])); ++i)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (a_flags & flags[i].machine)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < (int)(sizeof(perms)/sizeof(perms[0])); ++i)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4 || ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (flags & perms[i].machine)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl_get_flag_np(opaque_fs, flags[i].machine))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_get_flag_np(opaque_fs, perms[i].machine))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- flagset |= flags[i].portable;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ flagset |= perms[i].portable;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return flagset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_match(ace_t *ace, struct myacl_t *myacl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-acl_match(acl_entry_t aclent, struct myacl_t *myacl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- void *q;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- uid_t ugid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int r, idtype;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- gid_t g, *gp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- uid_t u, *up;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_entry_type_t entry_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_tag_t tag_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_permset_t opaque_ps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_flagset_t opaque_fs;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int perms;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ perms = acl_permset_to_bitmap(ace->a_access_mask) | acl_flagset_to_bitmap(ace->a_flags);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_get_tag_type(aclent, &tag_type);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_get_entry_type_np(aclent, &entry_type);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* translate the silly opaque permset to a bitmap */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_get_permset(aclent, &opaque_ps);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_get_flagset_np(aclent, &opaque_fs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- perms = acl_permset_to_bitmap(opaque_ps) | acl_flagset_to_bitmap(opaque_fs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (perms != myacl->permset)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ switch (ace->a_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case ACE_ACCESS_ALLOWED_ACE_TYPE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (myacl->type != ARCHIVE_ENTRY_ACL_TYPE_ALLOW)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -470,7 +481,85 @@ acl_match(acl_entry_t aclent, struct myacl_t *myacl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((uid_t)myacl->qual != ace->a_who)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++acl_match(struct richace *richace, struct myacl_t *myacl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int perms;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perms = acl_permset_to_bitmap(richace->e_mask) |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_flagset_to_bitmap(richace->e_flags);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (perms != myacl->permset)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (richace->e_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case RICHACE_ACCESS_ALLOWED_ACE_TYPE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (myacl->type != ARCHIVE_ENTRY_ACL_TYPE_ALLOW)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case RICHACE_ACCESS_DENIED_ACE_TYPE:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (myacl->type != ARCHIVE_ENTRY_ACL_TYPE_DENY)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (richace->e_flags & RICHACE_SPECIAL_WHO) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (richace->e_id) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case RICHACE_OWNER_SPECIAL_ID:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case RICHACE_GROUP_SPECIAL_ID:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP_OBJ)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case RICHACE_EVERYONE_SPECIAL_ID:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (myacl->tag != ARCHIVE_ENTRY_ACL_EVERYONE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Invalid e_id */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else if (richace->e_flags & RICHACE_IDENTIFIER_GROUP) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((gid_t)myacl->qual != richace->e_id)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((uid_t)myacl->qual != richace->e_id)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_DARWIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++acl_match(acl_entry_t aclent, struct myacl_t *myacl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ void *q;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ uid_t ugid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int r, idtype;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_tag_t tag_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_permset_t opaque_ps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_flagset_t opaque_fs;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int perms;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_tag_type(aclent, &tag_type);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* translate the silly opaque permset to a bitmap */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_permset(aclent, &opaque_ps);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_flagset_np(aclent, &opaque_fs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perms = acl_permset_to_bitmap(opaque_ps) | acl_flagset_to_bitmap(opaque_fs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (perms != myacl->permset)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ r = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ switch (tag_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case ACL_EXTENDED_ALLOW:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -507,7 +596,30 @@ acl_match(acl_entry_t aclent, struct myacl_t *myacl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* !HAVE_SUN_ACL && !HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else /* ARCHIVE_ACL_FREEBSD_NFS4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++acl_match(acl_entry_t aclent, struct myacl_t *myacl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ gid_t g, *gp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ uid_t u, *up;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_entry_type_t entry_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_tag_t tag_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_permset_t opaque_ps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_flagset_t opaque_fs;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int perms;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_tag_type(aclent, &tag_type);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_entry_type_np(aclent, &entry_type);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* translate the silly opaque permset to a bitmap */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_permset(aclent, &opaque_ps);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_get_flagset_np(aclent, &opaque_fs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perms = acl_permset_to_bitmap(opaque_ps) | acl_flagset_to_bitmap(opaque_fs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (perms != myacl->permset)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ switch (entry_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case ACL_ENTRY_TYPE_ALLOW:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (myacl->type != ARCHIVE_ENTRY_ACL_TYPE_ALLOW)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -559,14 +671,17 @@ acl_match(acl_entry_t aclent, struct myacl_t *myacl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (myacl->tag != ARCHIVE_ENTRY_ACL_EVERYONE) return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_SUN_ACL && !HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* various ARCHIVE_ACL_NFS4 implementations */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ compare_acls(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_t *acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ void *aclp,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int aclcnt,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct richacl *richacl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_t acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -575,38 +690,61 @@ compare_acls(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int *marker;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int matched;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int i, n;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int e;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ace_t *acl_entry;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int e;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct richace *acl_entry;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int aclcnt;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int entry_id = ACL_FIRST_ENTRY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_entry_t acl_entry;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_DARWIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const int acl_get_entry_ret = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const int acl_get_entry_ret = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclp == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (richacl == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclcnt = richacl->a_count;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ n = end - start;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ marker = malloc(sizeof(marker[0]) * (n + 1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (i = 0; i < n; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ marker[i] = i + start;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !ARCHIVE_ACL_DARWIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Always include the first ACE. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (start > 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ marker[n] = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ++n;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Iterate over acls in system acl object, try to match each
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * one with an item in the myacls array.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (e = 0; e < acl->acl_cnt; e++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- while (0 == acl_get_entry(acl, entry_id, &acl_entry))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4 || ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (e = 0; e < aclcnt; e++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- while (1 == acl_get_entry(acl, entry_id, &acl_entry))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (acl_get_entry_ret == acl_get_entry(acl, entry_id, &acl_entry))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_entry = &((ace_t *)acl->acl_aclp)[e];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_entry = &((ace_t *)aclp)[e];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_entry = &(richacl->a_entries[e]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* After the first time... */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ entry_id = ACL_NEXT_ENTRY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -699,7 +837,7 @@ compare_entry_acls(struct archive_entry *ae, struct myacl_t *myacls, const char
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ free(marker);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_NFS4_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_NFS4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Verify ACL restore-to-disk. This test is Platform-specific.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -707,101 +845,36 @@ compare_entry_acls(struct archive_entry *ae, struct myacl_t *myacls, const char
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DEFINE_TEST(test_acl_platform_nfs4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !ARCHIVE_ACL_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ skipping("NFS4 ACLs are not supported on this platform");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else /* ARCHIVE_ACL_NFS4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char buff[64];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct stat st;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct archive *a;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct archive_entry *ae;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int i, n;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- char *func;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_DARWIN_ACL /* On MacOS we skip trivial ACLs in some tests */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_DARWIN /* On MacOS we skip trivial ACLs in some tests */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int regcnt = acls_reg_cnt - 4;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int dircnt = acls_dir_cnt - 4;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int regcnt = acls_reg_cnt;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int dircnt = acls_dir_cnt;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_t *acl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_entry_t aclent;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_permset_t permset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const uid_t uid = 1000;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- uuid_t uuid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ void *aclp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int aclcnt;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct richacl *richacl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else /* !ARCHIVE_ACL_SUNOS_NFS4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_t acl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * First, do a quick manual set/read of ACL data to
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * verify that the local filesystem does support ACLs.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * If it doesn't, we'll simply skip the remaining tests.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_POSIX_ACL && HAVE_ACL_TYPE_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = acl_from_text("owner@:rwxp::allow,group@:rwp:f:allow");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("acl_from_text(): errno = %d (%s)", errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assert((void *)acl != NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = acl_init(1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assert((void *)acl != NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, acl_create_entry(&acl, &aclent));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, acl_set_tag_type(aclent, ACL_EXTENDED_ALLOW));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, acl_get_permset(aclent, &permset));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, acl_add_perm(permset, ACL_READ_DATA));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, acl_add_perm(permset, ACL_WRITE_DATA));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, acl_add_perm(permset, ACL_APPEND_DATA));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, acl_add_perm(permset, ACL_EXECUTE));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, acl_set_permset(aclent, permset));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, mbr_identifier_to_uuid(ID_TYPE_UID, &uid,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sizeof(uid_t), uuid));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, acl_set_qualifier(aclent, uuid));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Create a test dir and try to set an ACL on it. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!assertMakeDir("pretest", 0755)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- func = "acl_get()";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = acl_get("pretest", 0, &acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- func = "acl_set_file()";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = acl_set_file("pretest", ACL_TYPE_EXTENDED, acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = acl_set_file("pretest", ACL_TYPE_NFS4, acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (n != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (errno == ENOSYS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (errno == EOPNOTSUPP || errno == EINVAL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- skipping("NFS4 ACL is not supported on this filesystem");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("%s: errno = %d (%s)", func, errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertMakeFile("pretest", 0644, "a");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl->acl_type != ACE_T) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- skipping("NFS4 ACL is not supported on this filesystem");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (setTestAcl("pretest") != ARCHIVE_TEST_ACL_TYPE_NFS4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ skipping("NFS4 ACLs are not writable on this filesystem");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Create a write-to-disk object. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assert(NULL != (a = archive_write_disk_new()));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -848,63 +921,115 @@ DEFINE_TEST(test_acl_platform_nfs4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Verify the data on disk. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertEqualInt(0, stat("testall", &st));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertEqualInt(st.st_mtime, 123456);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = acl_get("testall", 0, &acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("acl_get(): errno = %d (%s)", errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = sunacl_get(ACE_GETACL, &aclcnt, 0, "testall");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl(\"%s\"): errno = %d (%s)", "testall", errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assert(aclp != NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl = richacl_get_file("testall");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("richacl_get_file(\"%s\"): errno = %d (%s)", "testall", errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assert(richacl != NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_DARWIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl = acl_get_file("testall", ACL_TYPE_EXTENDED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl = acl_get_file("testall", ACL_TYPE_NFS4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("acl_get_file(): errno = %d (%s)", errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get_file(\"%s\"): errno = %d (%s)", "testall", errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assert(acl != (acl_t)NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ compare_acls(aclp, aclcnt, acls_reg, "testall", 0, regcnt);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ free(aclp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ compare_acls(richacl, acls_reg, "testall", 0, regcnt);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl_free(richacl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ compare_acls(acl, acls_reg, "testall", 0, regcnt);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Verify single-permission dirs on disk. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (i = 0; i < dircnt; ++i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sprintf(buff, "dir%d", i);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertEqualInt(0, stat(buff, &st));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertEqualInt(st.st_mtime, 123456 + i);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = acl_get(buff, 0, &acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("acl_get(): errno = %d (%s)", errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = sunacl_get(ACE_GETACL, &aclcnt, 0, buff);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl(\"%s\"): errno = %d (%s)", buff, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assert(aclp != NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl = richacl_get_file(buff);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* First and last two dir do not return a richacl */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((i == 0 || i >= dircnt - 2) && richacl == NULL &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ errno == ENODATA)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("richacl_get_file(\"%s\"): errno = %d (%s)", buff,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assert(richacl != NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_DARWIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl = acl_get_file(buff, ACL_TYPE_EXTENDED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl = acl_get_file(buff, ACL_TYPE_NFS4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("acl_get_file(): errno = %d (%s)", errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get_file(\"%s\"): errno = %d (%s)", buff, errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assert(acl != (acl_t)NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ compare_acls(aclp, aclcnt, acls_dir, buff, i, i + 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ free(aclp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ compare_acls(richacl, acls_dir, buff, i, i + 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl_free(richacl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ compare_acls(acl, acls_dir, buff, i, i + 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Verify "dirall" on disk. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertEqualInt(0, stat("dirall", &st));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertEqualInt(st.st_mtime, 123456);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = acl_get("dirall", 0, &acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("acl_get(): errno = %d (%s)", errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = sunacl_get(ACE_GETACL, &aclcnt, 0, "dirall");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl(\"%s\"): errno = %d (%s)", "dirall", errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assert(aclp != NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl = richacl_get_file("dirall");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("richacl_get_file(\"%s\"): errno = %d (%s)", "dirall",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assert(richacl != NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_DARWIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl = acl_get_file("dirall", ACL_TYPE_EXTENDED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl = acl_get_file("dirall", ACL_TYPE_NFS4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("acl_get_file(): errno = %d (%s)", errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get_file(\"%s\"): errno = %d (%s)", "dirall", errno,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assert(acl != (acl_t)NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ compare_acls(aclp, aclcnt, acls_dir, "dirall", 0, dircnt);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ free(aclp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ compare_acls(richacl, acls_dir, "dirall", 0, dircnt);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl_free(richacl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ compare_acls(acl, acls_dir, "dirall", 0, dircnt);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Read and compare ACL via archive_read_disk */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ a = archive_read_disk_new();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -929,5 +1054,5 @@ DEFINE_TEST(test_acl_platform_nfs4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ compare_entry_acls(ae, acls_dir, "dirall", 0, acls_dir_cnt);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_entry_free(ae);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_NFS4_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_NFS4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/test/test_acl_platform_posix1e.c b/libarchive/test/test_acl_platform_posix1e.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index b46f6581..801a7acf 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/test/test_acl_platform_posix1e.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/test/test_acl_platform_posix1e.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -26,7 +26,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "test.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ __FBSDID("$FreeBSD: head/lib/libarchive/test/test_acl_freebsd.c 189427 2009-03-06 04:21:23Z kientzle $");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_POSIX_ACL || HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_POSIX1E
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if HAVE_ACL_GET_PERM
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <acl/libacl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -55,18 +55,18 @@ static struct archive_test_acl_t acls2[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_entry_get_perm(aclent_t *aclent)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_entry_get_perm(acl_entry_t aclent)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int permset = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_POSIX_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_LIBACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_permset_t opaque_ps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (aclent->a_perm & 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (aclent->a_perm & 2)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -127,114 +127,108 @@ acl_get_specific_entry(acl_t acl, acl_tag_t requested_tag_type, int requested_ta
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_match(aclent_t *aclent, struct archive_test_acl_t *myacl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (myacl->permset != acl_entry_get_perm(aclent))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (aclent->a_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case DEF_USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ) return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((uid_t)myacl->qual != aclent->a_id)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case DEF_GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP_OBJ) return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case DEF_GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((gid_t)myacl->qual != aclent->a_id)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case DEF_CLASS_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case CLASS_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (myacl->tag != ARCHIVE_ENTRY_ACL_MASK) return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case DEF_OTHER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case OTHER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (myacl->tag != ARCHIVE_ENTRY_ACL_OTHER) return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else /* ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_LIBACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_match(acl_entry_t aclent, struct archive_test_acl_t *myacl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_POSIX_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ gid_t g, *gp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ uid_t u, *up;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_tag_t tag_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (myacl->permset != acl_entry_get_perm(aclent))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- switch (aclent->a_type)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_get_tag_type(aclent, &tag_type);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- switch (tag_type)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case DEF_USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (tag_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case ACL_USER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ) return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case DEF_USER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case USER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case ACL_USER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((uid_t)myacl->qual != aclent->a_id)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ up = acl_get_qualifier(aclent);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ u = *up;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_free(up);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((uid_t)myacl->qual != u)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case DEF_GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case ACL_GROUP_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP_OBJ) return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case DEF_GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case ACL_GROUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((gid_t)myacl->qual != aclent->a_id)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ gp = acl_get_qualifier(aclent);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ g = *gp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_free(gp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((gid_t)myacl->qual != g)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case DEF_CLASS_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case CLASS_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case ACL_MASK:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (myacl->tag != ARCHIVE_ENTRY_ACL_MASK) return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case DEF_OTHER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case OTHER_OBJ:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case ACL_OTHER:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (myacl->tag != ARCHIVE_ENTRY_ACL_OTHER) return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-compare_acls(acl_t *acl, struct archive_test_acl_t *myacls, int n)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++compare_acls(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ void *aclp, int aclcnt,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-compare_acls(acl_t acl, struct archive_test_acl_t *myacls, int n)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_t acl,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct archive_test_acl_t *myacls, int n)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int *marker;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int matched;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int e;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ aclent_t *acl_entry;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -253,9 +247,9 @@ compare_acls(acl_t acl, struct archive_test_acl_t *myacls, int n)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Iterate over acls in system acl object, try to match each
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * one with an item in the myacls array.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for(e = 0; e < acl->acl_cnt; e++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_entry = &((aclent_t *)acl->acl_aclp)[e];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for(e = 0; e < aclcnt; e++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_entry = &((aclent_t *)aclp)[e];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ while (1 == acl_get_entry(acl, entry_id, &acl_entry)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* After the first time... */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -288,99 +282,33 @@ compare_acls(acl_t acl, struct archive_test_acl_t *myacls, int n)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ free(marker);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Verify ACL restore-to-disk. This test is Platform-specific.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DEFINE_TEST(test_acl_platform_posix1e_restore)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_SUN_ACL && !HAVE_POSIX_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !ARCHIVE_ACL_POSIX1E
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ skipping("POSIX.1e ACLs are not supported on this platform");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else /* HAVE_SUN_ACL || HAVE_POSIX_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else /* ARCHIVE_ACL_POSIX1E */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct stat st;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct archive *a;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct archive_entry *ae;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int n, fd;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- char *func;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_t *acl, *acl2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ void *aclp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int aclcnt;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_t acl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * First, do a quick manual set/read of ACL data to
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * verify that the local filesystem does support ACLs.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * If it doesn't, we'll simply skip the remaining tests.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = acl_fromtext("user::rwx,user:1:rw-,group::rwx,group:15:r-x,other:rwx,mask:rwx", &acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("acl_fromtext(): errno = %d (%s)", errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl = acl_from_text("u::rwx,u:1:rw,g::rwx,g:15:rx,o::rwx,m::rwx");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("acl_from_text(): errno = %d (%s)", errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assert((void *)acl != NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /* Create a test file and try ACL on it. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- fd = open("pretest", O_WRONLY | O_CREAT | O_EXCL, 0777);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("Could not create test file?!");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!assert(fd >= 0)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = facl_get(fd, 0, &acl2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (n != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- close(fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (errno == ENOSYS) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- skipping("POSIX.1e ACLs are not supported on this filesystem");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("facl_get(): errno = %d (%s)", errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertMakeFile("pretest", 0644, "a");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl2->acl_type != ACLENT_T) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- skipping("POSIX.1e ACLs are not supported on this filesystem");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (setTestAcl("pretest") != ARCHIVE_TEST_ACL_TYPE_POSIX1E) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ skipping("POSIX.1e ACLs are not writable on this filesystem");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- func = "facl_set()";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = facl_set(fd, acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- func = "acl_set_fd()";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = acl_set_fd(fd, acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (n != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (errno == ENOSYS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (errno == EOPNOTSUPP || errno == EINVAL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- close(fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- skipping("POSIX.1e ACLs are not supported on this filesystem");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("%s: errno = %d (%s)", func, errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- close(fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Create a write-to-disk object. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assert(NULL != (a = archive_write_disk_new()));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -404,18 +332,25 @@ DEFINE_TEST(test_acl_platform_posix1e_restore)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Verify the data on disk. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertEqualInt(0, stat("test0", &st));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertEqualInt(st.st_mtime, 123456);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = acl_get("test0", 0, &acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("acl_get(): errno = %d (%s)", errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = sunacl_get(GETACL, &aclcnt, 0, "test0");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl(): errno = %d (%s)", errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assert(aclp != NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl = acl_get_file("test0", ACL_TYPE_ACCESS);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ failure("acl_get_file(): errno = %d (%s)", errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assert(acl != (acl_t)NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ compare_acls(aclp, aclcnt, acls2, sizeof(acls2)/sizeof(acls2[0]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ free(aclp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ compare_acls(acl, acls2, sizeof(acls2)/sizeof(acls2[0]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif /* HAVE_SUN_ACL || HAVE_POSIX_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_POSIX1E */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -423,16 +358,17 @@ DEFINE_TEST(test_acl_platform_posix1e_restore)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DEFINE_TEST(test_acl_platform_posix1e_read)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !HAVE_SUN_ACL && !HAVE_POSIX_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !ARCHIVE_ACL_POSIX1E
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ skipping("POSIX.1e ACLs are not supported on this platform");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else /* ARCHIVE_ACL_POSIX1E */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct archive *a;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct archive_entry *ae;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int n, fd, flags, dflags;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char *func, *acl_text;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const char *acl1_text, *acl2_text, *acl3_text;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_t *acl, *acl1, *acl2, *acl3;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ void *aclp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int aclcnt;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_t acl1, acl2, acl3;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -444,16 +380,21 @@ DEFINE_TEST(test_acl_platform_posix1e_read)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Create a test file f1 with acl1 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl1_text = "user::rwx,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "group::rwx,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "other:rwx,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "user:1:rw-,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "group:15:r-x,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "mask:rwx";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = acl_fromtext(acl1_text, &acl1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("acl_fromtext(): errno = %d (%s)", errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent_t aclp1[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { USER_OBJ, -1, 4 | 2 | 1 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { USER, 1, 4 | 2 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { GROUP_OBJ, -1, 4 | 2 | 1 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { GROUP, 15, 4 | 1 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { CLASS_OBJ, -1, 4 | 2 | 1 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { OTHER_OBJ, -1, 4 | 2 | 1 }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl1_text = "user::rwx\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "group::rwx\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -468,41 +409,36 @@ DEFINE_TEST(test_acl_platform_posix1e_read)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fd = open("f1", O_WRONLY | O_CREAT | O_EXCL, 0777);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ failure("Could not create test file?!");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!assert(fd >= 0)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_free(acl1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Check if Solaris filesystem supports POSIX.1e ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = facl_get(fd, 0, &acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (n != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = sunacl_get(GETACL, &aclcnt, fd, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclp == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ close(fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (n != 0 && errno == ENOSYS) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (errno == ENOSYS || errno == ENOTSUP) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ skipping("POSIX.1e ACLs are not supported on this filesystem");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("facl_get(): errno = %d (%s)", errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("facl(): errno = %d (%s)", errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assert(aclp != NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (acl->acl_type != ACLENT_T) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acl_free(acl1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- close(fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- skipping("POSIX.1e ACLs are not supported on this filesystem");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- func = "facl_set()";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = facl_set(fd, acl1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ func = "facl()";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ n = facl(fd, SETACL, (int)(sizeof(aclp1)/sizeof(aclp1[0])), aclp1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ func = "acl_set_fd()";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ n = acl_set_fd(fd, acl1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_free(acl1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (n != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (errno == ENOSYS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (errno == ENOSYS || errno == ENOTSUP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (errno == EOPNOTSUPP || errno == EINVAL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -530,16 +466,21 @@ DEFINE_TEST(test_acl_platform_posix1e_read)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * to read ACLs, resulting in reading the ACL from a like-named
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * file in the wrong directory.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl2_text = "user::rwx,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "group::rwx,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "other:---,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "user:1:r--,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "group:15:r--,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "mask:rwx";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = acl_fromtext(acl2_text, &acl2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("acl_fromtext(): errno = %d (%s)", errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent_t aclp2[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { USER_OBJ, -1, 4 | 2 | 1 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { USER, 1, 4 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { GROUP_OBJ, -1, 4 | 2 | 1},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { GROUP, 15, 4 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { CLASS_OBJ, -1, 4 | 2 | 1},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { OTHER_OBJ, -1, 0 }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl2_text = "user::rwx\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "group::rwx\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -554,17 +495,19 @@ DEFINE_TEST(test_acl_platform_posix1e_read)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fd = open("d/f1", O_WRONLY | O_CREAT | O_EXCL, 0777);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ failure("Could not create test file?!");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!assert(fd >= 0)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_free(acl2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- func = "facl_set()";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = facl_set(fd, acl2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ func = "facl()";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ n = facl(fd, SETACL, (int)(sizeof(aclp2) / sizeof(aclp2[0])), aclp2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ func = "acl_set_fd()";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ n = acl_set_fd(fd, acl2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_free(acl2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (n != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ close(fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ failure("%s: errno = %d (%s)", func, errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -574,7 +517,7 @@ DEFINE_TEST(test_acl_platform_posix1e_read)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Create nested directory d2 with default ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertMakeDir("d/d2", 0755);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl3_text = "user::rwx,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "group::r-x,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "other:r-x,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -587,9 +530,20 @@ DEFINE_TEST(test_acl_platform_posix1e_read)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "default:group:15:r--,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "default:mask:rwx,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "default:other:r-x";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = acl_fromtext(acl3_text, &acl3);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- failure("acl_fromtext(): errno = %d (%s)", errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertEqualInt(0, n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent_t aclp3[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { USER_OBJ, -1, 4 | 2 | 1 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { USER, 2, 4 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { GROUP_OBJ, -1, 4 | 1 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { GROUP, 16, 2 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { CLASS_OBJ, -1, 4 | 2 | 1 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { OTHER_OBJ, -1, 4 | 1 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { USER_OBJ | ACL_DEFAULT, -1, 4 | 2 | 1 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { USER | ACL_DEFAULT, 1, 4 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { GROUP_OBJ | ACL_DEFAULT, -1, 4 | 1 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { GROUP | ACL_DEFAULT, 15, 4 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { CLASS_OBJ | ACL_DEFAULT, -1, 4 | 2 | 1},
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { OTHER_OBJ | ACL_DEFAULT, -1, 4 | 1 }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl3_text = "user::rwx\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "user:1:r--\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -602,15 +556,14 @@ DEFINE_TEST(test_acl_platform_posix1e_read)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assert((void *)acl3 != NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- func = "acl_set()";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n = acl_set("d/d2", acl3);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ func = "acl()";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ n = acl("d/d2", SETACL, (int)(sizeof(aclp3) / sizeof(aclp3[0])), aclp3);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ func = "acl_set_file()";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ n = acl_set_file("d/d2", ACL_TYPE_DEFAULT, acl3);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ acl_free(acl3);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ failure("%s: errno = %d (%s)", func, errno, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertEqualInt(0, n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -619,7 +572,7 @@ DEFINE_TEST(test_acl_platform_posix1e_read)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertEqualIntA(a, ARCHIVE_OK, archive_read_disk_open(a, "."));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assert(NULL != (ae = archive_entry_new()));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ flags = ARCHIVE_ENTRY_ACL_TYPE_POSIX1E
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ | ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ | ARCHIVE_ENTRY_ACL_STYLE_SOLARIS;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -649,5 +602,5 @@ DEFINE_TEST(test_acl_platform_posix1e_read)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_entry_free(ae);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertEqualInt(ARCHIVE_OK, archive_free(a));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_POSIX1E */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/test/test_read_disk_directory_traversals.c b/libarchive/test/test_read_disk_directory_traversals.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index fdbfbec9..705b3d98 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/test/test_read_disk_directory_traversals.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/test/test_read_disk_directory_traversals.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1231,8 +1231,8 @@ test_restore_atime(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Test4: Traversals with ARCHIVE_READDISK_RESTORE_ATIME and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ARCHIVE_READDISK_HONOR_NODUMP
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertNodump("at/f1");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertNodump("at/f2");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertSetNodump("at/f1");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertSetNodump("at/f2");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertUtimes("at/f1", 886600, 0, 886600, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertUtimes("at/f2", 886611, 0, 886611, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertUtimes("at/fe", 886611, 0, 886611, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1450,7 +1450,7 @@ test_nodump(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertMakeFile("nd/f1", 0644, "0123456789");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertMakeFile("nd/f2", 0644, "hello world");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertMakeFile("nd/fe", 0644, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertNodump("nd/f2");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertSetNodump("nd/f2");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertUtimes("nd/f1", 886600, 0, 886600, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertUtimes("nd/f2", 886611, 0, 886611, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertUtimes("nd/fe", 886611, 0, 886611, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/tar/bsdtar.1 b/tar/bsdtar.1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index b60f09c5..0537bf36 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/tar/bsdtar.1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/tar/bsdtar.1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -25,7 +25,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\" $FreeBSD$
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .\"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Dd February 24, 2017
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Dd February 25, 2017
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Dt TAR 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Os
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Sh NAME
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -450,14 +450,7 @@ This is the reverse of
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Fl p
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ and the default behavior if
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-is run as non-root and can be overridden by also specifying
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fl Fl acls ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fl Fl fflags ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fl Fl mac-metadata,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fl Fl same-owner ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fl Fl same-permissions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fl Fl xattrs .
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++is run as non-root.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .It Fl Fl no-xattrs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (c, r, u, x modes only)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Do not archive or extract extended attributes. This is the reverse of
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -647,16 +640,16 @@ This option suppresses these behaviors.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (x mode only)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Preserve file permissions.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Attempt to restore the full permissions, including owner, file modes, ACLs,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-extended atributes and extended file flags, if available, for each item
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-extracted from the archive. This is the default, if
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++extended attributes and extended file flags, if available, for each item
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++extracted from the archive. This is te reverse of
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Fl Fl no-same-permissions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++and the default if
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Nm
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-is being run by root and can be overridden by also specifying
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++is being run by root and can be partially overridden by also specifying
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Fl Fl no-acls ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Fl Fl no-fflags ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fl Fl no-mac-metadata,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fl Fl no-same-owner ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Fl Fl no-same-permissions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++.Fl Fl no-mac-metadata
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++or
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .Fl Fl no-xattrs .
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .It Fl Fl passphrase Ar passphrase
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ The
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/tar/bsdtar.c b/tar/bsdtar.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index a9252a5c..9fc68332 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/tar/bsdtar.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/tar/bsdtar.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -118,11 +118,11 @@ need_report(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static void long_help(void);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void long_help(void) __LA_DEAD;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void only_mode(struct bsdtar *, const char *opt,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const char *valid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void set_mode(struct bsdtar *, char opt);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static void version(void);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void version(void) __LA_DEAD;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* A basic set of security flags to request from libarchive. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define SECURITY \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/tar/bsdtar.h b/tar/bsdtar.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index ee9c6485..10a2cf2f 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/tar/bsdtar.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/tar/bsdtar.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -189,7 +189,7 @@ void do_chdir(struct bsdtar *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int edit_pathname(struct bsdtar *, struct archive_entry *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int need_report(void);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int pathcmp(const char *a, const char *b);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-void safe_fprintf(FILE *, const char *fmt, ...);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++void safe_fprintf(FILE *, const char *fmt, ...) __LA_PRINTF(2, 3);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void set_chdir(struct bsdtar *, const char *newdir);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const char *tar_i64toa(int64_t);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void tar_mode_c(struct bsdtar *bsdtar);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -197,8 +197,8 @@ void tar_mode_r(struct bsdtar *bsdtar);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void tar_mode_t(struct bsdtar *bsdtar);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void tar_mode_u(struct bsdtar *bsdtar);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void tar_mode_x(struct bsdtar *bsdtar);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-void usage(void);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-int yes(const char *fmt, ...);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++void usage(void) __LA_DEAD;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int yes(const char *fmt, ...) __LA_PRINTF(1, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void add_substitution(struct bsdtar *, const char *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/tar/test/CMakeLists.txt b/tar/test/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 3dd36019..318eb06e 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/tar/test/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/tar/test/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -34,9 +34,11 @@ IF(ENABLE_TAR AND ENABLE_TEST)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test_option_U_upper.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test_option_X_upper.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test_option_a.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ test_option_acls.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test_option_b.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test_option_b64encode.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test_option_exclude.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ test_option_fflags.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test_option_gid_gname.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test_option_grzip.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test_option_j.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -71,6 +73,16 @@ IF(ENABLE_TAR AND ENABLE_TEST)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Register target
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ADD_EXECUTABLE(bsdtar_test ${bsdtar_test_SOURCES})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(ENABLE_ACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SET(TEST_ACL_LIBS "")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_LIBACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND TEST_ACL_LIBS ${ACL_LIBRARY})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF(HAVE_LIBACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ IF(HAVE_LIBRICHACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ LIST(APPEND TEST_ACL_LIBS ${RICHACL_LIBRARY})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF(HAVE_LIBRICHACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ TARGET_LINK_LIBRARIES(bsdtar_test ${TEST_ACL_LIBS})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ENDIF(ENABLE_ACL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ SET_PROPERTY(TARGET bsdtar_test PROPERTY COMPILE_DEFINITIONS LIST_H)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/tar/test/test_option_acls.c b/tar/test/test_option_acls.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 00000000..bfe2b994
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/tar/test/test_option_acls.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,469 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2017 Martin Matuska
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "test.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++__FBSDID("$FreeBSD$");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_POSIX_ACL || HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static const acl_perm_t acl_perms[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_READ_DATA,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_LIST_DIRECTORY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_WRITE_DATA,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ADD_FILE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_EXECUTE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_SEARCH,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_DELETE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_APPEND_DATA,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ADD_SUBDIRECTORY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_DELETE_CHILD,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_READ_ATTRIBUTES,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_WRITE_ATTRIBUTES,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_READ_EXTATTRIBUTES,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_WRITE_EXTATTRIBUTES,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_READ_SECURITY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_WRITE_SECURITY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_CHANGE_OWNER,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_SYNCHRONIZE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else /* !HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_EXECUTE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_WRITE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_READ,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_FREEBSD_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_READ_DATA,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_LIST_DIRECTORY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_WRITE_DATA,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ADD_FILE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_APPEND_DATA,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ADD_SUBDIRECTORY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_READ_NAMED_ATTRS,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_WRITE_NAMED_ATTRS,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_DELETE_CHILD,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_READ_ATTRIBUTES,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_WRITE_ATTRIBUTES,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_DELETE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_READ_ACL,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_WRITE_ACL,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_WRITE_OWNER,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_SYNCHRONIZE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* HAVE_FREEBSD_NFS4_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* !HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_DARWIN_ACL || HAVE_FREEBSD_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static const acl_flag_t acl_flags[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ENTRY_INHERITED,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ENTRY_FILE_INHERIT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ENTRY_DIRECTORY_INHERIT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ENTRY_LIMIT_INHERIT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ENTRY_ONLY_INHERIT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else /* HAVE_FREEBSD_NFS4_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ENTRY_FILE_INHERIT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ENTRY_DIRECTORY_INHERIT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ENTRY_NO_PROPAGATE_INHERIT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ENTRY_INHERIT_ONLY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ENTRY_SUCCESSFUL_ACCESS,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ENTRY_FAILED_ACCESS,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_ENTRY_INHERITED
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* HAVE_FREEBSD_NFS4_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* HAVE_DARWIN_ACL || HAVE_FREEBSD_NFS4_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Compare two ACL entries on FreeBSD or on Mac OS X
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++compare_acl_entry(acl_entry_t ae_a, acl_entry_t ae_b, int is_nfs4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_tag_t tag_a, tag_b;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_permset_t permset_a, permset_b;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int perm_a, perm_b, perm_start, perm_end;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ void *qual_a, *qual_b;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_FREEBSD_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_entry_type_t type_a, type_b;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_FREEBSD_NFS4_ACL || HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_flagset_t flagset_a, flagset_b;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int flag_a, flag_b;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int i, r;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Compare ACL tag */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_get_tag_type(ae_a, &tag_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get_tag_type() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assertEqualInt(r, 0) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_get_tag_type(ae_b, &tag_b);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get_tag_type() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assertEqualInt(r, 0) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (tag_a != tag_b)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Compare ACL qualifier */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (tag_a == ACL_EXTENDED_ALLOW || tag_b == ACL_EXTENDED_DENY)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (tag_a == ACL_USER || tag_a == ACL_GROUP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ qual_a = acl_get_qualifier(ae_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get_qualifier() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assert(qual_a != NULL) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ qual_b = acl_get_qualifier(ae_b);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get_qualifier() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assert(qual_b != NULL) == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(qual_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (memcmp(((guid_t *)qual_a)->g_guid,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ((guid_t *)qual_b)->g_guid, KAUTH_GUID_SIZE) != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((tag_a == ACL_USER &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (*(uid_t *)qual_a != *(uid_t *)qual_b)) ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (tag_a == ACL_GROUP &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (*(gid_t *)qual_a != *(gid_t *)qual_b)))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(qual_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(qual_b);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(qual_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(qual_b);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_FREEBSD_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (is_nfs4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Compare NFS4 ACL type */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_get_entry_type_np(ae_a, &type_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get_entry_type_np() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assertEqualInt(r, 0) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_get_entry_type_np(ae_b, &type_b);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get_entry_type_np() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assertEqualInt(r, 0) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (type_a != type_b)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Compare ACL perms */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_get_permset(ae_a, &permset_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get_permset() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assertEqualInt(r, 0) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_get_permset(ae_b, &permset_b);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get_permset() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assertEqualInt(r, 0) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_start = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_end = (int)(sizeof(acl_perms) / sizeof(acl_perms[0]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_FREEBSD_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (is_nfs4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_start = 3;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_end = 3;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Cycle through all perms and compare their value */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = perm_start; i < perm_end; i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_LIBACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_a = acl_get_perm(permset_a, acl_perms[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_b = acl_get_perm(permset_b, acl_perms[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_a = acl_get_perm_np(permset_a, acl_perms[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ perm_b = acl_get_perm_np(permset_b, acl_perms[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (perm_a == -1 || perm_b == -1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (perm_a != perm_b)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_FREEBSD_NFS4_ACL || HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (is_nfs4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_get_flagset_np(ae_a, &flagset_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get_flagset_np() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assertEqualInt(r, 0) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_get_flagset_np(ae_b, &flagset_b);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get_flagset_np() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assertEqualInt(r, 0) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Cycle through all flags and compare their status */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < (int)(sizeof(acl_flags) / sizeof(acl_flags[0]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ flag_a = acl_get_flag_np(flagset_a, acl_flags[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ flag_b = acl_get_flag_np(flagset_b, acl_flags[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (flag_a == -1 || flag_b == -1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (flag_a != flag_b)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else /* HAVE_FREEBSD_NFS4_ACL || HAVE_DARWIN_ACL*/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)is_nfs4; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* HAVE_POSIX_ACL || HAVE_DARWIN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_SUN_ACL || HAVE_DARWIN_ACL || HAVE_POSIX_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Clear default ACLs or inheritance flags
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++clear_inheritance_flags(const char *path, int type)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_TEST_ACL_TYPE_POSIX1E:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_POSIX_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_delete_def_file(path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Solaris */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ setTestAcl(path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case ARCHIVE_TEST_ACL_TYPE_NFS4:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ setTestAcl(path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)path; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++compare_acls(const char *path_a, const char *path_b)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ret = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int is_nfs4 = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ void *acl_a, *acl_b;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int aclcnt_a, aclcnt_b;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent_t *aclent_a, *aclent_b;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace_t *ace_a, *ace_b;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int e;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_t acl_a, acl_b;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_entry_t aclent_a, aclent_b;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int a, b, r;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_a = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_b = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_a = sunacl_get(GETACL, &aclcnt_a, 0, path_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_a == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_SUN_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ is_nfs4 = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_a = sunacl_get(ACE_GETACL, &aclcnt_a, 0, path_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assert(acl_a != NULL) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_SUN_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_b = sunacl_get(ACE_GETACL, &aclcnt_b, 0, path_b);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_b = sunacl_get(GETACL, &aclcnt_b, 0, path_b);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_b == NULL && (errno == ENOSYS || errno == ENOTSUP)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ free(acl_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assert(acl_b != NULL) == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ free(acl_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclcnt_a != aclcnt_b) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (e = 0; e < aclcnt_a; e++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!is_nfs4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent_a = &((aclent_t *)acl_a)[e];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent_b = &((aclent_t *)acl_b)[e];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclent_a->a_type != aclent_b->a_type ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent_a->a_id != aclent_b->a_id ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent_a->a_perm != aclent_b->a_perm) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_SUN_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace_a = &((ace_t *)acl_a)[e];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace_b = &((ace_t *)acl_b)[e];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ace_a->a_who != ace_b->a_who ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace_a->a_access_mask != ace_b->a_access_mask ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace_a->a_flags != ace_b->a_flags ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace_a->a_type != ace_b->a_type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ is_nfs4 = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_a = acl_get_file(path_a, ACL_TYPE_EXTENDED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif HAVE_FREEBSD_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_a = acl_get_file(path_a, ACL_TYPE_NFS4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_a != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ is_nfs4 = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_a == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_a = acl_get_file(path_a, ACL_TYPE_ACCESS);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get_file() error: %s (%s)", path_a, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assert(acl_a != NULL) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_b = acl_get_file(path_b, ACL_TYPE_EXTENDED);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif HAVE_FREEBSD_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_b = acl_get_file(path_b, ACL_TYPE_NFS4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acl_b == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_FREEBSD_NFS4_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (is_nfs4) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_b = acl_get_file(path_b, ACL_TYPE_ACCESS);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get_file() error: %s (%s)", path_b, strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assert(acl_b != NULL) == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ a = acl_get_entry(acl_a, ACL_FIRST_ENTRY, &aclent_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (a == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ b = acl_get_entry(acl_b, ACL_FIRST_ENTRY, &aclent_b);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (b == -1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (a == 0 && b == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else /* FreeBSD, Linux */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (a == 1 && b == 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = compare_acl_entry(aclent_a, aclent_b, is_nfs4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r != 1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = r;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto exit_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ a = acl_get_entry(acl_a, ACL_NEXT_ENTRY, &aclent_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ b = acl_get_entry(acl_b, ACL_NEXT_ENTRY, &aclent_b);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Entry count must match */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (a != b)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ret = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* !HAVE_SUN_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++exit_free:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_SUN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ free(acl_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ free(acl_b);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl_a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl_b);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* HAVE_SUN_ACL || HAVE_DARWIN_ACL || HAVE_POSIX_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++DEFINE_TEST(test_option_acls)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !HAVE_SUN_ACL && !HAVE_DARWIN_ACL && !HAVE_POSIX_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ skipping("ACLs are not supported on this platform");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else /* HAVE_SUN_ACL || HAVE_DARWIN_ACL || HAVE_POSIX_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int acltype, r;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertMakeFile("f", 0644, "a");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acltype = setTestAcl("f");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (acltype == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ skipping("Can't write ACLs on the filesystem");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Archive it with acls */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = systemf("%s -c --no-mac-metadata --acls -f acls.tar f >acls.out 2>acls.err", testprog);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertEqualInt(r, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Archive it without acls */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = systemf("%s -c --no-mac-metadata --no-acls -f noacls.tar f >noacls.out 2>noacls.err", testprog);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertEqualInt(r, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Extract acls with acls */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertMakeDir("acls_acls", 0755);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ clear_inheritance_flags("acls_acls", acltype);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = systemf("%s -x -C acls_acls --no-same-permissions --acls -f acls.tar >acls_acls.out 2>acls_acls.err", testprog);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertEqualInt(r, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = compare_acls("f", "acls_acls/f");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertEqualInt(r, 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Extractl acls without acls */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertMakeDir("acls_noacls", 0755);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ clear_inheritance_flags("acls_noacls", acltype);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = systemf("%s -x -C acls_noacls -p --no-acls -f acls.tar >acls_noacls.out 2>acls_noacls.err", testprog);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertEqualInt(r, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = compare_acls("f", "acls_noacls/f");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertEqualInt(r, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Extract noacls with acls flag */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertMakeDir("noacls_acls", 0755);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ clear_inheritance_flags("noacls_acls", acltype);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = systemf("%s -x -C noacls_acls --no-same-permissions --acls -f noacls.tar >noacls_acls.out 2>noacls_acls.err", testprog);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertEqualInt(r, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = compare_acls("f", "noacls_acls/f");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertEqualInt(r, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Extract noacls with noacls */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertMakeDir("noacls_noacls", 0755);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ clear_inheritance_flags("noacls_noacls", acltype);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = systemf("%s -x -C noacls_noacls -p --no-acls -f noacls.tar >noacls_noacls.out 2>noacls_noacls.err", testprog);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertEqualInt(r, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = compare_acls("f", "noacls_noacls/f");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertEqualInt(r, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* HAVE_SUN_ACL || HAVE_DARWIN_ACL || HAVE_POSIX_ACL */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/tar/test/test_option_fflags.c b/tar/test/test_option_fflags.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 00000000..77a4e3e1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/tar/test/test_option_fflags.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,106 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Copyright (c) 2017 Martin Matuska
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * notice, this list of conditions and the following disclaimer in the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * documentation and/or other materials provided with the distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "test.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++__FBSDID("$FreeBSD$");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++clear_fflags(const char *pathname)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(HAVE_STRUCT_STAT_ST_FLAGS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ chflags(pathname, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif (defined(FS_IOC_GETFLAGS) && defined(HAVE_WORKING_FS_IOC_GETFLAGS)) || \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int fd;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fd = open(pathname, O_RDONLY | O_NONBLOCK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (fd < 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ioctl(fd,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef FS_IOC_GETFLAGS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ FS_IOC_GETFLAGS,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXT2_IOC_GETFLAGS,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)pathname; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++DEFINE_TEST(test_option_fflags)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int r;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!canNodump()) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ skipping("Can't test nodump flag on this filesystem");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Create a file. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertMakeFile("f", 0644, "a");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Set nodump flag on the file */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertSetNodump("f");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* FreeBSD ZFS workaround: ZFS sets uarch on all touched files and dirs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ chmod("f", 0644);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Archive it with fflags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = systemf("%s -c --fflags -f fflags.tar f >fflags.out 2>fflags.err", testprog);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertEqualInt(r, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Archive it without fflags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = systemf("%s -c --no-fflags -f nofflags.tar f >nofflags.out 2>nofflags.err", testprog);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertEqualInt(r, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Extract fflags with fflags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertMakeDir("fflags_fflags", 0755);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ clear_fflags("fflags_fflags");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = systemf("%s -x -C fflags_fflags --no-same-permissions --fflags -f fflags.tar >fflags_fflags.out 2>fflags_fflags.err", testprog);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertEqualInt(r, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertEqualFflags("f", "fflags_fflags/f");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Extract fflags without fflags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertMakeDir("fflags_nofflags", 0755);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ clear_fflags("fflags_nofflags");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = systemf("%s -x -C fflags_nofflags -p --no-fflags -f fflags.tar >fflags_nofflags.out 2>fflags_nofflags.err", testprog);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertEqualInt(r, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertUnequalFflags("f", "fflags_nofflags/f");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Extract nofflags with fflags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertMakeDir("nofflags_fflags", 0755);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ clear_fflags("nofflags_fflags");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = systemf("%s -x -C nofflags_fflags --no-same-permissions --fflags -f nofflags.tar >nofflags_fflags.out 2>nofflags_fflags.err", testprog);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertEqualInt(r, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertUnequalFflags("f", "nofflags_fflags/f");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Extract nofflags with nofflags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertMakeDir("nofflags_nofflags", 0755);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ clear_fflags("nofflags_nofflags");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = systemf("%s -x -C nofflags_nofflags -p --no-fflags -f nofflags.tar >nofflags_nofflags.out 2>nofflags_nofflags.err", testprog);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertEqualInt(r, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertUnequalFflags("f", "nofflags_nofflags/f");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/tar/test/test_option_nodump.c b/tar/test/test_option_nodump.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 768f64a6..815b08ed 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/tar/test/test_option_nodump.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/tar/test/test_option_nodump.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -36,7 +36,7 @@ DEFINE_TEST(test_option_nodump)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertMakeFile("file1", 0644, "file1");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertMakeFile("file2", 0644, "file2");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertMakeFile("file3", 0644, "file3");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertNodump("file2");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertSetNodump("file2");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Test 1: Without --nodump */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertEqualInt(0, systemf("%s -cf test1.tar file1 file2 file3",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/test_utils/test_common.h b/test_utils/test_common.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 82e8483f..43cbc5ed 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/test_utils/test_common.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/test_utils/test_common.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -73,6 +73,12 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <unistd.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <wchar.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_ACL_LIBACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <acl/libacl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef HAVE_WINDOWS_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <windows.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -121,31 +127,10 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define O_BINARY 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * If this platform has <sys/acl.h>, acl_create(), acl_init(),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * acl_set_file(), and ACL_USER, we assume it has the rest of the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * POSIX.1e draft functions used in archive_read_extract.c.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SYS_ACL_H && HAVE_ACL_CREATE_ENTRY && HAVE_ACL_INIT && HAVE_ACL_SET_FILE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_ACL_USER
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define HAVE_POSIX_ACL 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif HAVE_ACL_TYPE_EXTENDED
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define HAVE_DARWIN_ACL 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * If this platform has <sys/acl.h>, acl_get(), facl_get(), acl_set(),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * facl_set() and types aclent_t and ace_t it uses Solaris-style ACL functions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_SYS_ACL_H && HAVE_ACL_GET && HAVE_FACL_GET && HAVE_ACL_SET && HAVE_FACL_SET && HAVE_ACLENT_T && HAVE_ACE_T
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define HAVE_SUN_ACL 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "archive_platform_acl.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define ARCHIVE_TEST_ACL_TYPE_POSIX1E 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define ARCHIVE_TEST_ACL_TYPE_NFS4 2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/* Define if platform supports NFSv4 ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if (HAVE_POSIX_ACL && HAVE_ACL_TYPE_NFS4) || HAVE_SUN_ACL || HAVE_DARWIN_ACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define HAVE_NFS4_ACL 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Redefine DEFINE_TEST for use in defining the test functions.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -158,6 +143,9 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* chdir() and error if it fails */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define assertChdir(path) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertion_chdir(__FILE__, __LINE__, path)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Assert two files have the same file flags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define assertEqualFflags(patha, pathb) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertion_compare_fflags(__FILE__, __LINE__, patha, pathb, 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Assert two integers are the same. Reports value of each one if not. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define assertEqualInt(v1,v2) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -239,10 +227,13 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertion_make_hardlink(__FILE__, __LINE__, newfile, oldfile)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define assertMakeSymlink(newfile, linkto) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertion_make_symlink(__FILE__, __LINE__, newfile, linkto)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define assertNodump(path) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assertion_nodump(__FILE__, __LINE__, path)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define assertSetNodump(path) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertion_set_nodump(__FILE__, __LINE__, path)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define assertUmask(mask) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertion_umask(__FILE__, __LINE__, mask)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Assert that two files have unequal file flags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define assertUnequalFflags(patha, pathb) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertion_compare_fflags(__FILE__, __LINE__, patha, pathb, 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define assertUtimes(pathname, atime, atime_nsec, mtime, mtime_nsec) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assertion_utimes(__FILE__, __LINE__, pathname, atime, atime_nsec, mtime, mtime_nsec)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifndef PROGRAM
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -265,6 +256,8 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void failure(const char *fmt, ...);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int assertion_assert(const char *, int, int, const char *, void *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int assertion_chdir(const char *, int, const char *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int assertion_compare_fflags(const char *, int, const char *, const char *,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int assertion_empty_file(const char *, int, const char *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int assertion_equal_file(const char *, int, const char *, const char *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -295,8 +288,8 @@ int assertion_make_dir(const char *, int, const char *, int);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int assertion_make_file(const char *, int, const char *, int, int, const void *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int assertion_make_hardlink(const char *, int, const char *newpath, const char *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int assertion_make_symlink(const char *, int, const char *newpath, const char *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-int assertion_nodump(const char *, int, const char *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int assertion_non_empty_file(const char *, int, const char *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int assertion_set_nodump(const char *, int, const char *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int assertion_text_file_contents(const char *, int, const char *buff, const char *f);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int assertion_umask(const char *, int, int);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int assertion_utimes(const char *, int, const char *, long, long, long, long );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -347,9 +340,17 @@ int canXz(void);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Return true if this filesystem can handle nodump flags. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int canNodump(void);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Set test ACLs */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int setTestAcl(const char *path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Return true if the file has large i-node number(>0xffffffff). */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int is_LargeInode(const char *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Fetch ACLs on Solaris using acl() or facl() */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++void *sunacl_get(int cmd, int *aclcnt, int fd, const char *path);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Suck file into string allocated via malloc(). Call free() when done. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char *slurpfile(size_t *, const char *fmt, ...);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/test_utils/test_main.c b/test_utils/test_main.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 2ae6b38d..0ef6d6fc 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/test_utils/test_main.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/test_utils/test_main.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -56,6 +56,24 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <stdarg.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <time.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SIGNAL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_ACL_LIBACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <acl/libacl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_TYPES_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_ACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/acl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef HAVE_SYS_RICHACL_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/richacl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_MEMBERSHIP_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <membership.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Windows support routines
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1883,9 +1901,103 @@ assertion_utimes(const char *file, int line,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif /* defined(_WIN32) && !defined(__CYGWIN__) */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Compare file flags */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++assertion_compare_fflags(const char *file, int line, const char *patha,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *pathb, int nomatch)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct stat sa, sb;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertion_count(file, line);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (stat(patha, &sa) < 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (stat(pathb, &sb) < 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!nomatch && sa.st_flags != sb.st_flags) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure_start(file, line, "File flags should be identical: "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "%s=%#010x %s=%#010x", patha, sa.st_flags, pathb,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sb.st_flags);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure_finish(NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (nomatch && sa.st_flags == sb.st_flags) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure_start(file, line, "File flags should be different: "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "%s=%#010x %s=%#010x", patha, sa.st_flags, pathb,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sb.st_flags);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure_finish(NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif (defined(FS_IOC_GETFLAGS) && defined(HAVE_WORKING_FS_IOC_GETFLAGS) && \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ defined(FS_NODUMP_FL)) || \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ && defined(EXT2_NODUMP_FL))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int fd, r, flagsa, flagsb;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertion_count(file, line);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fd = open(patha, O_RDONLY | O_NONBLOCK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (fd < 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure_start(file, line, "Can't open %s\n", patha);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure_finish(NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = ioctl(fd,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef FS_IOC_GETFLAGS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ FS_IOC_GETFLAGS,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXT2_IOC_GETFLAGS,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &flagsa);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ close(fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r < 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure_start(file, line, "Can't get flags %s\n", patha);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure_finish(NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fd = open(pathb, O_RDONLY | O_NONBLOCK);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (fd < 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure_start(file, line, "Can't open %s\n", pathb);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure_finish(NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = ioctl(fd,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef FS_IOC_GETFLAGS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ FS_IOC_GETFLAGS,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXT2_IOC_GETFLAGS,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &flagsb);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ close(fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r < 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure_start(file, line, "Can't get flags %s\n", pathb);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure_finish(NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!nomatch && flagsa != flagsb) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure_start(file, line, "File flags should be identical: "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "%s=%#010x %s=%#010x", patha, flagsa, pathb, flagsb);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure_finish(NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (nomatch && flagsa == flagsb) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure_start(file, line, "File flags should be different: "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "%s=%#010x %s=%#010x", patha, flagsa, pathb, flagsb);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure_finish(NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)patha; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)pathb; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)nomatch; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assertion_count(file, line);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Set nodump, report failures. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-assertion_nodump(const char *file, int line, const char *pathname)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++assertion_set_nodump(const char *file, int line, const char *pathname)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int r;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2256,11 +2368,10 @@ canXz(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Can this filesystem handle nodump flags.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ canNodump(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const char *path = "cannodumptest";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct stat sb;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2271,16 +2382,10 @@ canNodump(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (sb.st_flags & UF_NODUMP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #elif (defined(FS_IOC_GETFLAGS) && defined(HAVE_WORKING_FS_IOC_GETFLAGS) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ && defined(FS_NODUMP_FL)) || \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ && defined(EXT2_NODUMP_FL))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-canNodump(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const char *path = "cannodumptest";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int fd, r, flags;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2331,18 +2436,250 @@ canNodump(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (flags & EXT2_NODUMP_FL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-canNodump()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Fetch ACLs on Solaris using acl() or facl() */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++void *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++sunacl_get(int cmd, int *aclcnt, int fd, const char *path)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int cnt, cntcmd;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ size_t size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ void *aclp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (cmd == GETACL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cntcmd = GETACLCNT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ size = sizeof(aclent_t);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if (cmd == ACE_GETACL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cntcmd = ACE_GETACLCNT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ size = sizeof(ace_t);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ errno = EINVAL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *aclcnt = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cnt = -2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (cnt == -2 || (cnt == -1 && errno == ENOSPC)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (path != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cnt = acl(path, cntcmd, 0, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cnt = facl(fd, cntcmd, 0, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (cnt > 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclp == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = malloc(cnt * size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = realloc(NULL, cnt * size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclp != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (path != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cnt = acl(path, cmd, cnt, aclp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cnt = facl(fd, cmd, cnt, aclp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (aclp != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ free(aclp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclp = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *aclcnt = cnt;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (aclp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_SUNOS */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Set test ACLs on a path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Return values:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * 0: error setting ACLs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * ARCHIVE_TEST_ACL_TYPE_POSIX1E: POSIX.1E ACLs have been set
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * ARCHIVE_TEST_ACL_TYPE_NFS4: NFSv4 or extended ACLs have been set
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++setTestAcl(const char *path)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_SUPPORT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int r = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBACL || ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_DARWIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_t acl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct richacl *richacl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_LIBACL || ARCHIVE_ACL_FREEBSD
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *acltext_posix1e = "user:1:rw-,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "group:15:r-x,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "user::rwx,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "group::rwx,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "other::r-x,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "mask::rwx";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_SUNOS /* Solaris POSIX.1e */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aclent_t aclp_posix1e[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { USER_OBJ, -1, 4 | 2 | 1 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { USER, 1, 4 | 2 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { GROUP_OBJ, -1, 4 | 2 | 1 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { GROUP, 15, 4 | 1 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { CLASS_OBJ, -1, 4 | 2 | 1 },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { OTHER_OBJ, -1, 4 | 2 | 1 }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD /* FreeBSD NFS4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *acltext_nfs4 = "user:1:rwpaRcs::allow:1,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "group:15:rxaRcs::allow:15,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "owner@:rwpxaARWcCos::allow,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "group@:rwpxaRcs::allow,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "everyone@:rxaRcs::allow";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const char *acltext_nfs4 = "owner:rwpxaARWcCoS::mask,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "group:rwpxaRcS::mask,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "other:rxaRcS::mask,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "user:1:rwpaRcS::allow,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "group:15:rxaRcS::allow,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "owner@:rwpxaARWcCoS::allow,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "group@:rwpxaRcS::allow,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "everyone@:rxaRcS::allow";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_SUNOS_NFS4 /* Solaris NFS4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ace_t aclp_nfs4[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { 1, ACE_READ_DATA | ACE_WRITE_DATA | ACE_APPEND_DATA |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACE_READ_ATTRIBUTES | ACE_READ_NAMED_ATTRS | ACE_READ_ACL |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACE_SYNCHRONIZE, 0, ACE_ACCESS_ALLOWED_ACE_TYPE },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { 15, ACE_READ_DATA | ACE_EXECUTE | ACE_READ_ATTRIBUTES |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACE_READ_NAMED_ATTRS | ACE_READ_ACL | ACE_SYNCHRONIZE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACE_IDENTIFIER_GROUP, ACE_ACCESS_ALLOWED_ACE_TYPE },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { -1, ACE_READ_DATA | ACE_WRITE_DATA | ACE_APPEND_DATA |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACE_EXECUTE | ACE_READ_ATTRIBUTES | ACE_WRITE_ATTRIBUTES |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACE_READ_NAMED_ATTRS | ACE_WRITE_NAMED_ATTRS |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACE_READ_ACL | ACE_WRITE_ACL | ACE_WRITE_OWNER | ACE_SYNCHRONIZE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACE_OWNER, ACE_ACCESS_ALLOWED_ACE_TYPE },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { -1, ACE_READ_DATA | ACE_WRITE_DATA | ACE_APPEND_DATA |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACE_EXECUTE | ACE_READ_ATTRIBUTES | ACE_READ_NAMED_ATTRS |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACE_READ_ACL | ACE_SYNCHRONIZE, ACE_GROUP | ACE_IDENTIFIER_GROUP,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACE_ACCESS_ALLOWED_ACE_TYPE },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ { -1, ACE_READ_DATA | ACE_EXECUTE | ACE_READ_ATTRIBUTES |
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACE_READ_NAMED_ATTRS | ACE_READ_ACL | ACE_SYNCHRONIZE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACE_EVERYONE, ACE_ACCESS_ALLOWED_ACE_TYPE }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_DARWIN /* Mac OS X */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_entry_t aclent;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_permset_t permset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const uid_t uid = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ uuid_t uuid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const acl_perm_t acl_perms[] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_READ_DATA,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_WRITE_DATA,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_APPEND_DATA,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_EXECUTE,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_READ_ATTRIBUTES,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_READ_EXTATTRIBUTES,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_READ_SECURITY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_DECL_ACL_SYNCHRONIZE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ACL_SYNCHRONIZE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_DARWIN */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_from_text(acltext_nfs4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_from_text() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assert(acl != NULL) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl = richacl_from_text(acltext_nfs4, NULL, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("richacl_from_text() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assert(richacl != NULL) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_DARWIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_init(1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_init() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assert(acl != NULL) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_create_entry(&acl, &aclent);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_create_entry() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assertEqualInt(r, 0) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto testacl_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_set_tag_type(aclent, ACL_EXTENDED_ALLOW);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_set_tag_type() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assertEqualInt(r, 0) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto testacl_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_get_permset(aclent, &permset);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_get_permset() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assertEqualInt(r, 0) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto testacl_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < (int)(sizeof(acl_perms) / sizeof(acl_perms[0])); i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_add_perm(permset, acl_perms[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_add_perm() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assertEqualInt(r, 0) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto testacl_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_set_permset(aclent, permset);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_set_permset() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assertEqualInt(r, 0) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto testacl_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = mbr_uid_to_uuid(uid, uuid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("mbr_uid_to_uuid() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assertEqualInt(r, 0) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto testacl_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_set_qualifier(aclent, uuid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_set_qualifier() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assertEqualInt(r, 0) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto testacl_free;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_DARWIN */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_set_file(path, ACL_TYPE_NFS4, acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_LIBRICHACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = richacl_set_file(path, richacl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ richacl_free(richacl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_SUNOS_NFS4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl(path, ACE_SETACL,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (int)(sizeof(aclp_nfs4)/sizeof(aclp_nfs4[0])), aclp_nfs4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_DARWIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_set_file(path, ACL_TYPE_EXTENDED, acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_TEST_ACL_TYPE_NFS4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_NFS4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_POSIX1E
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_LIBACL
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl = acl_from_text(acltext_posix1e);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ failure("acl_from_text() error: %s", strerror(errno));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (assert(acl != NULL) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl_set_file(path, ACL_TYPE_ACCESS, acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif ARCHIVE_ACL_SUNOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ r = acl(path, SETACL,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (int)(sizeof(aclp_posix1e)/sizeof(aclp_posix1e[0])), aclp_posix1e);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (r == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (ARCHIVE_TEST_ACL_TYPE_POSIX1E);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_POSIX1E */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if ARCHIVE_ACL_DARWIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++testacl_free:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acl_free(acl);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* ARCHIVE_ACL_SUPPORT */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)path; /* UNUSED */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Sleep as needed; useful for verifying disk timestamp changes by
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/archivers/libarchive/files/patch-Makefile.am.diff b/archivers/libarchive/files/patch-Makefile.am.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..17c1f4b
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/archivers/libarchive/files/patch-Makefile.am.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,13 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/Makefile.am b/Makefile.am
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 1cbdff5..f7adcbd 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/Makefile.am
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/Makefile.am
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -23,7 +23,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # The next line is commented out by default in shipping libarchive releases.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # It is uncommented by default in trunk.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual -g
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual -g
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AM_CFLAGS=$(DEV_CFLAGS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PLATFORMCPPFLAGS = @PLATFORMCPPFLAGS@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AM_CPPFLAGS=$(PLATFORMCPPFLAGS)
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/archivers/libarchive/files/patch-libarchive__archive_read_support_format_lha.c_p1.diff b/archivers/libarchive/files/patch-libarchive__archive_read_support_format_lha.c_p1.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..f8e638d
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/archivers/libarchive/files/patch-libarchive__archive_read_support_format_lha.c_p1.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,22 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/libarchive/archive_read_support_format_lha.c b/libarchive/archive_read_support_format_lha.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index d77a7c2..7056b02 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/libarchive/archive_read_support_format_lha.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/libarchive/archive_read_support_format_lha.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1716,13 +1716,15 @@ lha_crc16(uint16_t crc, const void *pp, size_t len)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* This if statement expects compiler optimization will
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * remove the statement which will not be executed. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #undef bswap16
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifndef __has_builtin
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define __has_builtin(x) 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if defined(_MSC_VER) && _MSC_VER >= 1400 /* Visual Studio */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # define bswap16(x) _byteswap_ushort(x)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ > 4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* GCC 4.8 and later has __builtin_bswap16() */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # define bswap16(x) __builtin_bswap16(x)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif defined(__clang__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/* All clang versions have __builtin_bswap16() */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif defined(__clang__) && __has_builtin(__builtin_bswap16)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # define bswap16(x) __builtin_bswap16(x)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # define bswap16(x) ((((x) >> 8) & 0xff) | ((x) << 8))
</span></pre><pre style='margin:0'>
</pre>