[Libreoffice-commits] core.git: 2 commits - bridges/source idlc/source

Stephan Bergmann sbergman at redhat.com
Tue May 13 02:05:01 PDT 2014


 bridges/source/cpp_uno/shared/vtablefactory.cxx |    4 ----
 idlc/source/idlccompile.cxx                     |    4 ----
 2 files changed, 8 deletions(-)

New commits:
commit 0c493207723516586882e53c532dc977a1deec32
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue May 13 10:51:04 2014 +0200

    Revert "CID#705985 ensure umask for mkstemp"
    
    This reverts commit 5f5a981dd6df406b7bbddd88fa0b701b5a8d2246.  Coverity warning
    about mkstemp without umask appears to be bogus (cf.
    <https://communities.coverity.com/message/6516> "Why are uses of mkstemp
    'without securely setting umask first' being flagged?) and calling umask is not
    MT-safe, see fdo#60338 "FILESAVE: Saved files have incorrect permissions on
    linux."

diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx
index bbd080f..c88cac7 100644
--- a/idlc/source/idlccompile.cxx
+++ b/idlc/source/idlccompile.cxx
@@ -38,8 +38,6 @@
 #else
 #include <wait.h>
 #endif
-#include <sys/types.h>
-#include <sys/stat.h>
 #endif
 
 #include <string.h>
@@ -156,9 +154,7 @@ OString makeTempName(const OString& prefix)
     strncat(tmpFilePattern, "XXXXXX", sizeof(tmpFilePattern)-1-strlen(tmpFilePattern));
 
 #ifdef SAL_UNX
-    mode_t nOrigMode = umask(S_IRWXG | S_IRWXO);
     int nDescriptor = mkstemp(tmpFilePattern);
-    umask(nOrigMode);
     if( -1 == nDescriptor )
     {
         fprintf(stderr, "idlc: mkstemp(\"%s\") failed: %s\n", tmpFilePattern, strerror(errno));
commit 96b129052e280e094b6a150b185f9e8285cecca4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue May 13 10:46:00 2014 +0200

    Revert "CID#705982 ensure umask for mkstemp"
    
    This reverts commit 9ab99483808bad973363f1f27bb548c8628ace1d.  Coverity warning
    about mkstemp without umask appears to be bogus (cf.
    <https://communities.coverity.com/message/6516> "Why are uses of mkstemp
    'without securely setting umask first' being flagged?) and calling umask is not
    MT-safe, see fdo#60338 "FILESAVE: Saved files have incorrect permissions on
    linux."

diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index f6e9e7c..2589f64 100644
--- a/bridges/source/cpp_uno/shared/vtablefactory.cxx
+++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx
@@ -60,8 +60,6 @@
 
 #if defined USE_DOUBLE_MMAP
 #include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #endif
 
 using bridges::cpp_uno::shared::VtableFactory;
@@ -241,7 +239,6 @@ bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const
     if (aSecurity.getHomeDir(strURLDirectory))
         osl::File::getSystemPathFromFileURL(strURLDirectory, strDirectory);
 
-    mode_t nOrigMode = umask(S_IRWXG | S_IRWXO);
     for (int i = strDirectory.isEmpty() ? 1 : 0; i < 2; ++i)
     {
         if (strDirectory.isEmpty())
@@ -293,7 +290,6 @@ bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const
 
         strDirectory = OUString();
     }
-    umask(nOrigMode);
     if (!block.start || !block.exec || block.fd == -1)
     {
        //Fall back to non-doublemmaped allocation


More information about the Libreoffice-commits mailing list