shell/source/unix/sysshell/recently_used_file.cxx |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

New commits:
commit 8fd54c107a01f98cf9c731104b0d3eaa2b85bfa4
Author: Stephan Bergmann <sberg...@redhat.com>
Date:   Tue May 13 11:39:30 2014 +0200

    Related fdo#60338: Do not use umask(3) in a MT program
    
    Change-Id: Ie515201e44ad58faf623a04981e891c0b3f4a19d

diff --git a/shell/source/unix/sysshell/recently_used_file.cxx 
b/shell/source/unix/sysshell/recently_used_file.cxx
index 2bce26c..2189d0b 100644
--- a/shell/source/unix/sysshell/recently_used_file.cxx
+++ b/shell/source/unix/sysshell/recently_used_file.cxx
@@ -63,13 +63,12 @@ recently_used_file::recently_used_file() :
         OString tmp =
             OUStringToOString(rufn, osl_getThreadTextEncoding());
 
-        file_ = fopen(tmp.getStr(), "r+");
-
-        /* create if not exist */
-        if (NULL == file_) {
-            mode_t umask_ = umask(S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
-            file_ = fopen(tmp.getStr(), "w+");
-            umask(umask_);
+        int fd = open(tmp.getStr(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
+        if (fd != -1) {
+            file_ = fdopen(fd, "w+");
+            if (file_ == 0) {
+                close(fd);
+            }
         }
 
         if (NULL == file_)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to