views:

68

answers:

2

I have an uninstaller that calls AuthorizationExecuteWithPrivileges to run some tools that perform cleanup. On OS X 10.6 everything is fine. On 10.5 I'm getting -1 as the return value. The documentation doesn't cover what this means.

Can anyone shed some light?

A: 

I'm not sure what -1 means, but check if TMPDIR exists in environment and if it points to existing directory. If directory doesn't exist, unset TMPDIR. I don't remember what exactly it will return in this case, but this was very annoying bug to find...

Maybe they finally fixed it in 10.6.

Eugene
No dice--it exists.
jeffamaphone
During your call? I know apple installer likes playing with that variable. Maybe something else does too.
Eugene
A: 

-1, as far as I can tell, just means fail. Turns out my call to AuthorizationCreate() was failing in interesting ways, so AuthorizationExecuteWithPrivileges() was actually behaving sort of reasonable.

Still, Apple: document your APIs better. KTHX.

jeffamaphone