Re: Administrator password (Getting list of admins)
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Thread-index: AccH4ROHUi/Nj3PUEduSGAAWy6NyrA== Thread-topic: Administrator password (Getting list of admins) User-agent: Microsoft-Entourage/11.2.5.060620 on 06/11/14 1:55, Joseph Oreste Bruni at jbruni@mac.com wrote:
Check out nigrep, niutil, nicl, etc. And while you are reading those man pages, try "man -k netinfo".
How about: "Jerry, don't wish too hard for what you want, you might get it." Indeed, I GOT IT, Joe! If I ever get to retire, it looks like I could use all those to write my own NetInfo Manager. Fun stuff. For now, though, I'll use Terry's tip with getgrnam(). This seems to work: #include <grp.h> NSArray* MacSystemAdminShortNames() { // Returns the short names of all members of the group "admin" struct group* groupInfo ; groupInfo = getgrnam("admin") ; char* member ; int iMember = 0 ; NSMutableArray* admins = [[NSMutableArray alloc] init] ; while ((member = groupInfo->gr_mem[iMember++])) { [admins addObject:[NSString stringWithCString:member]] ; } NSArray* adminsOut = [NSArray arrayWithArray:admins] ; [admins release] ; return adminsOut ; } on 06/11/14 3:32, Terry Lambert at tlambert@apple.com wrote:
Be aware that some directory services do not permit enumeration of group members,
The only directory service I care about is whatever is used in "grps.c" by Mac OS X, right? And "whatever that is" seems to work.
or support the concept of a group being a member of a group; if that is the case, then it may not be possible to get a complete answer when you ask the question "who are the admin users?".
I understand this to mean that if someone somehow created a group of admins within the group admin, I'd have to call my function recursively to get all of them. Is that even possible, to have a group of admins? Thanks for the help! Jerry _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Jerry Krinock