Use the proper type (gid_t) for (group)->gr_gid to be orthogonal

with uid_t usage and (user)->pw_uid.

PR:		3242
This commit is contained in:
Mark Murray 2002-01-22 17:32:53 +00:00
parent 7228268aaa
commit 5567b258eb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=89663
7 changed files with 20 additions and 18 deletions

View File

@ -36,6 +36,7 @@
* SUCH DAMAGE.
*
* @(#)grp.h 8.2 (Berkeley) 1/21/94
* $FreeBSD$
*/
#ifndef _GRP_H_
@ -48,7 +49,7 @@
struct group {
char *gr_name; /* group name */
char *gr_passwd; /* group password */
int gr_gid; /* group id */
gid_t gr_gid; /* group id */
char **gr_mem; /* group members */
};

View File

@ -140,7 +140,7 @@ int ftruncate __P((int, off_t));
#endif
int getdomainname __P((char *, int));
int getdtablesize __P((void));
int getgrouplist __P((const char *, int, int *, int *));
int getgrouplist __P((const char *, gid_t, gid_t *, int *));
long gethostid __P((void));
int gethostname __P((char *, int));
int getlogin_r __P((char *, int));
@ -154,7 +154,7 @@ int getresuid __P((uid_t *, uid_t *, uid_t *));
int getsid __P((pid_t _pid));
char *getusershell __P((void));
char *getwd __P((char *)); /* obsoleted by getcwd() */
int initgroups __P((const char *, int));
int initgroups __P((const char *, gid_t));
int iruserok __P((unsigned long, int, const char *, const char *));
int iruserok_sa __P((const void *, int, int, const char *, const char *));
int issetugid __P((void));

View File

@ -78,7 +78,7 @@ file
struct group {
char *gr_name; /* group name */
char *gr_passwd; /* group password */
int gr_gid; /* group id */
gid_t gr_gid; /* group id */
char **gr_mem; /* group members */
};
.Ed

View File

@ -43,7 +43,7 @@
.Sh SYNOPSIS
.In unistd.h
.Ft int
.Fn getgrouplist "const char *name" "int basegid" "int *groups" "int *ngroups"
.Fn getgrouplist "const char *name" "gid_t basegid" "gid_t *groups" "int *ngroups"
.Sh DESCRIPTION
The
.Fn getgrouplist
@ -56,7 +56,7 @@ is automatically included in the groups list.
Typically this value is given as
the group number from the password file.
.Pp
The resulting group list is returned in the integer array pointed to by
The resulting group list is returned in the array pointed to by
.Fa groups .
The caller specifies the size of the
.Fa groups

View File

@ -31,9 +31,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)getgrouplist.c 8.2 (Berkeley) 12/8/94";
#endif /* LIBC_SCCS and not lint */
#endif
/*
* get credential
@ -45,12 +48,12 @@ static char sccsid[] = "@(#)getgrouplist.c 8.2 (Berkeley) 12/8/94";
int
getgrouplist(uname, agroup, groups, grpcnt)
const char *uname;
int agroup;
register int *groups;
gid_t agroup;
gid_t *groups;
int *grpcnt;
{
register struct group *grp;
register int i, ngroups;
struct group *grp;
int i, ngroups;
int ret, maxgroups;
ret = 0;

View File

@ -43,7 +43,7 @@
.Sh SYNOPSIS
.In unistd.h
.Ft int
.Fn initgroups "const char *name" "int basegid"
.Fn initgroups "const char *name" "gid_t basegid"
.Sh DESCRIPTION
The
.Fn initgroups

View File

@ -31,14 +31,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)initgroups.c 8.1 (Berkeley) 6/4/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@ -51,7 +49,7 @@ static const char rcsid[] =
int
initgroups(uname, agroup)
const char *uname;
int agroup;
gid_t agroup;
{
int groups[NGROUPS], ngroups;