HelpViewer ignores sandbox plist

Originator:alexander.adolf
Number:rdar://12116431 Date Originated:2012-08-17
Status:Open Resolved:
Product:OS X Product Version:10.8
Classification:Security Reproducible:Yes
 
Summary:
--------
HelpViewer ignores the com.apple.help.plist in the <sandbox>/Library/Preferences directory, but instead always uses the ~/Library/Preferences/com.apple.help.plist public version.

Steps to Reproduce:
-----------------
1) Create a sandboxed app.

2) Create a plug-in bundle, which has its own help book inside.

3) Have the app load the bundle, and invoke -registerBooksInBundle: on the shared NSHelpManager for the bundle. Returns YES, so seemingly registration was successful. Using AHRegisterHelpBookWithURL() yields same results.

4) Check <sandbox>/Library/Preferences/com.apple.help.plist. It will show the registered help book from the bundle.

5) Check ~/Library/Preferences/com.apple.help.plist. It shows no trace of the bundle's help book.

6) Invoke openHelpAnchor:inBook:, AHGotoPage(), or any other method to show the bundle's help book.

Expected Results:
---------------
The help book should open in HelpViewer.

Actual Results:
-------------
"The selected topic is currently unavailable."

Regression:
----------
n.a.

Notes:
------
When the app itself contains a help book, it is registered in ~/Library/Preferences/com.apple.help.plist, and HelpViewer therefore finds it. The contents of <sandbox>/Library/Preferences/com.apple.help.plist seem never to be evaluated by HelpViewer?

The ~/Library/Preferences/com.apple.help.plist references the help books of installed apps, and the <sandbox>/Library/Preferences/com.apple.help.plist should reference help books which are only useful while the respective app is running (e.g. for its plugins). This is the current scheme and seems very appropriate.

HelpViewer loads ~/Library/Preferences/com.apple.help.plist at startup. We think that when an app invokes -registerBooksInBundle:, HelpViewer should check the app's sandbox, and if it contains a separate <sandbox>/Library/Preferences/com.apple.help.plist, it should load that on top of the startup configuration. When the app terminates, HelpViewer should re-remove the help books referenced in the <sandbox>/Library/Preferences/com.apple.help.plist, and revert back to only the entries in ~/Library/Preferences/com.apple.help.plist.

That way it seems that the sandbox approach would be maintained (what's in the sandbox stays in the sandbox). Help books for plugins would only be available when the app is running, but this would seem an acceptable limitation?

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!