diff options
author | Chris Michael <cp.michael@samsung.com> | 2016-07-08 08:48:27 -0400 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2016-07-08 08:51:54 -0400 |
commit | ee720592196a3b5649a67f3dc80ebb1ce1992c99 (patch) | |
tree | 602e9f0c7141e066b6f5c0d9434e5e136f4b6e99 /src/lib/elput | |
parent | b2a8ef3d1310be74a720e2a8c1bf870741f3f231 (diff) |
elput: Fix insecure temporary file
Fix using mkstemp directly without securely setting umask first by
making use of eina_file_mkstemp which does set unmask.
Fixes Coverity CID1357165
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/elput')
-rw-r--r-- | src/lib/elput/elput_evdev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c index 8704a2ee9b..53279c98fe 100644 --- a/src/lib/elput/elput_evdev.c +++ b/src/lib/elput/elput_evdev.c | |||
@@ -79,7 +79,8 @@ _keyboard_fd_get(off_t size) | |||
79 | else | 79 | else |
80 | return -1; | 80 | return -1; |
81 | 81 | ||
82 | if ((fd = mkstemp(tmp)) < 0) return -1; | 82 | fd = eina_file_mkstemp(tmp, NULL); |
83 | if (fd < 0) return -1; | ||
83 | 84 | ||
84 | flags = fcntl(fd, F_GETFD); | 85 | flags = fcntl(fd, F_GETFD); |
85 | if (flags < 0) | 86 | if (flags < 0) |