getgrgid() - gr_mem not being populated in linux - Unix

This is a discussion on getgrgid() - gr_mem not being populated in linux - Unix ; Hi Does anyone know why the getgrnam() and getgrgid() functions don't populated the gr_mem array element of struct group under linux? Its not a permissions issue since wven when the program is run as root the array remains empty. Is ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: getgrgid() - gr_mem not being populated in linux

  1. getgrgid() - gr_mem not being populated in linux

    Hi

    Does anyone know why the getgrnam() and getgrgid() functions don't
    populated the gr_mem array element of struct group under linux? Its
    not a permissions issue since wven when the program is run as root the
    array remains empty. Is this array defunct or simply unsupported under
    Linux?

    Thanks for any help

    B2003

  2. Re: getgrgid() - gr_mem not being populated in linux

    On Tue, 15 Apr 2008 07:12:38 -0700 (PDT), Boltar
    wrote:

    >Hi
    >
    >Does anyone know why the getgrnam() and getgrgid() functions don't
    >populated the gr_mem array element of struct group under linux? Its
    >not a permissions issue since wven when the program is run as root the
    >array remains empty. Is this array defunct or simply unsupported under
    >Linux?


    They work for me. Sounds like there might be a bug in your code.

  3. Re: getgrgid() - gr_mem not being populated in linux

    On Apr 15, 3:53 pm, Michael Kerrisk wrote:
    > They work for me. Sounds like there might be a bug in your code.


    No , just a bug in my understanding. I assumed it cross checked /etc/
    passwd to get the list of users primary groups, but it looks like it
    just looks in /etc/group making it IMO pretty pointless.

    B2003

+ Reply to Thread