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 );