diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-05-19 11:44:24 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-05-19 11:44:24 +0200 |
commit | f67702e709a9049042fdd456d2456d35055a935d (patch) | |
tree | fd86be311b624f0c2e0a303a97cd6499c1d823c5 /unotools/source | |
parent | dd7260ed691c077e4c05071d61ee2086ba5bd580 (diff) |
fdo#60338: Add osl_File_OpenFlag_Private to avoid umask
Change-Id: I293295244d1b089d747548c5025cb73b8ec428a4
Diffstat (limited to 'unotools/source')
-rw-r--r-- | unotools/source/ucbhelper/tempfile.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx index 8d4152cf2100..5b9cae784b66 100644 --- a/unotools/source/ucbhelper/tempfile.cxx +++ b/unotools/source/ucbhelper/tempfile.cxx @@ -29,6 +29,7 @@ #include <ucbhelper/fileidentifierconverter.hxx> #include <rtl/ustring.hxx> #include <rtl/instance.hxx> +#include <osl/detail/file.h> #include <osl/file.hxx> #include <tools/time.hxx> #include <tools/debug.hxx> @@ -258,14 +259,9 @@ OUString lcl_createName( { DBG_ASSERT( bKeep, "Too expensive, use directory for creating name!" ); File aFile( aTmp ); -#ifdef UNX - /* RW permission for the user only! */ - mode_t old_mode = umask(077); -#endif - FileBase::RC err = aFile.open(osl_File_OpenFlag_Create | (bLock ? 0 : osl_File_OpenFlag_NoLock)); -#ifdef UNX - umask(old_mode); -#endif + FileBase::RC err = aFile.open( + osl_File_OpenFlag_Create | osl_File_OpenFlag_Private + | (bLock ? 0 : osl_File_OpenFlag_NoLock)); if ( err == FileBase::E_None || (bLock && err == FileBase::E_NOLCK) ) { aFile.close(); |