Kaydet (Commit) 034d4c11 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Related fdo#60338: Setting umask for osl::Directory::open is useless

Maybe 39c58e41 "INTEGRATION: CWS
olefix: #i46469# use correct umask on unix" had intended to put it around the
osl::Directory::create call instead, but given the trouble of calling umask(3)
in a MT program at all, it is probably better to keep creating any missing
directories with the user's original umask anyway.

Change-Id: Idfddfdab05373a3c395daba635fddcc054f3f215
üst e6c21ee4
...@@ -90,14 +90,7 @@ bool ensuredir( const OUString& rUnqPath ) ...@@ -90,14 +90,7 @@ bool ensuredir( const OUString& rUnqPath )
// HACK: create directory on a mount point with nobrowse option // HACK: create directory on a mount point with nobrowse option
// returns ENOSYS in any case !! // returns ENOSYS in any case !!
osl::Directory aDirectory( aPath ); osl::Directory aDirectory( aPath );
#ifdef UNX
/* RW permission for the user only! */
mode_t old_mode = umask(077);
#endif
osl::FileBase::RC nError = aDirectory.open(); osl::FileBase::RC nError = aDirectory.open();
#ifdef UNX
umask(old_mode);
#endif
aDirectory.close(); aDirectory.close();
if( nError == osl::File::E_None ) if( nError == osl::File::E_None )
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment