Re: Newbie question: get list of users
Re: Newbie question: get list of users
- Subject: Re: Newbie question: get list of users
- From: zauhar <email@hidden>
- Date: Sun, 26 Jan 2003 17:26:11 -0500
- Scubber-version: 1.7 (portal)
However, this is only going to look in /etc, correct? What if you are
using netinfo for authentication?
Type 'man netinfo' to see a harrowing list of C library calls to access
netinfo data.
If you need to access a netinfo database, you might be better off to use
nidump to get a text version of the database, and then create an
NSDictionary based on the resulting text file.
Randy
On Sunday, January 26, 2003, at 04:55 PM, Robert Tillyard wrote:
This 'C' program will do it, just copy the bits you need.
#include <sys/types.h>
#include <pwd.h>
int main ()
{
struct passwd *p;
while ((p = getpwent ()))
printf ("id %d = '%s'\n", p->pw_uid, p->pw_name);
}
Regards, Rob.
On Sunday, January 26, 2003, at 09:18 pm, Frank Fenn wrote:
Hi developer,
I'm relatively new to MacOS, especially Cocoa programming. I would
like to know, how to get a list of all users
defined to the system and whether they have administrator rights or
not.
Scanning the mailing list archive and I've found that there are
different ways to do this. If I look in the Account
preferences I can set a user as Administrator, Accounts also doesn't
show all users compared to Netinfo or
/etc/passwd.
Is there any code example to get a list of users defined in Accounts.
I only need users that have a directory in
/Users.
Any help is appreciated.
--
Regards
Frank Fenn - Bright Light Software
_______________________________________________
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.
Randy J. Zauhar, PhD
Assoc. Prof. of Biochemistry
Director, Graduate Program in Bioinformatics
Dept. of Chemistry & Biochemistry
University of the Sciences in Philadelphia
600 S. 43rd Street
Philadelphia, PA 19104
Phone: (215)596-8691
FAX: (215)596-8543
E-mail: email@hidden
Web:
http://tonga.usip.edu/zauhar
Discussion after watching Disney's "Lilo & Stitch":
DAD: "But why did the space aliens speak English, as opposed to French,
or Swahili? And why did the one alien speak English with an Eastern
European accent? I don't get it."
CATHERINE (age 7): "That's 'cause you don't have a good cartoon brain."
_______________________________________________
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.