[arch-commits] Commit in libarchive/repos (8 files)

Dave Reisner dreisner at nymeria.archlinux.org
Mon Oct 21 13:53:44 UTC 2013


    Date: Monday, October 21, 2013 @ 15:53:44
  Author: dreisner
Revision: 197024

archrelease: copy trunk to testing-i686, testing-x86_64

Added:
  libarchive/repos/testing-i686/
  libarchive/repos/testing-i686/0001-mtree-fix-line-filename-length-calculation.patch
    (from rev 197023, libarchive/trunk/0001-mtree-fix-line-filename-length-calculation.patch)
  libarchive/repos/testing-i686/PKGBUILD
    (from rev 197023, libarchive/trunk/PKGBUILD)
  libarchive/repos/testing-i686/libarchive-3.1.2-acl.patch
    (from rev 197023, libarchive/trunk/libarchive-3.1.2-acl.patch)
  libarchive/repos/testing-x86_64/
  libarchive/repos/testing-x86_64/0001-mtree-fix-line-filename-length-calculation.patch
    (from rev 197023, libarchive/trunk/0001-mtree-fix-line-filename-length-calculation.patch)
  libarchive/repos/testing-x86_64/PKGBUILD
    (from rev 197023, libarchive/trunk/PKGBUILD)
  libarchive/repos/testing-x86_64/libarchive-3.1.2-acl.patch
    (from rev 197023, libarchive/trunk/libarchive-3.1.2-acl.patch)

----------------------------------------------------------------------+
 testing-i686/0001-mtree-fix-line-filename-length-calculation.patch   |   29 +
 testing-i686/PKGBUILD                                                |   51 ++
 testing-i686/libarchive-3.1.2-acl.patch                              |  219 ++++++++++
 testing-x86_64/0001-mtree-fix-line-filename-length-calculation.patch |   29 +
 testing-x86_64/PKGBUILD                                              |   51 ++
 testing-x86_64/libarchive-3.1.2-acl.patch                            |  219 ++++++++++
 6 files changed, 598 insertions(+)

Copied: libarchive/repos/testing-i686/0001-mtree-fix-line-filename-length-calculation.patch (from rev 197023, libarchive/trunk/0001-mtree-fix-line-filename-length-calculation.patch)
===================================================================
--- testing-i686/0001-mtree-fix-line-filename-length-calculation.patch	                        (rev 0)
+++ testing-i686/0001-mtree-fix-line-filename-length-calculation.patch	2013-10-21 13:53:44 UTC (rev 197024)
@@ -0,0 +1,29 @@
+From e65bf287f0133426b26611fe3e80b51267987106 Mon Sep 17 00:00:00 2001
+From: Dave Reisner <dreisner at archlinux.org>
+Date: Thu, 21 Feb 2013 19:01:06 -0500
+Subject: [PATCH] mtree: fix line filename length calculation. Fixes #301.
+ Signed-off-by: Andres Mejia <amejia004 at gmail.com>
+
+---
+ libarchive/archive_write_set_format_mtree.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libarchive/archive_write_set_format_mtree.c b/libarchive/archive_write_set_format_mtree.c
+index 9c0613c..f37f723 100644
+--- a/libarchive/archive_write_set_format_mtree.c
++++ b/libarchive/archive_write_set_format_mtree.c
+@@ -1855,9 +1855,9 @@ mtree_entry_setup_filenames(struct archive_write *a, struct mtree_entry *file,
+ 		return (ret);
+ 	}
+ 
+-	/* Make a basename from dirname and slash */
++	/* Make a basename from file->parentdir.s and slash */
+ 	*slash  = '\0';
+-	file->parentdir.length = slash - dirname;
++	file->parentdir.length = slash - file->parentdir.s;
+ 	archive_strcpy(&(file->basename),  slash + 1);
+ 	return (ret);
+ }
+-- 
+1.8.1.4
+

Copied: libarchive/repos/testing-i686/PKGBUILD (from rev 197023, libarchive/trunk/PKGBUILD)
===================================================================
--- testing-i686/PKGBUILD	                        (rev 0)
+++ testing-i686/PKGBUILD	2013-10-21 13:53:44 UTC (rev 197024)
@@ -0,0 +1,51 @@
+# $Id$
+# Maintainer: Dan McGee <dan at archlinux.org>
+
+pkgname=libarchive
+pkgver=3.1.2
+pkgrel=4
+pkgdesc="library that can create and read several streaming archive formats"
+arch=('i686' 'x86_64')
+url="http://libarchive.org/"
+license=('BSD')
+depends=('acl' 'attr' 'bzip2' 'expat' 'lzo2' 'openssl' 'xz' 'zlib')
+options=('strip' 'debug' 'libtool')
+provides=('libarchive.so')
+source=("http://libarchive.org/downloads/$pkgname-$pkgver.tar.gz"
+        '0001-mtree-fix-line-filename-length-calculation.patch'
+        https://github.com/libarchive/libarchive/commit/22531545514043e04633e1c015c7540b9de9dbe4.patch
+        'libarchive-3.1.2-acl.patch')
+md5sums=('efad5a503f66329bb9d2f4308b5de98a'
+         'fda89c145bbcd793a96b06b463ef6a72'
+         '6432f3360abd5645461a9c825c75b307'
+         'a5c995661c62429ceff2c23ea322393b')
+
+build() {
+  cd "$pkgname-$pkgver"
+
+  # https://code.google.com/p/libarchive/issues/detail?id=301
+  # upstream commit e65bf287f0133426b26611fe3e80b51267987106
+  patch -Np1 -i "$srcdir/0001-mtree-fix-line-filename-length-calculation.patch"
+
+  # https://code.google.com/p/libarchive/issues/detail?id=329
+  patch -Np1 -i "$srcdir/libarchive-3.1.2-acl.patch"
+
+  # CVE-2013-0211
+  patch -Np1 -i "$srcdir/22531545514043e04633e1c015c7540b9de9dbe4.patch"
+
+  ./configure --prefix=/usr --without-xml2
+  make
+}
+
+check() {
+  cd "$pkgname-$pkgver"
+
+  make check
+}
+
+package() {
+  cd "$pkgname-$pkgver"
+  make DESTDIR="$pkgdir" install
+
+  install -D -m644 COPYING "$pkgdir"/usr/share/licenses/libarchive/COPYING
+}

