From: Martin Matuska Date: Mon, 6 Mar 2017 23:50:12 +0000 (+0100) Subject: Darwin ACL: avoid using mbr_identifier_to_uuid() X-Git-Tag: v3.3.2~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c3cda21663fa3dc42147c771a3b96b85e631c53;p=thirdparty%2Flibarchive.git Darwin ACL: avoid using mbr_identifier_to_uuid() Use mbr_uid_to_uuid() and mbr_gid_to_uuid() for backwards compatibility instead. These functions have been introduced together with membership.h. Fixes #882 --- diff --git a/configure.ac b/configure.ac index 0592279d9..355c7540b 100644 --- a/configure.ac +++ b/configure.ac @@ -745,7 +745,7 @@ if test "x$enable_acl" != "xno"; then [#include #include ]) - # FreeBSD and MacOS ACL support + # MacOS ACL support AC_CHECK_DECLS([ACL_TYPE_EXTENDED, ACL_SYNCHRONIZE], [], [], [#include #include ]) diff --git a/libarchive/archive_write_disk_acl.c b/libarchive/archive_write_disk_acl.c index 643f3c3a0..497927496 100644 --- a/libarchive/archive_write_disk_acl.c +++ b/libarchive/archive_write_disk_acl.c @@ -424,8 +424,7 @@ set_acl(struct archive *a, int fd, const char *name, acl_set_tag_type(acl_entry, ACL_USER); acl_set_qualifier(acl_entry, &ae_uid); #else /* MacOS */ - if (mbr_identifier_to_uuid(ID_TYPE_UID, &ae_uid, - sizeof(uid_t), ae_uuid) != 0) + if (mbr_uid_to_uuid(ae_uid, ae_uuid) != 0) continue; if (acl_set_qualifier(acl_entry, &ae_uuid) != 0) continue; @@ -437,8 +436,7 @@ set_acl(struct archive *a, int fd, const char *name, acl_set_tag_type(acl_entry, ACL_GROUP); acl_set_qualifier(acl_entry, &ae_gid); #else /* MacOS */ - if (mbr_identifier_to_uuid(ID_TYPE_GID, &ae_gid, - sizeof(gid_t), ae_uuid) != 0) + if (mbr_gid_to_uuid(ae_gid, ae_uuid) != 0) continue; if (acl_set_qualifier(acl_entry, &ae_uuid) != 0) continue; diff --git a/test_utils/test_common.h b/test_utils/test_common.h index 007805417..44215a359 100644 --- a/test_utils/test_common.h +++ b/test_utils/test_common.h @@ -135,7 +135,7 @@ #if HAVE_SYS_ACL_H && HAVE_ACL_CREATE_ENTRY && HAVE_ACL_INIT && HAVE_ACL_SET_FILE #if HAVE_DECL_ACL_USER #define HAVE_POSIX_ACL 1 -#elif HAVE_DECL_ACL_TYPE_EXTENDED +#elif HAVE_DECL_ACL_TYPE_EXTENDED && HAVE_MEMBERSHIP_H #define HAVE_DARWIN_ACL 1 #endif #if HAVE_DECL_ACL_TYPE_NFS4 diff --git a/test_utils/test_main.c b/test_utils/test_main.c index 86ab5f1a4..5d0e287db 100644 --- a/test_utils/test_main.c +++ b/test_utils/test_main.c @@ -2605,8 +2605,8 @@ setTestAcl(const char *path) failure("acl_set_permset() error: %s", strerror(errno)); if (assertEqualInt(r, 0) == 0) goto testacl_free; - r = mbr_identifier_to_uuid(ID_TYPE_UID, &uid, sizeof(uid_t), uuid); - failure("mbr_identifier_to_uuid() error: %s", strerror(errno)); + r = mbr_uid_to_uuid(uid, uuid); + failure("mbr_uid_to_uuid() error: %s", strerror(errno)); if (assertEqualInt(r, 0) == 0) goto testacl_free; r = acl_set_qualifier(aclent, uuid);