This is the mail archive of the glibc-linux@ricardo.ecn.wfu.edu mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

initgroups returns -1



#I'm sorry for my buggy English

I have installed glibc-2.1.1 on Plamo Linux(Japanized Slackware).
Then I encounterd an problem with Apache-1.3.6.

On my system , initgroups seems to return -1.
Are there anyone encounterd same problem?

-------------test program-------------
#include<stdio.h>
#include<grp.h>
#include<sys/types.h>

int main( int argc , char* argv[] ){
  int ret;
  struct group* nogroup;

  nogroup = getgrnam( "nogroup" );
  ret = initgroups( "nobody" , nogroup->gr_gid );

  if( nogroup ){
    printf("nogroup->gr_gid = %d\n" , nogroup->gr_gid );
  }else{
    printf( "nobody == null" );
  }
  printf ("initgroups\() returns = %d\n", ret );

  return 0;
}
-----------------------------------

---------output---------
nogroup->gr->gid = 2
initgroups() returns = -1
--------------------------

----------from /etc/passwd----------
nobody:x:65534:100:nobody:/dev/null:
-------------------------------------

---from /etc/group---
nogroup::-2:
---------------------

-----------------------------
Masatake Wada
wada@techno-infinitus.co.jp
-----------------------------

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]