summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2015-05-22 13:20:06 +0200
committerNiels de Vos <ndevos@redhat.com>2015-06-01 02:20:23 -0700
commita25529a0980b17567060eae8b40524381ca025d3 (patch)
tree12f013e56d22e9789f4f2ea2b2665d85a3755e6d /api
parent4c630a77e1325349adb369f9a7c83557007eda56 (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. Backport of: > Change-Id: Ia7a7fa1f3a7d615a813c703057dc97b09a0bbb34 > BUG: 789278 > Reviewd-on: http://review.gluster.org/10782 > Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> Change-Id: Ia7a7fa1f3a7d615a813c703057dc97b09a0bbb34 BUG: 1224241 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/10890 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'api')
-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 ae93439984a..c010f0c9a0f 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);