summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/monitoring.c
diff options
context:
space:
mode:
authorShyamsundarR <srangana@redhat.com>2018-07-24 20:23:14 -0400
committerAmar Tumballi <amarts@redhat.com>2018-07-27 09:06:09 +0000
commit46a2cbfb73f7fade3426fd07c5830e9fac82883c (patch)
tree5fc20c3724eae8e1a6145dbb31fea8f7d0aa126d /libglusterfs/src/monitoring.c
parent1739f7e0b2af6245d54b130e87d805944e9f7e63 (diff)
coverity: Ignore most of SECURE_TEMP issues
mkstemp as per the Linux man page, uses 0600 as the permission bits when creating the file. This is hence safe and a Coverity warning that should be ignored. Further, we are mostly a multi-threaded program in all our daemons and cannot set and unset umask at will in a multi-threaded program, to address the coverity issue. This change attempts to nudge coverity to ignore this warning, using the pattern, /* coverity[EVENT_TAG_NAME] ... */ <line of code that has the issue> This commit is an experiment, if post merge the next coverity report ignores these errors, the above pattern (as found using an internet search) works and can be applied to certain other warnings as well. Change-Id: I73a184ce1a54dd9e66542952b1190a74438c826a Updates: bz#789278 Signed-off-by: ShyamsundarR <srangana@redhat.com>
Diffstat (limited to 'libglusterfs/src/monitoring.c')
-rw-r--r--libglusterfs/src/monitoring.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libglusterfs/src/monitoring.c b/libglusterfs/src/monitoring.c
index 62738c79e74..10b0a817e40 100644
--- a/libglusterfs/src/monitoring.c
+++ b/libglusterfs/src/monitoring.c
@@ -237,6 +237,7 @@ gf_monitor_metrics (glusterfs_ctx_t *ctx)
return NULL;
}
+ /* coverity[secure_temp] mkstemp uses 0600 as the mode and is safe */
fd = mkstemp (filepath);
if (fd < 0) {
gf_msg ("monitoring", GF_LOG_ERROR, 0, LG_MSG_STRDUP_ERROR,