]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Do not archive NFSv4 ACLs on Mac OS X by default.
authorMartin Matuska <martin@matuska.org>
Fri, 24 Feb 2017 01:33:40 +0000 (02:33 +0100)
committerMartin Matuska <martin@matuska.org>
Fri, 24 Feb 2017 02:19:50 +0000 (03:19 +0100)
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.

tar/bsdtar.1
tar/bsdtar.c

index c4486a3dccb2074ad7aaa12c6bd39046f189b2f3..b60f09c5fb2791c21ba90b4b74e458df5bef3735 100644 (file)
@@ -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
index 591da1954c59f736c69e001f149a45ffe8138071..a9252a5c7c263f4bc5011a1b5b4df125223acfd3 100644 (file)
@@ -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");