INTEGRATION: CWS olefix (1.18.32); FILE MERGED
2005/04/06 15:01:38 mav 1.18.32.1: #i46469# use correct umask on unix
This commit is contained in:
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: tempfile.cxx,v $
|
* $RCSfile: tempfile.cxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.20 $
|
* $Revision: 1.21 $
|
||||||
*
|
*
|
||||||
* last change: $Author: obo $ $Date: 2005-04-18 12:14:56 $
|
* last change: $Author: obo $ $Date: 2005-04-18 14:36:48 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -74,6 +74,10 @@
|
|||||||
#include <tools/debug.hxx>
|
#include <tools/debug.hxx>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#ifdef UNX
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace osl;
|
using namespace osl;
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
@@ -126,7 +130,14 @@ sal_Bool ensuredir( const rtl::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 sal_True;
|
return sal_True;
|
||||||
@@ -256,7 +267,14 @@ void CreateTempName_Impl( String& rName, sal_Bool bKeep, sal_Bool bDir = sal_Tru
|
|||||||
{
|
{
|
||||||
DBG_ASSERT( bKeep, "Too expensive, use directory for creating name!" );
|
DBG_ASSERT( bKeep, "Too expensive, use directory for creating name!" );
|
||||||
File aFile( aTmp );
|
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);
|
FileBase::RC err = aFile.open(osl_File_OpenFlag_Create);
|
||||||
|
#ifdef UNX
|
||||||
|
umask(old_mode);
|
||||||
|
#endif
|
||||||
if ( err == FileBase::E_None )
|
if ( err == FileBase::E_None )
|
||||||
{
|
{
|
||||||
rName = aTmp;
|
rName = aTmp;
|
||||||
@@ -334,7 +352,14 @@ TempFile::TempFile( const String& rLeadingChars, const String* pExtension, const
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
File aFile( aTmp );
|
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);
|
FileBase::RC err = aFile.open(osl_File_OpenFlag_Create);
|
||||||
|
#ifdef UNX
|
||||||
|
umask(old_mode);
|
||||||
|
#endif
|
||||||
if ( err == FileBase::E_None )
|
if ( err == FileBase::E_None )
|
||||||
{
|
{
|
||||||
pImp->aName = aTmp;
|
pImp->aName = aTmp;
|
||||||
|
Reference in New Issue
Block a user