Kaydet (Commit) 9906c6d2 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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/51788Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 74226870
......@@ -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<P>
ioErrorCode = IOErrorCode_ACCESS_DENIED;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment