Re: Authorization Question
Re: Authorization Question
- Subject: Re: Authorization Question
- From: Wade Tregaskis <email@hidden>
- Date: Thu, 31 Jul 2003 12:27:38 +1000
>
How would I make a program that always runs with Root access, but
>
doesn't
>
ask for administrator authorization every time it's launched?
>
I've been working on the docs and example code, and it appears that I
>
always
>
need said permission, contrary to the docs. After setting it's UID
>
Bit, it
>
still requires me to authorize to execute it.
My memory isn't so good, so rather than try to explain it directly I'll
just send you some sample code which does it. The attached app* has an
option to change it's nice value, so you can run it with high priority.
Since it makes noise on paging activity, it's useful to give it a very
high priority so that even if everything else locks up due to heavy
paging, it'll still do it's job. But to set the value to less than
zero, you need root privileges to do so. So, if the app doesn't
already have them, it gets them via the appropriate system UI, and then
lets the user relaunch it with the new privileges.
You'll probably want your app to re-launch itself automatically once it
has given itself the appropriate privileges, but that's a trivial task
so I won't detail it.
[demime 0.98b removed an attachment of type application/octet-stream which had a name of Page Siren.tar.bz2]
* = I know people on the list won't get this, 'cause the mailer daemon
will [rightfully] cut it out. If anyone else wants a copy, just email
me off list.
Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.