Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have an NIS setup on my Linux box (from nsswitch.conf):

group: compat nis

When iterating over the group entries (using the getgrent() function), the iteration never terminates. For example:

#include <stdio.h>
#include <grp.h>

int main() {
    struct group* gr;
    setgrent();
    while((gr=getgrent()) != NULL)
      printf("%s\n", gr->gr_name);
    endgrent();
    return 0;
}

It properly lists all the local groups, but then gets into an infinite loop once the first NIS group (eng in this example) is encountered:

root
daemon
bin
sys
adm
tty
sambashare
nslcd
guest-afY5kZ
x2gouser
Domain Users
sysops
eng
eng
eng
eng
eng
eng
^C

Any ideas on how to debug what's wrong with my configuration? Everything else with the NIS setup seems to be functioning properly.

This is an Ubuntu 14.04 box. The same program run on an RHEL6 box with a similar nsswitch.conf does not demonstrate this problem.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.