CID#705982 ensure umask for mkstemp
Change-Id: I5c67346d09d04a2d1a781f8fee07c84004aac960
This commit is contained in:
@@ -59,6 +59,8 @@
|
|||||||
|
|
||||||
#if defined USE_DOUBLE_MMAP
|
#if defined USE_DOUBLE_MMAP
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using bridges::cpp_uno::shared::VtableFactory;
|
using bridges::cpp_uno::shared::VtableFactory;
|
||||||
@@ -239,6 +241,7 @@ bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const
|
|||||||
if (aSecurity.getHomeDir(strURLDirectory))
|
if (aSecurity.getHomeDir(strURLDirectory))
|
||||||
osl::File::getSystemPathFromFileURL(strURLDirectory, strDirectory);
|
osl::File::getSystemPathFromFileURL(strURLDirectory, strDirectory);
|
||||||
|
|
||||||
|
mode_t nOrigMode = umask(S_IRWXG | S_IRWXO);
|
||||||
for (int i = strDirectory.isEmpty() ? 1 : 0; i < 2; ++i)
|
for (int i = strDirectory.isEmpty() ? 1 : 0; i < 2; ++i)
|
||||||
{
|
{
|
||||||
if (strDirectory.isEmpty())
|
if (strDirectory.isEmpty())
|
||||||
@@ -290,6 +293,7 @@ bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const
|
|||||||
|
|
||||||
strDirectory = OUString();
|
strDirectory = OUString();
|
||||||
}
|
}
|
||||||
|
umask(nOrigMode);
|
||||||
if (!block.start || !block.exec || block.fd == -1)
|
if (!block.start || !block.exec || block.fd == -1)
|
||||||
{
|
{
|
||||||
//Fall back to non-doublemmaped allocation
|
//Fall back to non-doublemmaped allocation
|
||||||
|
Reference in New Issue
Block a user