From 9906c6d2a55b6f8a27903f0ef08aa8949d7a71c2 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 23 Mar 2018 18:11:11 +0100 Subject: rhbz#1559633: Treat EPERM same as EACCES when opening files For example, Linux open(2) with O_RDWR fails with EPERM if the file is flagged as FS_IMMUTABLE_FL. (And there is an #ifdef IOS "Horrible hack" block in openFilePath in sal/osl/unx/file.cxx that is apparently a workaround for a similar scenario where open returns EPERM instead of EACCES on iOS, and which can probably be removed again after this commit.) Change-Id: I00cbd28d4b83b223920776998e9245b6261bb748 Reviewed-on: https://gerrit.libreoffice.org/51788 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- ucb/source/ucp/file/filglob.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'ucb/source/ucp') diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx index fce29672b555..56b581e5477f 100644 --- a/ucb/source/ucp/file/filglob.cxx +++ b/ucb/source/ucp/file/filglob.cxx @@ -310,6 +310,7 @@ namespace fileaccess { case FileBase::E_ROFS: // #i4735# handle ROFS transparently as ACCESS_DENIED case FileBase::E_ACCES: + case FileBase::E_PERM: // permission denied

ioErrorCode = IOErrorCode_ACCESS_DENIED; break; -- cgit