This is the mail archive of the
glibc-linux@ricardo.ecn.wfu.edu
mailing list for the glibc project.
initgroups returns -1
- To: glibc-linux@ricardo.ecn.wfu.edu
- Subject: initgroups returns -1
- From: wada@techno-infinitus.co.jp
- Date: Fri, 23 Jul 99 17:14:40 +0900
- Reply-To: glibc-linux@ricardo.ecn.wfu.edu
#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
-----------------------------