]> granicus.if.org Git - file/commitdiff
appease coverity by calling umask around mkstemp(3)
authorChristos Zoulas <christos@zoulas.com>
Wed, 1 Aug 2018 10:11:16 +0000 (10:11 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 1 Aug 2018 10:11:16 +0000 (10:11 +0000)
src/compress.c

index ec26595b52a99355a205ef0d8949435673c60c89..1c6db139cc8ab75d80e5a7fc1fbb17aafef7e465 100644 (file)
@@ -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;