Kaydet (Commit) 5f438ebe authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Tweak check for nonexistent file on iOS

Calling stat() on a non-existent file outside the sandbox fails with
EPERM on iOS, not ENOENT. (Presumably calling stat() even on an
existing file, but one you don't have been granted access to, also
fails, because that is after all a point of sandboxing, you shouldn't
even be allowed to figure out whether arbitrary files exist outside
the sandbox.)

Not sure why this change hasn't been necessary also for a sandboxed
LibreOffice on macOS.

Change-Id: I67c768e9c34fd17fa35f08232284210ff4a71b98
üst 5521184b
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
......@@ -762,6 +762,14 @@ static oslFileError osl_psz_copyFile( const sal_Char* pszPath, const sal_Char* p
{
nRet=errno;
#ifdef IOS
// Checking for nonexistent files at least in the iCloud cache directory (like
// "/private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/helloodt0.odt" fails
// with EPERM, not ENOENT.
if (nRet == EPERM)
DestFileExists=0;
#endif
if (nRet == ENOENT)
DestFileExists=0;
}
......
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