diff options
author | Darren Tucker <dtucker@zip.com.au> | 2004-08-14 23:55:37 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2004-08-14 23:55:37 +1000 |
commit | 066969339dcd0352965de0ab1b5f693cf2a7fee8 (patch) | |
tree | df36cda53b0cb0050084516295cd1529e48f01ef /openbsd-compat/xmmap.c | |
parent | a763105c0f6e4d58f2e477597d1cf5ca5317b1a1 (diff) |
- (dtucker) [auth-krb5.c gss-serv-krb5.c openbsd-compat/xmmap.c]
Explicitly set umask for mkstemp; ok djm@
Diffstat (limited to 'openbsd-compat/xmmap.c')
-rw-r--r-- | openbsd-compat/xmmap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/openbsd-compat/xmmap.c b/openbsd-compat/xmmap.c index f1a637a34..c8d59dee0 100644 --- a/openbsd-compat/xmmap.c +++ b/openbsd-compat/xmmap.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | /* $Id: xmmap.c,v 1.4 2004/05/13 06:39:34 dtucker Exp $ */ | 26 | /* $Id: xmmap.c,v 1.5 2004/08/14 13:55:38 dtucker Exp $ */ |
27 | 27 | ||
28 | #include "includes.h" | 28 | #include "includes.h" |
29 | 29 | ||
@@ -50,8 +50,11 @@ void *xmmap(size_t size) | |||
50 | if (address == MAP_FAILED) { | 50 | if (address == MAP_FAILED) { |
51 | char tmpname[sizeof(MM_SWAP_TEMPLATE)] = MM_SWAP_TEMPLATE; | 51 | char tmpname[sizeof(MM_SWAP_TEMPLATE)] = MM_SWAP_TEMPLATE; |
52 | int tmpfd; | 52 | int tmpfd; |
53 | mode_t old_umask; | ||
53 | 54 | ||
55 | old_umask = umask(0177); | ||
54 | tmpfd = mkstemp(tmpname); | 56 | tmpfd = mkstemp(tmpname); |
57 | umask(old_umask); | ||
55 | if (tmpfd == -1) | 58 | if (tmpfd == -1) |
56 | fatal("mkstemp(\"%s\"): %s", | 59 | fatal("mkstemp(\"%s\"): %s", |
57 | MM_SWAP_TEMPLATE, strerror(errno)); | 60 | MM_SWAP_TEMPLATE, strerror(errno)); |