summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2013-07-22 01:26:43 -0700
committerAnand Avati <avati@redhat.com>2013-07-31 13:31:20 -0700
commit394055e31f3c90701336c84aafa7d3ab1e313c65 (patch)
tree8f11a3e099ecf2c24526719450c7589666f2cbc6 /xlators
parentdfedfec3593ca0fc026d8a094916824e1b90e60b (diff)
dht: make linkfile creation mode explicitly get set
Because of posix default_acl on parent directory, the mode of linkfile can get masked with the mode in the default acl. This breaks DHT integrity. So let the mode get explicitly reset after mknod(). Change-Id: Ia7328e1ee7b4430bda308f9da293dba78405e081 BUG: 990410 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/5440 Reviewed-by: Amar Tumballi <amarts@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/dht/src/dht-linkfile.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-linkfile.c b/xlators/cluster/dht/src/dht-linkfile.c
index dbc9d0b3c7b..57cc202dadb 100644
--- a/xlators/cluster/dht/src/dht-linkfile.c
+++ b/xlators/cluster/dht/src/dht-linkfile.c
@@ -148,6 +148,15 @@ dht_linkfile_create (call_frame_t *frame, fop_mknod_cbk_t linkfile_cbk,
goto out;
}
+ ret = dict_set_uint32 (dict, GLUSTERFS_CREATE_MODE_KEY,
+ DHT_LINKFILE_MODE);
+ if (ret < 0) {
+ gf_log (frame->this->name, GF_LOG_WARNING,
+ "%s: failed to set mode in xdata",
+ loc->path);
+ goto out;
+ }
+
local->link_subvol = fromvol;
/* Always create as root:root. dht_linkfile_attr_heal fixes the
* ownsership */