summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-09-12 11:33:50 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-09-12 13:09:04 +0100
commit9ab99483808bad973363f1f27bb548c8628ace1d (patch)
tree7dbf8c35dbfc34f84da64bb11d025b167f25e951 /bridges
parent5a0d01ee8385dc5d73e921a9fe3d561430867aa2 (diff)
CID#705982 ensure umask for mkstemp
Change-Id: I5c67346d09d04a2d1a781f8fee07c84004aac960
Diffstat (limited to 'bridges')
-rw-r--r--bridges/source/cpp_uno/shared/vtablefactory.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index a293d9937ca0..43a5c81e555c 100644
--- a/bridges/source/cpp_uno/shared/vtablefactory.cxx
+++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx
@@ -59,6 +59,8 @@
#if defined USE_DOUBLE_MMAP
#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#endif
using bridges::cpp_uno::shared::VtableFactory;
@@ -239,6 +241,7 @@ 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())
@@ -290,6 +293,7 @@ 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