diff options
author | stefanf <stefanf@FreeBSD.org> | 2004-10-02 11:40:48 +0000 |
---|---|---|
committer | stefanf <stefanf@FreeBSD.org> | 2004-10-02 11:40:48 +0000 |
commit | d00a4eaaead4ab4b18854f36695ffdd9a4a08df8 (patch) | |
tree | b1445db5fc9310748356059b2012b0bbf474cc63 | |
parent | 19377ec887db0bddf61b00fed90f57dfcb29ee6a (diff) | |
download | FreeBSD-src-d00a4eaaead4ab4b18854f36695ffdd9a4a08df8.zip FreeBSD-src-d00a4eaaead4ab4b18854f36695ffdd9a4a08df8.tar.gz |
Pass an array of gid_t rather than an array of int to getgroups().
PR: 56646
-rw-r--r-- | usr.bin/id/id.c | 3 | ||||
-rw-r--r-- | usr.sbin/jail/jail.c | 3 | ||||
-rw-r--r-- | usr.sbin/mountd/mountd.c | 5 |
3 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/id/id.c b/usr.bin/id/id.c index f8fba74..085ef7c 100644 --- a/usr.bin/id/id.c +++ b/usr.bin/id/id.c @@ -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; diff --git a/usr.sbin/jail/jail.c b/usr.sbin/jail/jail.c index 0f379a7..e467eb2 100644 --- a/usr.sbin/jail/jail.c +++ b/usr.sbin/jail/jail.c @@ -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; diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 242a30e..f937466 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -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]; |