Copied: libarchive/repos/testing-i686/libarchive-3.1.2-acl.patch (from rev 197023, libarchive/trunk/libarchive-3.1.2-acl.patch)
===================================================================
--- testing-i686/libarchive-3.1.2-acl.patch	                        (rev 0)
+++ testing-i686/libarchive-3.1.2-acl.patch	2013-10-21 13:53:44 UTC (rev 197024)
@@ -0,0 +1,219 @@
+diff -ruN libarchive-3.1.2/libarchive/archive_read_disk_entry_from_file.c libarchive-3.1.2.fixed/libarchive/archive_read_disk_entry_from_file.c
+--- libarchive-3.1.2/libarchive/archive_read_disk_entry_from_file.c	2013-02-08 01:52:07.000000000 +0100
++++ libarchive-3.1.2.fixed/libarchive/archive_read_disk_entry_from_file.c	2013-08-08 10:47:41.000000000 +0200
+@@ -399,7 +399,7 @@
+ #endif
+ 
+ 
+-#if defined(HAVE_POSIX_ACL) && defined(ACL_TYPE_NFS4)
++#ifdef HAVE_POSIX_ACL
+ static int translate_acl(struct archive_read_disk *a,
+     struct archive_entry *entry, acl_t acl, int archive_entry_acl_type);
+ 
+@@ -419,6 +419,7 @@
+ 
+ 	archive_entry_acl_clear(entry);
+ 
++#ifdef ACL_TYPE_NFS4
+ 	/* Try NFS4 ACL first. */
+ 	if (*fd >= 0)
+ 		acl = acl_get_fd(*fd);
+@@ -447,6 +448,7 @@
+ 		acl_free(acl);
+ 		return (ARCHIVE_OK);
+ 	}
++#endif
+ 
+ 	/* Retrieve access ACL from file. */
+ 	if (*fd >= 0)
+@@ -492,6 +494,7 @@
+         {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
+         {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE},
+         {ARCHIVE_ENTRY_ACL_READ, ACL_READ},
++#ifdef ACL_TYPE_NFS4
+         {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
+         {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
+         {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
+@@ -508,8 +511,10 @@
+         {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL},
+         {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER},
+         {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
++#endif
+ };
+ 
++#ifdef ACL_TYPE_NFS4
+ static struct {
+         int archive_inherit;
+         int platform_inherit;
+@@ -519,21 +524,25 @@
+ 	{ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT},
+ 	{ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY}
+ };
+-
++#endif
+ static int
+ translate_acl(struct archive_read_disk *a,
+     struct archive_entry *entry, acl_t acl, int default_entry_acl_type)
+ {
+ 	acl_tag_t	 acl_tag;
++#ifdef ACL_TYPE_NFS4
+ 	acl_entry_type_t acl_type;
+ 	acl_flagset_t	 acl_flagset;
++	int brand, r;
++#endif
+ 	acl_entry_t	 acl_entry;
+ 	acl_permset_t	 acl_permset;
+-	int		 brand, i, r, entry_acl_type;
++	int		 i, entry_acl_type;
+ 	int		 s, ae_id, ae_tag, ae_perm;
+ 	const char	*ae_name;
+ 
+ 
++#ifdef ACL_TYPE_NFS4
+ 	// FreeBSD "brands" ACLs as POSIX.1e or NFSv4
+ 	// Make sure the "brand" on this ACL is consistent
+ 	// with the default_entry_acl_type bits provided.
+@@ -560,6 +569,7 @@
+ 		return ARCHIVE_FAILED;
+ 		break;
+ 	}
++#endif
+ 
+ 
+ 	s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry);
+@@ -592,9 +602,11 @@
+ 		case ACL_OTHER:
+ 			ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
+ 			break;
++#ifdef ACL_TYPE_NFS4
+ 		case ACL_EVERYONE:
+ 			ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE;
+ 			break;
++#endif
+ 		default:
+ 			/* Skip types that libarchive can't support. */
+ 			s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
+@@ -605,6 +617,7 @@
+ 		// XXX acl_get_entry_type_np on FreeBSD returns EINVAL for
+ 		// non-NFSv4 ACLs
+ 		entry_acl_type = default_entry_acl_type;
++#ifdef ACL_TYPE_NFS4
+ 		r = acl_get_entry_type_np(acl_entry, &acl_type);
+ 		if (r == 0) {
+ 			switch (acl_type) {
+@@ -634,9 +647,10 @@
+ 				ae_perm |= acl_inherit_map[i].archive_inherit;
+ 
+                 }
++#endif
+ 
+ 		acl_get_permset(acl_entry, &acl_permset);
+-                for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) {
++		for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) {
+ 			/*
+ 			 * acl_get_perm() is spelled differently on different
+ 			 * platforms; see above.
+diff -ruN libarchive-3.1.2/libarchive/archive_write_disk_acl.c libarchive-3.1.2.fixed/libarchive/archive_write_disk_acl.c
+--- libarchive-3.1.2/libarchive/archive_write_disk_acl.c	2013-01-14 02:43:45.000000000 +0100
++++ libarchive-3.1.2.fixed/libarchive/archive_write_disk_acl.c	2013-08-08 10:31:35.000000000 +0200
+@@ -43,7 +43,7 @@
+ #include "archive_acl_private.h"
+ #include "archive_write_disk_private.h"
+ 
+-#if !defined(HAVE_POSIX_ACL) || !defined(ACL_TYPE_NFS4)
++#ifndef HAVE_POSIX_ACL
+ /* Default empty function body to satisfy mainline code. */
+ int
+ archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
+@@ -79,10 +79,12 @@
+ 		ret = set_acl(a, fd, name, abstract_acl, ACL_TYPE_DEFAULT,
+ 		    ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, "default");
+ 		return (ret);
++#ifdef ACL_TYPE_NFS4
+ 	} else if (archive_acl_count(abstract_acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4) > 0) {
+ 		ret = set_acl(a, fd, name, abstract_acl, ACL_TYPE_NFS4,
+ 		    ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
+ 		return (ret);
++#endif
+ 	} else
+ 		return ARCHIVE_OK;
+ }
+@@ -94,6 +96,7 @@
+ 	{ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
+ 	{ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE},
+ 	{ARCHIVE_ENTRY_ACL_READ, ACL_READ},
++#ifdef ACL_TYPE_NFS4
+ 	{ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
+ 	{ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
+ 	{ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
+@@ -110,8 +113,10 @@
+ 	{ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL},
+ 	{ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER},
+ 	{ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
++#endif
+ };
+ 
++#ifdef ACL_TYPE_NFS4
+ static struct {
+ 	int archive_inherit;
+ 	int platform_inherit;
+@@ -121,6 +126,7 @@
+ 	{ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT},
+ 	{ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY}
+ };
++#endif
+ 
+ static int
+ set_acl(struct archive *a, int fd, const char *name,
+@@ -130,7 +136,9 @@
+ 	acl_t		 acl;
+ 	acl_entry_t	 acl_entry;
+ 	acl_permset_t	 acl_permset;
++#ifdef ACL_TYPE_NFS4
+ 	acl_flagset_t	 acl_flagset;
++#endif
+ 	int		 ret;
+ 	int		 ae_type, ae_permset, ae_tag, ae_id;
+ 	uid_t		 ae_uid;
+@@ -171,14 +179,17 @@
+ 		case ARCHIVE_ENTRY_ACL_OTHER:
+ 			acl_set_tag_type(acl_entry, ACL_OTHER);
+ 			break;
++#ifdef ACL_TYPE_NFS4
+ 		case ARCHIVE_ENTRY_ACL_EVERYONE:
+ 			acl_set_tag_type(acl_entry, ACL_EVERYONE);
+ 			break;
++#endif
+ 		default:
+ 			/* XXX */
+ 			break;
+ 		}
+ 
++#ifdef ACL_TYPE_NFS4
+ 		switch (ae_type) {
+ 		case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
+ 			acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALLOW);
+@@ -200,6 +211,7 @@
+ 			// XXX error handling here.
+ 			break;
+ 		}
++#endif
+ 
+ 		acl_get_permset(acl_entry, &acl_permset);
+ 		acl_clear_perms(acl_permset);
+@@ -210,6 +222,7 @@
+ 					     acl_perm_map[i].platform_perm);
+ 		}
+ 
++#ifdef ACL_TYPE_NFS4
+ 		acl_get_flagset_np(acl_entry, &acl_flagset);
+ 		acl_clear_flags_np(acl_flagset);
+ 		for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) {
+@@ -217,6 +230,7 @@
+ 				acl_add_flag_np(acl_flagset,
+ 						acl_inherit_map[i].platform_inherit);
+ 		}
++#endif
+ 	}
+ 
+ 	/* Try restoring the ACL through 'fd' if we can. */

Copied: libarchive/repos/testing-x86_64/0001-mtree-fix-line-filename-length-calculation.patch (from rev 197023, libarchive/trunk/0001-mtree-fix-line-filename-length-calculation.patch)
===================================================================
--- testing-x86_64/0001-mtree-fix-line-filename-length-calculation.patch	                        (rev 0)
+++ testing-x86_64/0001-mtree-fix-line-filename-length-calculation.patch	2013-10-21 13:53:44 UTC (rev 197024)
@@ -0,0 +1,29 @@
+From e65bf287f0133426b26611fe3e80b51267987106 Mon Sep 17 00:00:00 2001
+From: Dave Reisner <dreisner at archlinux.org>
+Date: Thu, 21 Feb 2013 19:01:06 -0500
+Subject: [PATCH] mtree: fix line filename length calculation. Fixes #301.
+ Signed-off-by: Andres Mejia <amejia004 at gmail.com>
+
+---
+ libarchive/archive_write_set_format_mtree.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libarchive/archive_write_set_format_mtree.c b/libarchive/archive_write_set_format_mtree.c
+index 9c0613c..f37f723 100644
+--- a/libarchive/archive_write_set_format_mtree.c
++++ b/libarchive/archive_write_set_format_mtree.c
+@@ -1855,9 +1855,9 @@ mtree_entry_setup_filenames(struct archive_write *a, struct mtree_entry *file,
+ 		return (ret);
+ 	}
+ 
+-	/* Make a basename from dirname and slash */
++	/* Make a basename from file->parentdir.s and slash */
+ 	*slash  = '\0';
+-	file->parentdir.length = slash - dirname;
++	file->parentdir.length = slash - file->parentdir.s;
+ 	archive_strcpy(&(file->basename),  slash + 1);
+ 	return (ret);
+ }
+-- 
+1.8.1.4
+

Copied: libarchive/repos/testing-x86_64/PKGBUILD (from rev 197023, libarchive/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD	                        (rev 0)
+++ testing-x86_64/PKGBUILD	2013-10-21 13:53:44 UTC (rev 197024)
@@ -0,0 +1,51 @@
+# $Id$
+# Maintainer: Dan McGee <dan at archlinux.org>
+
+pkgname=libarchive
+pkgver=3.1.2
+pkgrel=4
+pkgdesc="library that can create and read several streaming archive formats"
+arch=('i686' 'x86_64')
+url="http://libarchive.org/"
+license=('BSD')
+depends=('acl' 'attr' 'bzip2' 'expat' 'lzo2' 'openssl' 'xz' 'zlib')
+options=('strip' 'debug' 'libtool')
+provides=('libarchive.so')
+source=("http://libarchive.org/downloads/$pkgname-$pkgver.tar.gz"
+        '0001-mtree-fix-line-filename-length-calculation.patch'
+        https://github.com/libarchive/libarchive/commit/22531545514043e04633e1c015c7540b9de9dbe4.patch
+        'libarchive-3.1.2-acl.patch')
+md5sums=('efad5a503f66329bb9d2f4308b5de98a'
+         'fda89c145bbcd793a96b06b463ef6a72'
+         '6432f3360abd5645461a9c825c75b307'
+         'a5c995661c62429ceff2c23ea322393b')
+
+build() {
+  cd "$pkgname-$pkgver"
+
+  # https://code.google.com/p/libarchive/issues/detail?id=301
+  # upstream commit e65bf287f0133426b26611fe3e80b51267987106
+  patch -Np1 -i "$srcdir/0001-mtree-fix-line-filename-length-calculation.patch"
+
+  # https://code.google.com/p/libarchive/issues/detail?id=329
+  patch -Np1 -i "$srcdir/libarchive-3.1.2-acl.patch"
+
+  # CVE-2013-0211
+  patch -Np1 -i "$srcdir/22531545514043e04633e1c015c7540b9de9dbe4.patch"
+
+  ./configure --prefix=/usr --without-xml2
+  make
+}
+
+check() {
+  cd "$pkgname-$pkgver"
+
+  make check
+}
+
+package() {
+  cd "$pkgname-$pkgver"
+  make DESTDIR="$pkgdir" install
+
+  install -D -m644 COPYING "$pkgdir"/usr/share/licenses/libarchive/COPYING
+}

Copied: libarchive/repos/testing-x86_64/libarchive-3.1.2-acl.patch (from rev 197023, libarchive/trunk/libarchive-3.1.2-acl.patch)
===================================================================
--- testing-x86_64/libarchive-3.1.2-acl.patch	                        (rev 0)
+++ testing-x86_64/libarchive-3.1.2-acl.patch	2013-10-21 13:53:44 UTC (rev 197024)
@@ -0,0 +1,219 @@
+diff -ruN libarchive-3.1.2/libarchive/archive_read_disk_entry_from_file.c libarchive-3.1.2.fixed/libarchive/archive_read_disk_entry_from_file.c
+--- libarchive-3.1.2/libarchive/archive_read_disk_entry_from_file.c	2013-02-08 01:52:07.000000000 +0100
++++ libarchive-3.1.2.fixed/libarchive/archive_read_disk_entry_from_file.c	2013-08-08 10:47:41.000000000 +0200
+@@ -399,7 +399,7 @@
+ #endif
+ 
+ 
+-#if defined(HAVE_POSIX_ACL) && defined(ACL_TYPE_NFS4)
++#ifdef HAVE_POSIX_ACL
+ static int translate_acl(struct archive_read_disk *a,
+     struct archive_entry *entry, acl_t acl, int archive_entry_acl_type);
+ 
+@@ -419,6 +419,7 @@
+ 
+ 	archive_entry_acl_clear(entry);
+ 
++#ifdef ACL_TYPE_NFS4
+ 	/* Try NFS4 ACL first. */
+ 	if (*fd >= 0)
+ 		acl = acl_get_fd(*fd);
+@@ -447,6 +448,7 @@
+ 		acl_free(acl);
+ 		return (ARCHIVE_OK);
+ 	}
++#endif
+ 
+ 	/* Retrieve access ACL from file. */
+ 	if (*fd >= 0)
+@@ -492,6 +494,7 @@
+         {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
+         {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE},
+         {ARCHIVE_ENTRY_ACL_READ, ACL_READ},
++#ifdef ACL_TYPE_NFS4
+         {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
+         {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
+         {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
+@@ -508,8 +511,10 @@
+         {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL},
+         {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER},
+         {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
++#endif
+ };
+ 
++#ifdef ACL_TYPE_NFS4
+ static struct {
+         int archive_inherit;
+         int platform_inherit;
+@@ -519,21 +524,25 @@
+ 	{ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT},
+ 	{ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY}
+ };
+-
++#endif
+ static int
+ translate_acl(struct archive_read_disk *a,
+     struct archive_entry *entry, acl_t acl, int default_entry_acl_type)
+ {
+ 	acl_tag_t	 acl_tag;
++#ifdef ACL_TYPE_NFS4
+ 	acl_entry_type_t acl_type;
+ 	acl_flagset_t	 acl_flagset;
++	int brand, r;
++#endif
+ 	acl_entry_t	 acl_entry;
+ 	acl_permset_t	 acl_permset;
+-	int		 brand, i, r, entry_acl_type;
++	int		 i, entry_acl_type;
+ 	int		 s, ae_id, ae_tag, ae_perm;
+ 	const char	*ae_name;
+ 
+ 
++#ifdef ACL_TYPE_NFS4
+ 	// FreeBSD "brands" ACLs as POSIX.1e or NFSv4
+ 	// Make sure the "brand" on this ACL is consistent
+ 	// with the default_entry_acl_type bits provided.
+@@ -560,6 +569,7 @@
+ 		return ARCHIVE_FAILED;
+ 		break;
+ 	}
++#endif
+ 
+ 
+ 	s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry);
+@@ -592,9 +602,11 @@
+ 		case ACL_OTHER:
+ 			ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
+ 			break;
++#ifdef ACL_TYPE_NFS4
+ 		case ACL_EVERYONE:
+ 			ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE;
+ 			break;
++#endif
+ 		default:
+ 			/* Skip types that libarchive can't support. */
+ 			s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
+@@ -605,6 +617,7 @@
+ 		// XXX acl_get_entry_type_np on FreeBSD returns EINVAL for
+ 		// non-NFSv4 ACLs
+ 		entry_acl_type = default_entry_acl_type;
++#ifdef ACL_TYPE_NFS4
+ 		r = acl_get_entry_type_np(acl_entry, &acl_type);
+ 		if (r == 0) {
+ 			switch (acl_type) {
+@@ -634,9 +647,10 @@
+ 				ae_perm |= acl_inherit_map[i].archive_inherit;
+ 
+                 }
++#endif
+ 
+ 		acl_get_permset(acl_entry, &acl_permset);
+-                for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) {
++		for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) {
+ 			/*
+ 			 * acl_get_perm() is spelled differently on different
+ 			 * platforms; see above.
+diff -ruN libarchive-3.1.2/libarchive/archive_write_disk_acl.c libarchive-3.1.2.fixed/libarchive/archive_write_disk_acl.c
+--- libarchive-3.1.2/libarchive/archive_write_disk_acl.c	2013-01-14 02:43:45.000000000 +0100
++++ libarchive-3.1.2.fixed/libarchive/archive_write_disk_acl.c	2013-08-08 10:31:35.000000000 +0200
+@@ -43,7 +43,7 @@
+ #include "archive_acl_private.h"
+ #include "archive_write_disk_private.h"
+ 
+-#if !defined(HAVE_POSIX_ACL) || !defined(ACL_TYPE_NFS4)
++#ifndef HAVE_POSIX_ACL
+ /* Default empty function body to satisfy mainline code. */
+ int
+ archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
+@@ -79,10 +79,12 @@
+ 		ret = set_acl(a, fd, name, abstract_acl, ACL_TYPE_DEFAULT,
+ 		    ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, "default");
+ 		return (ret);
++#ifdef ACL_TYPE_NFS4
+ 	} else if (archive_acl_count(abstract_acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4) > 0) {
+ 		ret = set_acl(a, fd, name, abstract_acl, ACL_TYPE_NFS4,
+ 		    ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
+ 		return (ret);
++#endif
+ 	} else
+ 		return ARCHIVE_OK;
+ }
+@@ -94,6 +96,7 @@
+ 	{ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
+ 	{ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE},
+ 	{ARCHIVE_ENTRY_ACL_READ, ACL_READ},
++#ifdef ACL_TYPE_NFS4
+ 	{ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
+ 	{ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
+ 	{ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
+@@ -110,8 +113,10 @@
+ 	{ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL},
+ 	{ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER},
+ 	{ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
++#endif
+ };
+ 
++#ifdef ACL_TYPE_NFS4
+ static struct {
+ 	int archive_inherit;
+ 	int platform_inherit;
+@@ -121,6 +126,7 @@
+ 	{ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT},
+ 	{ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY}
+ };
++#endif
+ 
+ static int
+ set_acl(struct archive *a, int fd, const char *name,
+@@ -130,7 +136,9 @@
+ 	acl_t		 acl;
+ 	acl_entry_t	 acl_entry;
+ 	acl_permset_t	 acl_permset;
++#ifdef ACL_TYPE_NFS4
+ 	acl_flagset_t	 acl_flagset;
++#endif
+ 	int		 ret;
+ 	int		 ae_type, ae_permset, ae_tag, ae_id;
+ 	uid_t		 ae_uid;
+@@ -171,14 +179,17 @@
+ 		case ARCHIVE_ENTRY_ACL_OTHER:
+ 			acl_set_tag_type(acl_entry, ACL_OTHER);
+ 			break;
++#ifdef ACL_TYPE_NFS4
+ 		case ARCHIVE_ENTRY_ACL_EVERYONE:
+ 			acl_set_tag_type(acl_entry, ACL_EVERYONE);
+ 			break;
++#endif
+ 		default:
+ 			/* XXX */
+ 			break;
+ 		}
+ 
++#ifdef ACL_TYPE_NFS4
+ 		switch (ae_type) {
+ 		case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
+ 			acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALLOW);
+@@ -200,6 +211,7 @@
+ 			// XXX error handling here.
+ 			break;
+ 		}
++#endif
+ 
+ 		acl_get_permset(acl_entry, &acl_permset);
+ 		acl_clear_perms(acl_permset);
+@@ -210,6 +222,7 @@
+ 					     acl_perm_map[i].platform_perm);
+ 		}
+ 
++#ifdef ACL_TYPE_NFS4
+ 		acl_get_flagset_np(acl_entry, &acl_flagset);
+ 		acl_clear_flags_np(acl_flagset);
+ 		for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) {
+@@ -217,6 +230,7 @@
+ 				acl_add_flag_np(acl_flagset,
+ 						acl_inherit_map[i].platform_inherit);
+ 		}
++#endif
+ 	}
+ 
+ 	/* Try restoring the ACL through 'fd' if we can. */




More information about the arch-commits mailing list