From 394055e31f3c90701336c84aafa7d3ab1e313c65 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Mon, 22 Jul 2013 01:26:43 -0700 Subject: 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 Reviewed-on: http://review.gluster.org/5440 Reviewed-by: Amar Tumballi Tested-by: Gluster Build System Reviewed-by: Raghavendra Talur --- xlators/cluster/dht/src/dht-linkfile.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xlators/cluster/dht/src/dht-linkfile.c') 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 */ -- cgit