From 3444b6cbca6b0e3961bf4227e8dcc9f5227dcb12 Mon Sep 17 00:00:00 2001 From: Martin Matuska Date: Fri, 6 Jan 2017 03:50:43 +0100 Subject: [PATCH] When writing ACLs use acl_set_fd_np() if available before acl_set_fd() --- libarchive/archive_write_disk_acl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libarchive/archive_write_disk_acl.c b/libarchive/archive_write_disk_acl.c index ea37c859d..83b5db840 100644 --- a/libarchive/archive_write_disk_acl.c +++ b/libarchive/archive_write_disk_acl.c @@ -295,13 +295,13 @@ set_acl(struct archive *a, int fd, const char *name, } /* Try restoring the ACL through 'fd' if we can. */ -#if HAVE_ACL_SET_FD - if (fd >= 0 && acl_type == ACL_TYPE_ACCESS && acl_set_fd(fd, acl) == 0) +#if HAVE_ACL_SET_FD_NP + if (fd >= 0 && acl_set_fd_np(fd, acl, acl_type) == 0) ret = ARCHIVE_OK; else #else -#if HAVE_ACL_SET_FD_NP - if (fd >= 0 && acl_set_fd_np(fd, acl, acl_type) == 0) +#if HAVE_ACL_SET_FD + if (fd >= 0 && acl_type == ACL_TYPE_ACCESS && acl_set_fd(fd, acl) == 0) ret = ARCHIVE_OK; else #endif -- 2.47.3