summaryrefslogtreecommitdiff
path: root/tar
diff options
context:
space:
mode:
authorMartin Matuska <martin@matuska.org>2017-02-24 02:33:40 +0100
committerMartin Matuska <martin@matuska.org>2017-02-24 03:19:50 +0100
commite46e8511f0e20cf70ce42ea8f9249e33043c10c6 (patch)
treecadcad197d9bd2fbdd74f4c8f47329cbe6a29fb2 /tar
parent6127a37e01bd4ca3cdff310d69b174e82e22b7c7 (diff)
downloadlibarchive-e46e8511f0e20cf70ce42ea8f9249e33043c10c6.tar.gz
Do not archive NFSv4 ACLs on Mac OS X by default.
This avoids wrtiting ACLs to tar files twice. Preferred method is via copyfile(3) (tar option --mac-metadata). If user wants to create archives with portable NFSv4 ACLs only (SCHILY.acl.ace header with no GUID data) the --acls and --no-mac-metadata options must be specified on the command line. In the manual page be more specific which types of ACLs are stored with --acls and --mac-metadata options.
Diffstat (limited to 'tar')
-rw-r--r--tar/bsdtar.118
-rw-r--r--tar/bsdtar.c8
2 files changed, 19 insertions, 7 deletions
diff --git a/tar/bsdtar.1 b/tar/bsdtar.1
index c4486a3d..b60f09c5 100644
--- a/tar/bsdtar.1
+++ b/tar/bsdtar.1
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 23, 2017
+.Dd February 24, 2017
.Dt TAR 1
.Os
.Sh NAME
@@ -167,11 +167,14 @@ if it is unknown suffix or no suffix, creates a new archive with
restricted pax format and bzip2 compression.
.It Fl Fl acls
(c, r, u, x modes only)
-Archive or extract ACLs. This is the reverse of
+Archive or extract POSIX.1e or NFSv4 ACLs. This is the reverse of
.Fl Fl no-acls
-and the default behavior in c, r, and u modes or if
+and the default behavior in c, r, and u modes (except Mac OS X) or if
.Nm
-is run in x mode as root.
+is run in x mode as root. On Mac OS X this option translates extended ACLs
+to NFSv4 ACLs. To store extended ACLs the
+.Fl Fl mac-metadata
+option is preferred.
.It Fl B , Fl Fl read-full-blocks
Ignored for compatibility with other
.Xr tar 1
@@ -359,7 +362,8 @@ Do not extract modification time.
By default, the modification time is set to the time stored in the archive.
.It Fl Fl mac-metadata
(c, r, u and x mode only)
-Mac OS X specific. Archive or extract ACLs and extended attributes using
+Mac OS X specific. Archive or extract extended ACLs and extended attributes
+using
.Xr copyfile 3
in AppleDouble format. This is the reverse of
.Fl Fl no-mac-metadata .
@@ -408,11 +412,11 @@ option to
.Xr find 1 .
.It Fl Fl no-acls
(c, r, u, x modes only)
-Do not archive or extract ACLs. This is the reverse of
+Do not archive or extract POSIX.1e or NFSv4 ACLs. This is the reverse of
.Fl Fl acls
and the default behavior if
.Nm
-is run as non-root in x mode.
+is run as non-root in x mode (on Mac OS X also in c, r and u modes).
.It Fl Fl no-fflags
(c, r, u, x modes only)
Do not archive or extract file flags. This is the reverse of
diff --git a/tar/bsdtar.c b/tar/bsdtar.c
index 591da195..a9252a5c 100644
--- a/tar/bsdtar.c
+++ b/tar/bsdtar.c
@@ -232,6 +232,14 @@ main(int argc, char **argv)
if (getenv(COPYFILE_DISABLE_VAR))
bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_MAC_COPYFILE;
#endif
+#if defined(__APPLE__)
+ /*
+ * On Mac OS ACLs are archived with copyfile() (--mac-metadata)
+ * Translation to NFSv4 ACLs has to be requested explicitly with --acls
+ */
+ bsdtar->readdisk_flags |= ARCHIVE_READDISK_NO_ACL;
+#endif
+
bsdtar->matching = archive_match_new();
if (bsdtar->matching == NULL)
lafe_errc(1, errno, "Out of memory");