diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-09-12 11:41:18 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-12 13:09:04 +0100 |
commit | 5f5a981dd6df406b7bbddd88fa0b701b5a8d2246 (patch) | |
tree | 6adbf15887f74c101347e09d4b1f7b0e23217eac /idlc | |
parent | 9ab99483808bad973363f1f27bb548c8628ace1d (diff) |
CID#705985 ensure umask for mkstemp
Change-Id: I861b85ac38a2881ff4b993047c1a15335308ba62
Diffstat (limited to 'idlc')
-rw-r--r-- | idlc/source/idlccompile.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx index 894e5d8f1150..8a98af2aa456 100644 --- a/idlc/source/idlccompile.cxx +++ b/idlc/source/idlccompile.cxx @@ -38,6 +38,8 @@ #else #include <wait.h> #endif +#include <sys/types.h> +#include <sys/stat.h> #endif #include <string.h> @@ -154,7 +156,9 @@ OString makeTempName(const OString& prefix) strncat(tmpFilePattern, "XXXXXX", sizeof(tmpFilePattern)-1-strlen(tmpFilePattern)); #ifdef SAL_UNX + mode_t nOrigMode = umask(S_IRWXG | S_IRWXO); int nDescriptor = mkstemp(tmpFilePattern); + umask(nOrigMode); if( -1 == nDescriptor ) { fprintf(stderr, "idlc: mkstemp(\"%s\") failed: %s\n", tmpFilePattern, strerror(errno)); |