summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-mountbroker.c3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-mountbroker.c b/xlators/mgmt/glusterd/src/glusterd-mountbroker.c
index 3125612d2cf..7c069ced984 100644
--- a/xlators/mgmt/glusterd/src/glusterd-mountbroker.c
+++ b/xlators/mgmt/glusterd/src/glusterd-mountbroker.c
@@ -525,6 +525,7 @@ glusterd_do_mount (char *label, dict_t *argdict, char **path, int *op_errno)
runner_t runner = {0,};
int ret = 0;
xlator_t *this = THIS;
+ mode_t orig_umask = 0;
priv = this->private;
GF_ASSERT (priv);
@@ -624,7 +625,9 @@ glusterd_do_mount (char *label, dict_t *argdict, char **path, int *op_errno)
*op_errno = ENOMEM;
goto out;
}
+ orig_umask = umask(S_IRWXG | S_IRWXO);
ret = mkstemp (cookie);
+ umask(orig_umask);
if (ret == -1) {
*op_errno = errno;
goto out;
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 2aa6a06a4ef..66054794fd7 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -2086,6 +2086,7 @@ glusterd_volume_compute_cksum (glusterd_volinfo_t *volinfo, char *cksum_path,
gf_boolean_t unlink_sortfile = _gf_false;
glusterd_conf_t *priv = NULL;
xlator_t *this = NULL;
+ mode_t orig_umask = 0;
GF_ASSERT (volinfo);
this = THIS;
@@ -2106,7 +2107,9 @@ glusterd_volume_compute_cksum (glusterd_volinfo_t *volinfo, char *cksum_path,
snprintf (sort_filepath, sizeof (sort_filepath),
"/tmp/%s.XXXXXX", volinfo->volname);
+ orig_umask = umask(S_IRWXG | S_IRWXO);
sort_fd = mkstemp (sort_filepath);
+ umask(orig_umask);
if (sort_fd < 0) {
gf_msg (this->name, GF_LOG_ERROR, errno,
GD_MSG_FILE_OP_FAILED, "Could not generate "