summaryrefslogtreecommitdiff
path: root/usr/src/lib/libsec/common/aclutils.c
diff options
context:
space:
mode:
authormarks <none@none>2006-01-10 08:05:23 -0800
committermarks <none@none>2006-01-10 08:05:23 -0800
commitd2443e765650e70b88cd0346e67d2aee6dd1ea3a (patch)
tree83320edfc41dd74d9884d59a1d18fb22f6275e09 /usr/src/lib/libsec/common/aclutils.c
parent9f1fc992b281e57216b036e784b762829b875b4b (diff)
downloadillumos-joyent-d2443e765650e70b88cd0346e67d2aee6dd1ea3a.tar.gz
6354804 The file's ACL was changed when cp it from one ZFS file system to another one.
6355681 cannot remove xattr even while write_attr is granted 6364433 `find -ls` prints extra "+" sign when running over NFSv4/UFS 6366467 Different x_attr behavior while ACL against the same user by 'user:' or 'owner@' 6368111 ZFS returns EACCES in preference to EEXIST
Diffstat (limited to 'usr/src/lib/libsec/common/aclutils.c')
-rw-r--r--usr/src/lib/libsec/common/aclutils.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/usr/src/lib/libsec/common/aclutils.c b/usr/src/lib/libsec/common/aclutils.c
index f3c8856054..700cefa9a9 100644
--- a/usr/src/lib/libsec/common/aclutils.c
+++ b/usr/src/lib/libsec/common/aclutils.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -72,7 +72,7 @@
#define ACL_WRITE_OWNER_ERR_DENY 0x0000040
#define ACL_READ_NAMED_READER_SET_DENY 0x1000000
-#define ACL_WRITE_NAMED_WRITER_SET_ALLO W0x0200000
+
typedef union {
const char *file;
int fd;
@@ -148,21 +148,18 @@ acl_trivial(const char *filename)
aclcnt = acl(filename, cntcmd, 0, NULL);
if (aclcnt > 0) {
if (acl_flavor == _ACL_ACE_ENABLED) {
- if (aclcnt != 6)
- val = 1;
- else {
- acep = malloc(sizeof (ace_t) * aclcnt);
- if (acep == NULL)
- return (-1);
- if (acl(filename, ACE_GETACL,
- aclcnt, acep) < 0) {
- free(acep);
- return (-1);
- }
-
- val = ace_trivial(acep, aclcnt);
+ acep = malloc(sizeof (ace_t) * aclcnt);
+ if (acep == NULL)
+ return (-1);
+ if (acl(filename, ACE_GETACL,
+ aclcnt, acep) < 0) {
free(acep);
+ return (-1);
}
+
+ val = ace_trivial(acep, aclcnt);
+ free(acep);
+
} else if (aclcnt > MIN_ACL_ENTRIES)
val = 1;
}