Re: Administrator password
Re: Administrator password
- Subject: Re: Administrator password
- From: Quinn <email@hidden>
- Date: Tue, 14 Nov 2006 10:12:49 +0000
I've avoided wading into this topic so far because it's hardly kernel
related, but the following needs to be addressed...
At 23:55 -0700 13/11/06, Joseph Oreste Bruni wrote:
Check out nigrep, niutil, nicl, etc. And while you are reading those
man pages, try "man -k netinfo".
Please do not use NetInfo for this sort of stuff. The fact that
NetInfo is used as a the local directory store on Mac OS X is, and
has long been, an implementation detail. It's an implementation
detail that's going to change soon. Any new development should be
done using Directory Services. This will work on current systems
(where NetInfo is the local directory store) and on future systems
(where NetInfo is completely removed). If you continue to use tools
like <x-man-page://1/nicl>, you will be in for a shock.
For command line access to Directory Services, start with the
<x-man-page://1/dscl> tool.
To validate a password programmatically, use the code from CryptNoMore.
<http://developer.apple.com/samplecode/CryptNoMore/index.html>
This will work for arbitrary directory systems. This sample also
shows how to use PAM for authentication, although there are things
that make PAM less than convenient on Mac OS X (specifically, the
requirement to install a file in "/etc/pam.d").
To check whether a user is a member of a group from a script, just
use <x-man-page://1/id>.
$ id -G quinn
2000 81 79 80
$ id -G mrgumby
502
If the output includes group 80, they're an admin user.
To do this programmatically, just use <x-man-page://3/getgrgid> (or
<x-man-page://3/getgrnam>).
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden