Getgroup's second argument is now a gid_t ptr.

This commit is contained in:
jtc 1994-04-01 01:19:08 +00:00
parent 8d1ace8b21
commit abfeba19ee
5 changed files with 21 additions and 14 deletions

View File

@ -36,7 +36,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)exec.c 5.2 (Berkeley) 3/13/91";*/
static char rcsid[] = "$Id: exec.c,v 1.6 1993/09/23 23:32:19 mycroft Exp $";
static char rcsid[] = "$Id: exec.c,v 1.7 1994/04/01 01:19:25 jtc Exp $";
#endif /* not lint */
/*
@ -501,7 +501,7 @@ loop:
goto loop;
/* Are you in this group too? */
{
int group_list[NGROUPS];
gid_t group_list[NGROUPS];
int ngroups, i;
ngroups = getgroups(NGROUPS, group_list);

View File

@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)groups.c 5.4 (Berkeley) 6/1/90";*/
static char rcsid[] = "$Id: groups.c,v 1.2 1993/08/01 18:14:58 mycroft Exp $";
static char rcsid[] = "$Id: groups.c,v 1.3 1994/04/01 01:19:16 jtc Exp $";
#endif /* not lint */
/*
@ -47,11 +47,13 @@ static char rcsid[] = "$Id: groups.c,v 1.2 1993/08/01 18:14:58 mycroft Exp $";
*/
#include <sys/param.h>
#include <sys/types.h>
#include <unistd.h>
#include <grp.h>
#include <pwd.h>
#include <stdio.h>
int groups[NGROUPS];
gid_t groups[NGROUPS];
main(argc, argv)
int argc;

View File

@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)id.c 5.1 (Berkeley) 6/29/91";*/
static char rcsid[] = "$Id: id.c,v 1.3 1993/12/09 10:28:26 cgd Exp $";
static char rcsid[] = "$Id: id.c,v 1.4 1994/04/01 01:19:18 jtc Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -160,7 +160,7 @@ sgroup(pw)
} else {
GR *gr;
register int ngroups;
int groups[NGROUPS + 1];
gid_t groups[NGROUPS + 1];
groups[0] = getgid();
ngroups = getgroups(NGROUPS, groups + 1) + 1;
@ -201,7 +201,7 @@ ugroup(pw)
}
} else {
register int ngroups;
int groups[NGROUPS + 1];
gid_t groups[NGROUPS + 1];
groups[0] = getgid();
ngroups = getgroups(NGROUPS, groups + 1) + 1;
@ -222,7 +222,8 @@ current()
{
GR *gr;
PW *pw;
int id, eid, lastid, ngroups, groups[NGROUPS];
int id, eid, lastid, ngroups;
gid_t groups[NGROUPS];
char *fmt;
id = getuid();

View File

@ -42,7 +42,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)quota.c 5.12 (Berkeley) 9/27/90";*/
static char rcsid[] = "$Id: quota.c,v 1.2 1993/08/01 18:10:00 mycroft Exp $";
static char rcsid[] = "$Id: quota.c,v 1.3 1994/04/01 01:19:21 jtc Exp $";
#endif /* not lint */
/*
@ -58,6 +58,7 @@ static char rcsid[] = "$Id: quota.c,v 1.2 1993/08/01 18:10:00 mycroft Exp $";
#include <pwd.h>
#include <grp.h>
#include <errno.h>
#include <unistd.h>
char *qfname = QUOTAFILENAME;
char *qfextension[] = INITQFNAMES;
@ -76,7 +77,8 @@ int vflag;
main(argc, argv)
char *argv[];
{
int ngroups, gidset[NGROUPS];
int ngroups;
gid_t gidset[NGROUPS];
int i, gflag = 0, uflag = 0;
char ch;
extern char *optarg;
@ -205,7 +207,8 @@ showgid(gid)
u_long gid;
{
struct group *grp = getgrgid(gid);
int ngroups, gidset[NGROUPS];
int ngroups;
gid_t gidset[NGROUPS];
register int i;
char *name;
@ -236,7 +239,8 @@ showgrpname(name)
char *name;
{
struct group *grp = getgrnam(name);
int ngroups, gidset[NGROUPS];
int ngroups;
gid_t gidset[NGROUPS];
register int i;
if (grp == NULL) {

View File

@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)chown.c 5.18 (Berkeley) 3/9/91";*/
static char rcsid[] = "$Id: chown.c,v 1.3 1993/11/19 20:02:53 jtc Exp $";
static char rcsid[] = "$Id: chown.c,v 1.4 1994/04/01 01:19:08 jtc Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -192,7 +192,7 @@ chownerr(file)
}
/* check group membership; kernel just returns EPERM */
if (gid != -1 && ngroups == -1) {
int groups[NGROUPS];
gid_t groups[NGROUPS];
ngroups = getgroups(NGROUPS, groups);
while (--ngroups >= 0 && gid != groups[ngroups]);