From 6b0fd79da0b7d29273141c5b38fef0f38bc7eebc Mon Sep 17 00:00:00 2001 From: Vladimir Stackov Date: Thu, 30 Jul 2015 15:14:52 +0300 Subject: [PATCH] Fixed stupid umask call from #38bf13ef --- tmp_mgr.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tmp_mgr.cc b/tmp_mgr.cc index a022f99..44e463e 100644 --- a/tmp_mgr.cc +++ b/tmp_mgr.cc @@ -44,8 +44,9 @@ sptr< TemporaryFile > TmpMgr::makeTemporaryFile() { string name( Dir::addPath( path, "XXXXXX") ); - umask( S_IRUSR | S_IWUSR | S_IRGRP ); int fd = mkstemp( &name[ 0 ] ); + if ( fchmod ( fd, S_IRUSR | S_IWUSR | S_IRGRP ) != 0 ) + throw exCantCreate( path ); if ( fd == -1 || close( fd ) != 0 ) throw exCantCreate( path );