summaryrefslogtreecommitdiff
path: root/sal/osl/unx/tempfile.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-05-13 14:16:10 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-05-13 14:16:10 +0200
commit533237fec4b91fb5f871e0b5028586516dd8c0be (patch)
tree4b90ef25dd33b60a3f43228a54dc177ee09168d8 /sal/osl/unx/tempfile.cxx
parent82fa84e983fd5c8266e3b9ac820035a1d78a2ab4 (diff)
Related fdo#60338: Restrictive open mode flags for tempfile w/o calling umask
Change-Id: Ia83cbe4c9352eb2a2cf317dd1fc5771ddc12c993
Diffstat (limited to 'sal/osl/unx/tempfile.cxx')
-rw-r--r--sal/osl/unx/tempfile.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/sal/osl/unx/tempfile.cxx b/sal/osl/unx/tempfile.cxx
index 3d643b8a01ea..bbe3c27e0d39 100644
--- a/sal/osl/unx/tempfile.cxx
+++ b/sal/osl/unx/tempfile.cxx
@@ -30,6 +30,7 @@
#include <sal/macros.h>
#include "file_url.h"
+#include "file_impl.hxx"
oslFileError SAL_CALL osl_getTempDirURL( rtl_uString** pustrTempDir )
{
@@ -233,17 +234,13 @@ static oslFileError osl_create_temp_file_impl_(
if (osl_File_E_None == osl_error)
{
- /* RW permission for the user only! */
- mode_t old_mode = umask(077);
-
- osl_error = osl_openFile(
+ osl_error = openFile(
tmp_file_url,
file_handle,
osl_File_OpenFlag_Read |
osl_File_OpenFlag_Write |
- osl_File_OpenFlag_Create);
-
- umask(old_mode);
+ osl_File_OpenFlag_Create,
+ S_IRUSR | S_IWUSR);
}
/* in case of error osl_File_E_EXIST we simply try again else we give up */