diff options
author | Amar Tumballi <amarts@redhat.com> | 2012-08-22 22:33:24 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-08-23 01:02:43 -0700 |
commit | c57197c8fc1f3f6419a728a5f8b60457c468accb (patch) | |
tree | 5f1c47b58c55e87a437d13546ee4760cbe862d7f /xlators/system/posix-acl/src | |
parent | c48387d8e43f83b06acf329ece6c0278a7911d1e (diff) |
posix-acl: make use of 'umask' flag passed as argument in fop
* currently "umask" is reffered only from xdata dictionary, instead
we should utilize fop argument.
* not taking of setting of "umask" in fuse for now, considering the
backward compatibility with earlier releases.
* dict_del() the "umask" and "mode" keys from xdata dict as the fop
after reaching posix layer tries to set every entry in xdata as
xattr on file/dir.
Change-Id: I7199b05a5bde132df20e7812a99bc02ef7b988ce
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 850873
Reviewed-on: http://review.gluster.org/3843
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/system/posix-acl/src')
-rw-r--r-- | xlators/system/posix-acl/src/posix-acl.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c index f54e20a6970..fa78bdeea3f 100644 --- a/xlators/system/posix-acl/src/posix-acl.c +++ b/xlators/system/posix-acl/src/posix-acl.c @@ -540,7 +540,7 @@ posix_acl_inherit_mode (struct posix_acl *acl, mode_t modein) mode_t posix_acl_inherit (xlator_t *this, loc_t *loc, dict_t *params, mode_t mode, - int is_dir) + int32_t umask, int is_dir) { int ret = 0; struct posix_acl *par_default = NULL; @@ -556,12 +556,15 @@ posix_acl_inherit (xlator_t *this, loc_t *loc, dict_t *params, mode_t mode, mode_t client_umask = 0; retmode = mode; + client_umask = umask; ret = dict_get_int16 (params, "umask", &tmp_mode); if (ret == 0) { client_umask = (mode_t)tmp_mode; + dict_del (params, "umask"); ret = dict_get_int16 (params, "mode", &tmp_mode); if (ret == 0) { retmode = (mode_t)tmp_mode; + dict_del (params, "mode"); } else { gf_log (this->name, GF_LOG_ERROR, "client sent umask, but not the original mode"); @@ -643,22 +646,24 @@ out: mode_t -posix_acl_inherit_dir (xlator_t *this, loc_t *loc, dict_t *params, mode_t mode) +posix_acl_inherit_dir (xlator_t *this, loc_t *loc, dict_t *params, mode_t mode, + int32_t umask) { mode_t retmode = 0; - retmode = posix_acl_inherit (this, loc, params, mode, 1); + retmode = posix_acl_inherit (this, loc, params, mode, umask, 1); return retmode; } mode_t -posix_acl_inherit_file (xlator_t *this, loc_t *loc, dict_t *params, mode_t mode) +posix_acl_inherit_file (xlator_t *this, loc_t *loc, dict_t *params, mode_t mode, + int32_t umask) { mode_t retmode = 0; - retmode = posix_acl_inherit (this, loc, params, mode, 0); + retmode = posix_acl_inherit (this, loc, params, mode, umask, 0); return retmode; } @@ -1115,7 +1120,7 @@ posix_acl_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, else goto red; green: - newmode = posix_acl_inherit_dir (this, loc, xdata, mode); + newmode = posix_acl_inherit_dir (this, loc, xdata, mode, umask); STACK_WIND (frame, posix_acl_mkdir_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->mkdir, @@ -1158,7 +1163,7 @@ posix_acl_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, else goto red; green: - newmode = posix_acl_inherit_file (this, loc, xdata, mode); + newmode = posix_acl_inherit_file (this, loc, xdata, mode, umask); STACK_WIND (frame, posix_acl_mknod_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->mknod, @@ -1201,7 +1206,7 @@ posix_acl_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, else goto red; green: - newmode = posix_acl_inherit_file (this, loc, xdata, mode); + newmode = posix_acl_inherit_file (this, loc, xdata, mode, umask); STACK_WIND (frame, posix_acl_create_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->create, |