This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/4527] New: getgrouplist() returns 1, if user does not refer to a valid user on the system
- From: "lex at ispras dot ru" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 21 May 2007 13:40:00 -0000
- Subject: [Bug libc/4527] New: getgrouplist() returns 1, if user does not refer to a valid user on the system
- Reply-to: sourceware-bugzilla at sourceware dot org
According to LSB 3.1 standard, "if user does not refer to a valid user on the
system, getgrouplist() shall return 0, and set the value referenced by ngroups
to 0". But in the following code getgrouplist() returns 1 in this case and it
also sets the value referenced by ngroups to 1. This contradicts the standard.
#include <stdio.h>
#include <grp.h>
#include <sys/types.h>
int main(int argc, char* argv[])
{
int res;
gid_t groups[20];
int ngroups=20;
res = getgrouplist("BadBadBadUser", 100, groups, &ngroups);
printf("res=%d\n", res);
printf("ngroups=%d\n", ngroups);
return 0;
}
--
Summary: getgrouplist() returns 1, if user does not refer to a
valid user on the system
Product: glibc
Version: 2.4
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: lex at ispras dot ru
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=4527
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.