ASL API in sandboxed OSX Application doesn't work without exception
| Originator: | Pich.Dominik | ||
| Number: | rdar://12291982 | Date Originated: | 12-Sep-2012 |
| Status: | Open | Resolved: | NO |
| Product: | macosx sdk | Product Version: | 10.8 |
| Classification: | other bug | Reproducible: | always |
Summary:
When I use to query the ASL for messages it works fine as long as the caller is not sandboxed.
It fails in sandbox mode
e.g.
I use asl to get ALL messages with:
loglevel doesn't matter
processIdentifier = %OWN_NAME%
time = %SINCE_YESTERDAY%
aslmsg query = asl_new(ASL_TYPE_QUERY);
asl_set_query(query, ASL_KEY_SENDER, [applicationName UTF8String], ASL_QUERY_OP_EQUAL);
asl_set_query(query, ASL_KEY_TIME, [sinceString UTF8String], ASL_QUERY_OP_GREATER_EQUAL);
aslresponse response = asl_search(NULL, query);
=> it works on ios and on non-sandboxed osx
=> it doesn't work when sandboxed
Steps to Reproduce:
run attached sample and toggle sandboxing in the entitlements file
OR add a an exception to the sandbox:
com.apple.security.temporary-exception.files.absolute-path.read-only = "/"
(home relative doesnt work, guess it needs /var/ or /Library/)
Expected Results:
it should work in both cases especially when the specified SENDER_KEY is equal to the own process name
Actual Results:
it works for iOS and non-sandbox. it fails when sandbox
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!