From: Christos Zoulas Date: Wed, 1 Aug 2018 10:11:16 +0000 (+0000) Subject: appease coverity by calling umask around mkstemp(3) X-Git-Tag: FILE5_35~75 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fda25acbaba5577576a68f4225b10475b8633bf9;p=file appease coverity by calling umask around mkstemp(3) --- diff --git a/src/compress.c b/src/compress.c index ec26595b..1c6db139 100644 --- a/src/compress.c +++ b/src/compress.c @@ -35,7 +35,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: compress.c,v 1.108 2018/08/01 09:59:45 christos Exp $") +FILE_RCSID("@(#)$File: compress.c,v 1.109 2018/08/01 10:11:16 christos Exp $") #endif #include "magic.h" @@ -414,7 +414,9 @@ file_pipe2file(struct magic_set *ms, int fd, const void *startbuf, #else { int te; + int ou = umask(0); tfd = mkstemp(buf); + (void)umask(ou); te = errno; (void)unlink(buf); errno = te;