-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't get default printer under Apple sandbox #5676
Comments
Hmm, this seems to be working in Safari (also sandboxed). What version of macOS and CUPS are you using? |
That's on macOS 10.15.1 / CUPS 2.3.0 Safari uses PrintCore which talks to cups via printtool daemon. I.e. PMSessionGetCurrentPrinter works fine in sandbox, but we would like to use cups directly as well. |
OK, I've created a short test program to reproduce this, and confirmed that ~/.cups can be safely read in a sandboxed application. Changes will be a little more involved (need to replace all uses of |
…#5676) - Add "home" global pointing to the user's home directory. - Use it instead of getenv("HOME") everywhere we needed it.
Thanks, we can work with that. |
Scenario:
try to get default printer in sandboxed app
cupsGetNamedDest(CUPS_HTTP_DEFAULT, 0, 0)
when specific default printer is set in System Preferences - Printers.
Expected:
default printer
Actual:
IPP_STATUS_ERROR_NOT_FOUND
What happens:
libcups tries to access ~/.cups/loptions to get default printer
Apple does provide entitlement com.apple.security.print which does allow that
BUT
cups uses getenv("HOME") to get home folder pathwhich returns ~/Containers/{bundle id}/Data under sandbox
while it should use real home folder (getpwuid(getuid())->pw_dir)
The text was updated successfully, but these errors were encountered: