To make certain modifications to system preferences, you first need to unlock the preference pane. Some of these changes are done on a system level and the command-line equivalent would need to be invoked as the root user (via setuid). However, running sudo has an expiration (typically 5 minutes) before needing to re-authenticate again; how do system preferences assert their "open lock" state?
-
It's not at all clear that the preference pane calls sudo. Are you looking for a technical reverse engineering how things work or is there some practical question you are seeking to solve like perhaps how to modify the timeout or something else altogether?– bmike ♦Sep 12, 2012 at 19:27
-
Thanks, bmike. I'm curious if the authenticated "session" for an unlocked preference pane can be reversed for malicious intent, e.g. if an evil daemon can pose as the system preference pane to modify network settings without the user's knowledge by "piggybacking" off the unlocked prefs.– shgSep 12, 2012 at 19:31
-
Perfect - if you don't get a good answer - consider editing the question to call this out more clearly - comments can be missed and also deleted from time to time.– bmike ♦Sep 12, 2012 at 19:32
1 Answer
What you are describing is the standard way, the Mac OS X do it. You have to do the following to get around the five minuts loop hole: Guide to lock system preference
It is assert by using plist files which I hold system times etc. or that is how it was done i Snow Leopard and older.
-
Could you incorporate enough of the linked content so people can understand what solution you are proposing to the question at hand? There is an edit button above to let you add details to this stub of an answer.– bmike ♦Sep 12, 2012 at 19:25