From: Martin Matuska Date: Fri, 6 Jan 2017 02:50:43 +0000 (+0100) Subject: When writing ACLs use acl_set_fd_np() if available before acl_set_fd() X-Git-Tag: v3.3.0~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3444b6cbca6b0e3961bf4227e8dcc9f5227dcb12;p=thirdparty%2Flibarchive.git When writing ACLs use acl_set_fd_np() if available before acl_set_fd() --- 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