Can't use AXMakeProcessTrusted() with an embedded framework
Can't use AXMakeProcessTrusted() with an embedded framework
- Subject: Can't use AXMakeProcessTrusted() with an embedded framework
- From: Bill Cheeseman <email@hidden>
- Date: Mon, 17 Sep 2007 18:24:12 -0400
- Thread-topic: Can't use AXMakeProcessTrusted() with an embedded framework
I started this discussion on cocoa-dev, but it turns out to be an
accessibility issued.
My application uses an embedded setuid helper tool, which runs as root to
call AXMakeProcessTrusted() against my application's executable. My
application then uses another embedded helper tool, which relaunches my app
so that it will be running as a trusted assistive application.
Unfortunately, dyld kills the relaunch, because my app has an embedded
framework. Everything works as it should if I move my embedded framework out
to /Library/Frameworks, but of course I would prefer to keep it embedded so
my users can drag-install my app instead of using an installer.
I relaunch my application by calling -[NSWorkspace launchApplication:] from
the other embedded helper tool. This Cocoa method apparently calls execve(),
which eventually calls issetugid() when dyld tries to load my embedded
framework. The issetugid() function returns 1 when it sees that the
executable's gid has been changed, and dyld kills the app in mid-relaunch
for security reasons when it sees that the framework is embedded.
If I've got this right, it means that AXMakeProcessTrusted() can't be used
with any application that has embedded frameworks, unless I'm willing to
tell the user to relaunch my app from the Finder manually instead of
relaunching it for my user automatically. (Unless I can figure out how to
relaunch my app using AppleScript, or using the same Cocoa method or
execve() and divorcing the relaunched process from its launching parent
process by fiddling with the environment.)
Any feedback or suggestions about how to do this would be much appreciated.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
www.quecheesoftware.com
PreFab Software - www.prefabsoftware.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden