From 3f5e575a0744488b4a1719c3e61864c3abc9ac22 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Thu, 2 May 2013 12:56:46 +0530 Subject: system/posix-acl: check for the sticky bit of the parent directory * While creating links, check if there is sticky bit set for the parent directory and whether the sticky bit permits the user to create the link. Change-Id: Ic0d09d9ed579c4eb47462c71602a3a60cc7d3bc1 BUG: 958691 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.org/4934 Reviewed-by: Amar Tumballi Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/system/posix-acl/src/posix-acl.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'xlators/system') diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c index f6246d92c8a..3e2f7f21260 100644 --- a/xlators/system/posix-acl/src/posix-acl.c +++ b/xlators/system/posix-acl/src/posix-acl.c @@ -1394,6 +1394,11 @@ posix_acl_link (call_frame_t *frame, xlator_t *this, loc_t *old, loc_t *new, dic goto red; } + if (!sticky_permits (frame, new->parent, new->inode)) { + op_errno = EACCES; + goto red; + } + STACK_WIND (frame, posix_acl_link_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->link, old, new, xdata); -- cgit