summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix-helpers.c
diff options
context:
space:
mode:
authorJiffin Tony Thottan <jthottan@redhat.com>2015-05-14 14:37:25 +0530
committerNiels de Vos <ndevos@redhat.com>2015-05-28 02:04:07 -0700
commitae9604bbdb4f87ee3f6f11adc3ce6cd140620055 (patch)
tree98c6f1e1b318abb6fec3df142ac9fe116fb2b4ee /xlators/storage/posix/src/posix-helpers.c
parent8461bf0b5008a3ddcc7b675caa9aa7c3d6473048 (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 'xlators/storage/posix/src/posix-helpers.c')
-rw-r--r--xlators/storage/posix/src/posix-helpers.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
index e1bd5b127fd..9018a739f83 100644
--- a/xlators/storage/posix/src/posix-helpers.c
+++ b/xlators/storage/posix/src/posix-helpers.c
@@ -964,6 +964,10 @@ posix_pacl_set (const char *path, const char *key, const char *acl_s)
acl = acl_from_text (acl_s);
ret = acl_set_file (path, type, acl);
+ if (ret)
+ /* posix_handle_pair expects ret to be the errno */
+ ret = -errno;
+
acl_free (acl);
return ret;