summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c12
-rw-r--r--xlators/system/posix-acl/src/posix-acl.c21
2 files changed, 25 insertions, 8 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 7915964ed95..755b7951190 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -1319,6 +1319,10 @@ fuse_mknod (xlator_t *this, fuse_in_header_t *finh, void *msg)
return;
}
state->umask = fmi->umask;
+
+ /* TODO: remove this after 3.4.0 release. keeping it for the
+ sake of backward compatibility with old (3.3.[01])
+ releases till then. */
ret = dict_set_int16 (state->xdata, "umask", fmi->umask);
if (ret < 0) {
gf_log ("glusterfs-fuse", GF_LOG_WARNING,
@@ -1413,6 +1417,10 @@ fuse_mkdir (xlator_t *this, fuse_in_header_t *finh, void *msg)
return;
}
state->umask = fmi->umask;
+
+ /* TODO: remove this after 3.4.0 release. keeping it for the
+ sake of backward compatibility with old (3.3.[01])
+ releases till then. */
ret = dict_set_int16 (state->xdata, "umask", fmi->umask);
if (ret < 0) {
gf_log ("glusterfs-fuse", GF_LOG_WARNING,
@@ -1922,6 +1930,10 @@ fuse_create (xlator_t *this, fuse_in_header_t *finh, void *msg)
return;
}
state->umask = fci->umask;
+
+ /* TODO: remove this after 3.4.0 release. keeping it for the
+ sake of backward compatibility with old (3.3.[01])
+ releases till then. */
ret = dict_set_int16 (state->xdata, "umask", fci->umask);
if (ret < 0) {
gf_log ("glusterfs-fuse", GF_LOG_WARNING,
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,