From owner-freebsd-bugs Sat Apr 12 22:42:38 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id WAA17289 for bugs-outgoing; Sat, 12 Apr 1997 22:42:38 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id WAA17282 for ; Sat, 12 Apr 1997 22:42:34 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.5/8.6.9) id PAA20961; Sun, 13 Apr 1997 15:36:16 +1000 Date: Sun, 13 Apr 1997 15:36:16 +1000 From: Bruce Evans Message-Id: <199704130536.PAA20961@godzilla.zeta.org.au> To: davidn@unique.usn.blaze.net.au, freebsd-bugs@freefall.freebsd.org Subject: Re: bin/3242: incorrect prototype for initgroups Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > int > > initgroups(const char *name, int basegid) > > > > ^^^ what about gid_t here? > > and in the function definition. > > It should be the same type that is used in pwd.h for > pwd.pw_gid which, currently, is 'int'. pwd.h is just broken. initgroups() is consistent with getgrouplist(), which still uses ints for the array of groups. initgroups() constructs an array of ints and passes it to setgroups() which expects an array of gid_t's. On systems with 32-bit ints, the types only differ in signedness. gcc -Wall doesn't warn about this. All this should be fixed. > I believe that Bruce was looking into this one, since it > had to do with the self-sufficiency of headers, but I've > just noticed that both files now include sys/types.h > unconditionally. Of course the type of pw_uid is also part > of the question. and include but doesn't. grp.gr_gid has the same bug as pwd.pw_gid.