Kaydet (Commit) 6d7a70b4 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Bypass the alias resolving completely when sandboxed

Attempting to look up the bookmark data for a file will try acessing
its resource fork, causing messages like:

soffice(83685) deny file-read-data /Users/tml/Documents/b.odt/..namedfork/rsrc

Change-Id: I1b2b0b493a46aa629581b921c94c5014f994e75c
üst d22c94db
...@@ -145,16 +145,16 @@ int macxp_resolveAlias(char *path, int buflen) ...@@ -145,16 +145,16 @@ int macxp_resolveAlias(char *path, int buflen)
#if HAVE_FEATURE_MACOSX_SANDBOX #if HAVE_FEATURE_MACOSX_SANDBOX
/* Avoid unnecessary messages in the system.log: /* Avoid unnecessary messages in the system.log:
* *
* kernel[0]: Sandbox: soffice(57342) deny file-read-data /Users * soffice(57342) deny file-read-data /Users/tml/Documents/b.odt/..namedfork/rsrc
* kernel[0]: Sandbox: soffice(57342) deny file-read-data /Users/tml * etc.
* *
* etc. It is quite unlikely anyway, I hope, that anything except * Just don't bother with resolving aliases. I doubt its usefulness anyway.
* the last component of a path name would be a bookmark.
*/ */
char *unprocessedPath = path + strlen(path) - 1; (void) path;
(void) buflen;
return 0;
#else #else
char *unprocessedPath = path; char *unprocessedPath = path;
#endif
if ( *unprocessedPath == '/' ) if ( *unprocessedPath == '/' )
unprocessedPath++; unprocessedPath++;
...@@ -230,6 +230,7 @@ int macxp_resolveAlias(char *path, int buflen) ...@@ -230,6 +230,7 @@ int macxp_resolveAlias(char *path, int buflen)
} }
return nRet; return nRet;
#endif
} }
#endif /* defined MACOSX */ #endif /* defined MACOSX */
......
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