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 0592279..355c754 100644
--- a/configure.ac
+++ b/configure.ac
@@ -745,7 +745,7 @@
[#include <sys/types.h>
#include <sys/acl.h>])
- # FreeBSD and MacOS ACL support
+ # MacOS ACL support
AC_CHECK_DECLS([ACL_TYPE_EXTENDED, ACL_SYNCHRONIZE], [], [],
[#include <sys/types.h>
#include <sys/acl.h>])
diff --git a/libarchive/archive_write_disk_acl.c b/libarchive/archive_write_disk_acl.c
index 643f3c3..4979274 100644
--- a/libarchive/archive_write_disk_acl.c
+++ b/libarchive/archive_write_disk_acl.c
@@ -424,8 +424,7 @@
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 @@
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 0078054..44215a3 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 86ab5f1..5d0e287 100644
--- a/test_utils/test_main.c
+++ b/test_utils/test_main.c
@@ -2605,8 +2605,8 @@
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);