Bug 3242 - incorrect prototype for initgroups
Summary: incorrect prototype for initgroups
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 3.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: Mark Murray
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1997-04-09 22:40 UTC by Ph. Charnier
Modified: 2002-01-22 17:47 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ph. Charnier 1997-04-09 22:40:01 UTC
1)
     #include <unistd.h>

     int
     initgroups(const char *name, int basegid)

                                  ^^^ what about gid_t here?
                                    and in the function definition.
2)
     there is a typo in the man page: search for initgorups in BUGS section.
Comment 1 davidn 1997-04-13 01:32:44 UTC
On Wed Apr  9 21:54:34 EST 1997, Philippe Charnier writes:
> 1)
>      #include <unistd.h>
> 
>      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'.

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.

Bruce?

Regards,

David Nugent - Unique Computing Pty Ltd - Melbourne, Australia
Voice +61-3-9791-9547  Data/BBS +61-3-9792-3507  3:632/348@fidonet
davidn@freebsd.org davidn@blaze.net.au http://www.blaze.net.au/~davidn/
Comment 2 ghelmer 1999-06-04 03:37:18 UTC
Should the type be changed to gid_t for the group ID?  pwd.h now defines
the pw_gid field as a gid_t.

Guy Helmer
ghelmer@freebsd.org
Comment 3 Bruce Evans 1999-06-04 11:50:16 UTC
>Should the type be changed to gid_t for the group ID?  pwd.h now defines
>the pw_gid field as a gid_t.

It should be changed.  Just be careful not to break anything due to the
type becoming unsigned.  The implementation of initgroups() has some more
type botches.  These bugs all seem to be fixed in NetBSD.

Bruce
Comment 4 Mark Murray freebsd_committer freebsd_triage 2002-01-22 17:43:50 UTC
State Changed
From-To: open->closed

Fixed, thanks! 



Comment 5 Mark Murray freebsd_committer freebsd_triage 2002-01-22 17:43:50 UTC
Responsible Changed
From-To: freebsd-bugs->markm

I (markm) committed the fix.