diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-05-19 11:44:24 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-05-19 11:44:24 +0200 |
commit | f67702e709a9049042fdd456d2456d35055a935d (patch) | |
tree | fd86be311b624f0c2e0a303a97cd6499c1d823c5 /sal | |
parent | dd7260ed691c077e4c05071d61ee2086ba5bd580 (diff) |
fdo#60338: Add osl_File_OpenFlag_Private to avoid umask
Change-Id: I293295244d1b089d747548c5025cb73b8ec428a4
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/file.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index e781574cab15..a7eaac15e1f8 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -853,16 +853,19 @@ openFilePath( const char *cpFilePath, oslFileHandle* pHandle, sal_uInt32 uFlags, #endif /* set mode and flags */ - int defmode = S_IRUSR | S_IRGRP | S_IROTH; + int defmode = uFlags & osl_File_OpenFlag_Private + ? S_IRUSR : S_IRUSR | S_IRGRP | S_IROTH; int flags = O_RDONLY; if (uFlags & osl_File_OpenFlag_Write) { - defmode |= S_IWUSR | S_IWGRP | S_IWOTH; + defmode |= uFlags & osl_File_OpenFlag_Private + ? S_IWUSR : S_IWUSR | S_IWGRP | S_IWOTH; flags = OPEN_WRITE_FLAGS; } if (uFlags & osl_File_OpenFlag_Create) { - defmode |= S_IWUSR | S_IWGRP | S_IWOTH; + defmode |= uFlags & osl_File_OpenFlag_Private + ? S_IWUSR : S_IWUSR | S_IWGRP | S_IWOTH; flags = OPEN_CREATE_FLAGS; } if (mode == mode_t(-1)) |