summaryrefslogtreecommitdiffstats
path: root/api/src
diff options
context:
space:
mode:
authorJiffin Tony Thottan <jthottan@redhat.com>2015-05-14 14:37:25 +0530
committergluster-ant <bugzilla-bot@gluster.org>2015-05-14 14:37:25 +0530
commite626f79efffc69400ded5f5c8a5a44e05396d888 (patch)
tree9f5593203372311da49637dd357568d4c874887f /api/src
parent6d0cf5353fe06acba9332fb30dcd913a5a19f48c (diff)
gfapi: zero size issue in glfs_h_acl_set()
When setting the stringified ACLs in the xattr dict through pub_glfs_h_setxattrs(), the size of the string is always passed as 0. The correct way is to pass the length of the ACL in text form. While verifying this issues, it seems that posix_pacl_set() should return the errno instead of -1. This helps in debugging, otherwise EPERM would always be returned on an error. [ndevos: fix off-by-one strlen() and return errno in posix_pacl_set()] Change-Id: Ia7a7fa1f3a7d615a813c703057dc97b09a0bbb34 BUG: 789278 Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/10782 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'api/src')
-rw-r--r--api/src/glfs-handleops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index ae93439984..c010f0c9a0 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -1987,7 +1987,6 @@ pub_glfs_h_acl_set (struct glfs *fs, struct glfs_object *object,
int ret = -1;
char *acl_s = NULL;
const char *acl_key = NULL;
- ssize_t acl_len = 0;
DECLARE_OLD_THIS;
@@ -2007,7 +2006,8 @@ pub_glfs_h_acl_set (struct glfs *fs, struct glfs_object *object,
if (!acl_s)
goto out;
- ret = pub_glfs_h_setxattrs (fs, object, acl_key, acl_s, acl_len, 0);
+ ret = pub_glfs_h_setxattrs (fs, object, acl_key, acl_s,
+ strlen (acl_s) + 1, 0);
acl_free (acl_s);