Pass an array of gid_t rather than an array of int to getgroups().

PR:	56646
This commit is contained in:
stefanf 2004-10-02 11:40:48 +00:00
parent 19377ec887
commit d00a4eaaea
3 changed files with 7 additions and 4 deletions

View File

@ -274,7 +274,8 @@ user(struct passwd *pw)
{
struct group *gr;
const char *fmt;
int cnt, gid, lastgid, ngroups, groups[NGROUPS + 1];
gid_t gid, lastgid, groups[NGROUPS + 1];
int cnt, ngroups;
(void)printf("uid=%u(%s)", pw->pw_uid, pw->pw_name);
gid = pw->pw_gid;

View File

@ -53,7 +53,8 @@ main(int argc, char **argv)
struct jail j;
struct passwd *pwd;
struct in_addr in;
int ch, groups[NGROUPS], i, iflag, lflag, ngroups, uflag, Uflag;
gid_t groups[NGROUPS];
int ch, i, iflag, lflag, ngroups, uflag, Uflag;
char path[PATH_MAX], *username;
static char *cleanenv;
const char *shell, *p;

View File

@ -2144,7 +2144,8 @@ parsecred(namelist, cr)
char *names;
struct passwd *pw;
struct group *gr;
int ngroups, groups[NGROUPS + 1];
gid_t groups[NGROUPS + 1];
int ngroups;
cr->cr_version = XUCRED_VERSION;
/*
@ -2175,7 +2176,7 @@ parsecred(namelist, cr)
if (getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups))
syslog(LOG_ERR, "too many groups");
/*
* Convert from int's to gid_t's and compress out duplicate
* Compress out duplicate.
*/
cr->cr_ngroups = ngroups - 1;
cr->cr_groups[0] = groups[0];