Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

nss_getgrent() and wbinfo -g

Status
Not open for further replies.

KCV

Programmer
Aug 11, 2004
20
US
I joined my box to a (pre windows 2000)domain in the network. And after that if I give wbinfo -u and wbinfo -g, I get the groups and users. And I ran the code nss_testers(or somethig like that, written by Tridge). The users list is enumerated but the group list fails. It technically hangs at point where it retries again and again while accessing the group list.

Here is the code that tries to enumerate the groups in the domain.

Any help is appricated.

static void nss_test_groups(void)
{
struct group *grp;
int i = 0;
nss_setgrent();
/* loop over all groups */
while ((grp = nss_getgrent())) {
if (grp == NULL)
break;
printf("Testing group %s\n", grp->gr_name);
printf("getgrent: "); print_group(grp);
grp = nss_getgrnam(grp->gr_name);
if (grp){
printf("getgrnam: "); print_group(grp);
}
grp = nss_getgrgid(grp->gr_gid);
if (grp) {
printf("getgrgid: "); print_group(grp);
}
printf("\n");
i++;
if (i > 2)
break;
}
nss_endgrent();
}

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top