From 066969339dcd0352965de0ab1b5f693cf2a7fee8 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 14 Aug 2004 23:55:37 +1000 Subject: - (dtucker) [auth-krb5.c gss-serv-krb5.c openbsd-compat/xmmap.c] Explicitly set umask for mkstemp; ok djm@ --- openbsd-compat/xmmap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'openbsd-compat/xmmap.c') 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 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $Id: xmmap.c,v 1.4 2004/05/13 06:39:34 dtucker Exp $ */ +/* $Id: xmmap.c,v 1.5 2004/08/14 13:55:38 dtucker Exp $ */ #include "includes.h" @@ -50,8 +50,11 @@ void *xmmap(size_t size) if (address == MAP_FAILED) { char tmpname[sizeof(MM_SWAP_TEMPLATE)] = MM_SWAP_TEMPLATE; int tmpfd; + mode_t old_umask; + old_umask = umask(0177); tmpfd = mkstemp(tmpname); + umask(old_umask); if (tmpfd == -1) fatal("mkstemp(\"%s\"): %s", MM_SWAP_TEMPLATE, strerror(errno)); -- cgit v1.2.3