Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > How do Apple's prefpanes auto-authorize?

How do Apple's prefpanes auto-authorize?
Thread Tools
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status: Offline
Reply With Quote
Sep 24, 2002, 09:02 AM
 
When I start up System Preferences as an admin user and load a prefpane such as Sharing, I am presented with an already-opened lock:


The prefpane can perform authorized actions without the user having to authenticate each time.

I'm writing a little control application. It does the whole Authorization Services thing: factored into the GUI, and self-repairing setuid helper tools, to start and stop system daemons and edit some files in /etc/. I'd love to 'auto-authorize' like the system prefpanes do - does anyone know how that would work?
(Last edited by Mithras; Sep 24, 2002 at 11:15 AM. )
     
Forum Regular
Join Date: Feb 2001
Location: Berlin, .de
Status: Offline
Reply With Quote
Sep 24, 2002, 02:42 PM
 
just guessing, but maybe the the preferences app is setuid root.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Sep 27, 2002, 04:57 PM
 
Well no, it's not, it's the simple tools that actually perform the settings changes requested by the preference panes that are setuid root (for example /System/Library/PrivateFrameworks/NetworkConfig.framework/Resources/NetCfgTool). See Apple's documentation for why you should use setuid tools and not AuthorizationExecuteWithPrivileges.
     
Mithras  (op)
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status: Offline
Reply With Quote
Sep 27, 2002, 05:48 PM
 
Thanks very much for ferreting out their tools.

If you'd read my post you'd note that I am indeed using the Authorization Services API.

It's not obvious to me, however, how to receive an authorization reference without asking for a passphrase. Nothing in the examples or in my own code (so far) would let me do that.

I'd love any further ideas, though I'm content to require authentication if need be...
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Sep 28, 2002, 03:47 PM
 
Originally posted by Mithras:
If you'd read my post you'd note that I am indeed using the Authorization Services API.
Of course, but most people who use the Authorization Services API haven't read the documentation and are going by some of the old sample code which is basically just wrong. If you'd read my post, you'd note that I told you to read the documentation for more information.

It's not obvious to me, however, how to receive an authorization reference without asking for a passphrase. Nothing in the examples or in my own code (so far) would let me do that.
Did you read the documentation? You'll probably want to use your own right rather than kAuthorizationRightExecute or whatever it's called.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:49 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2