Re: AXMakeProcessTrusted helper process
Re: AXMakeProcessTrusted helper process
- Subject: Re: AXMakeProcessTrusted helper process
- From: Bill Cheeseman <email@hidden>
- Date: Tue, 18 Jan 2011 15:10:09 -0500
On Jan 18, 2011, at 2:36 PM, John Ten Cate wrote:
> I have an app that I need to set the trust level on during the install process so I can use the Accessibility API's even if they are not enabled on the machine by the user. I've seen a lot of talk on the list about using AXMakeProcessTrusted and I understand the basics of doing so. Where I am not seeing the whole picture is in creating a setuid root tool that I could call under root privileges during the install process to set the trusted level for my process.
>
> Can anyone give me any more detailed info on what is involved in doing this.
My application gives the user the option to make it trusted by clicking a button or selecting a checkbox after my application is launched. To do this, I wrote a very small executable that does nothing except call AXMakeProcessTrusted to make my application's main executable a trusted process. I placed this executable at the root level of the Contents folder in my application package, and I set this executable's privileges to run as root. When the user clicks the button or selects the checkbox after launching my application, my application calls security services routines to get the user's administrator password, then launches the small executable as root. My application then launches another small executable embedded in my application package, and my application quits. This second executable relaunches my application, which now runs as a trusted process.
If you want to make your application trusted during installation, you have to follow a similar series of steps, but do it in the installer. Either way, one objective is to make sure that the executable that calls AXMakeProcessTrusted is very small and quits immediately after performing its single task. It has to run as root, but you don't want a root application running for very long.
--
Bill Cheeseman - email@hidden
_______________________________________________
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