===================================================================
RCS file: /opt/sourcecast/data/ccvs/repository/util/unotools/source/ucbhelper/tempfile.cxx,v
retrieving revision 1.14
retrieving revision 1.14.72.1
diff -u -r1.14 -r1.14.72.1
--- util/unotools/source/ucbhelper/tempfile.cxx	2002/09/09 10:25:47	1.14
+++ util/unotools/source/ucbhelper/tempfile.cxx	2004/09/01 09:28:55	1.14.72.1
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: tempfile.cxx,v $
  *
- *  $Revision: 1.14 $
+ *  $Revision: 1.14.72.1 $
  *
- *  last change: $Author: mav $ $Date: 2002/09/09 10:25:47 $
+ *  last change: $Author: mh $ $Date: 2004/09/01 09:28:55 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -70,6 +70,7 @@
 #include <tools/time.hxx>
 #include <tools/debug.hxx>
 #include <stdio.h>
+#include <sys/stat.h>
 
 using namespace osl;
 
@@ -119,7 +120,15 @@
     // HACK: create directory on a mount point with nobrowse option
     // returns ENOSYS in any case !!
     osl::Directory aDirectory( aPath );
+#ifdef UNX
+#include <sys/stat.h>
+/* RW permission for the user only! */
+ mode_t old_mode = umask(077);
+#endif
     osl::FileBase::RC nError = aDirectory.open();
+#ifdef UNX
+umask(old_mode);
+#endif
     aDirectory.close();
     if( nError == osl::File::E_None )
         return sal_True;
@@ -240,7 +249,15 @@
         {
             DBG_ASSERT( bKeep, "Too expensive, use directory for creating name!" );
             File aFile( aTmp );
+#ifdef UNX
+#include <sys/stat.h>
+/* RW permission for the user only! */
+ mode_t old_mode = umask(077);
+#endif
             FileBase::RC err = aFile.open(osl_File_OpenFlag_Create);
+#ifdef UNX
+umask(old_mode);
+#endif
             if (  err == FileBase::E_None )
             {
                 rName = aTmp;
@@ -318,7 +335,15 @@
         else
         {
             File aFile( aTmp );
+#ifdef UNX
+#include <sys/stat.h>
+/* RW permission for the user only! */
+ mode_t old_mode = umask(077);
+#endif
             FileBase::RC err = aFile.open(osl_File_OpenFlag_Create);
+#ifdef UNX
+umask(old_mode);
+#endif
             if ( err == FileBase::E_None )
             {
                 pImp->aName = aTmp;
