Launch Services regression: Cannot open files & URLs remotely
Originator: | reppepreppep | ||
Number: | rdar://7208629 | Date Originated: | 09-Sep-2009 10:21 AM |
Status: | Resolved: | ||
Product: | Mac OS X | Product Version: | 10.6 (10a432) |
Classification: | Serious Bug | Reproducible: | Always |
09-Sep-2009 10:21 AM Chris Pepper: In 10.6, I cannot use the 'open' command to open files or URLs remotely (with the screensaver locked) -- only when sitting in front of the Mac. pepper@prowler:~$ open http://www.apple.com/ LSOpenURLsWithRole() failed with error -600 for the URL http://www.apple.com/. pepper@prowler:~$ open -a Safari 'http://www.benbellabooks.com/bookstore/cart.php?m=product_detail&p=594' LSOpenURLsWithRole() failed for the application /Applications/Safari.app with error -600 for the URL http://www.benbellabooks.com/bookstore/cart.php?m=product_detail&p=594. pepper@prowler:~$ open -a Safari LSOpenURLsWithRole() failed for the application /Applications/Safari.app with error -600. pepper@prowler:~$ open /Applications/Safari.app/ LSOpenURLsWithRole() failed with error -600 for the file /Applications/Safari.app. pepper@prowler:~$ open Documents LSOpenURLsWithRole() failed with error -600 for the file /Users/pepper/Documents. pepper@prowler:~$ open -a iPhoto pepper@prowler:~$ sw_vers ProductName: Mac OS X ProductVersion: 10.6 BuildVersion: 10A432 I have had this issue for a while with 10.6 betas, but it worked in Leopard. Note that opening iPhoto still works. 'reppep.prowler.10A432.2009-09-06.spx' was successfully uploaded 29-Sep-2009 12:04 PM Chris Pepper: I have verified the same issue affects my work system as well, and that even 'ssh localhost' prevents most 'open' commands from working. pepper@teriyaki:~$ open Desktop/ # succeeds pepper@teriyaki:~$ ssh localhost Last login: Tue Sep 29 11:54:14 2009 from teriyaki.mskcc.org pepper@teriyaki:~$ open Desktop/ LSOpenURLsWithRole() failed with error -600 for the file /Users/pepper/Desktop. pepper@teriyaki:~$ open -a iPhoto # succeeds pepper@teriyaki:~$
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!
procNotFound
Error -600 is a Process Manager error, procNotFound: no eligible process with specified descriptor. The Process Manager only knows about applications with a connection to the window manager. When you're in an ssh session, you do not have a connection to the window manager. The gory details are in TN2083, "Daemons and Agents".
Looking there, this appears to be a regression from Mac OS X 10.5:
Process Manager and Launch Services
Thus, both Process Manager and Launch Services have, historically, been located in the ApplicationServices framework, and were not available to daemons.
Apple recognizes that this restriction is quite inconvenient and is working to improve things. Mac OS X 10.5 represents the first step on that path. Specifically, the underlying implementation of Process Manager has moved from the window server to the CoreServices daemon (coreservicesd). With this change, it is now possible to create daemon-safe system services that deal with Process Manager processes.
The first beneficiary of this change in Launch Services. In Mac OS X 10.5 Launch Services has been moved down to the Core Services layer (it is now a subframework of the CoreServices framework). Thus, it is now daemon-safe.
This raises the question of what happens when you use Launch Services to launch an application from a daemon. Because the daemon is running in the global bootstrap namespace, Launch Services can't use the bootstrap namespace to derive the login session. Rather, Launch Services uses the EUID of the calling process. The behavior is as follows:
Unfortunately, while the underlying implementation of Process Manager is now at the CoreServices layer, Process Manager itself remains in the ApplicationServices framework. Thus, it's still not possible to use Process Manager from a daemon.