From owner-freebsd-bugs@FreeBSD.ORG Tue Sep 9 11:00:32 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BC24F16A4EA for ; Tue, 9 Sep 2003 11:00:32 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6278043FDF for ; Tue, 9 Sep 2003 11:00:30 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h89I0UUp070125 for ; Tue, 9 Sep 2003 11:00:30 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h89I0Uh1070124; Tue, 9 Sep 2003 11:00:30 -0700 (PDT) Resent-Date: Tue, 9 Sep 2003 11:00:30 -0700 (PDT) Resent-Message-Id: <200309091800.h89I0Uh1070124@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Stefan Farfeleder Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 96AF516A4BF for ; Tue, 9 Sep 2003 10:55:03 -0700 (PDT) Received: from fafoe.narf.at (chello212186121237.14.vie.surfer.at [212.186.121.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7153D43FE5 for ; Tue, 9 Sep 2003 10:55:02 -0700 (PDT) (envelope-from stefan@fafoe.dyndns.org) Received: from frog.fafoe.narf.at (frog.fafoe.narf.at [192.168.2.101]) by fafoe.narf.at (Postfix) with ESMTP id A2FE4411E; Tue, 9 Sep 2003 19:54:57 +0200 (CEST) Received: by frog.fafoe.narf.at (Postfix, from userid 1001) id A70DE406; Tue, 9 Sep 2003 19:54:56 +0200 (CEST) Message-Id: <20030909175456.A70DE406@frog.fafoe.narf.at> Date: Tue, 9 Sep 2003 19:54:56 +0200 (CEST) From: Stefan Farfeleder To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: stefan@fafoe.narf.at Subject: bin/56646: [patch] getgrouplist()/setgroups() arguments: int groups[] -> gid_t groups[] X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Stefan Farfeleder List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Sep 2003 18:00:33 -0000 >Number: 56646 >Category: bin >Synopsis: [patch] getgrouplist()/setgroups() arguments: int groups[] -> gid_t groups[] >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Sep 09 11:00:30 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Stefan Farfeleder >Release: FreeBSD 5.1-CURRENT i386 >Organization: >Environment: System: FreeBSD frog.fafoe.narf.at 5.1-CURRENT FreeBSD 5.1-CURRENT #7: Sun Sep 7 18:53:15 CEST 2003 freebsd@frog.fafoe.narf.at:/freebsd/frog/obj/freebsd/frog/src/sys/FROG i386 >Description: gid_t is currently typedef'ed as uint32_t on FreeBSD. This patch fixes all occurrences where an int array is passed to getgrouplist() or setgroups() which expect a gid_t array. The types int * and uint32_t * aren't compatible; passing a wrong pointer to a function is a constraint violation. >How-To-Repeat: A conforming C compiler is required to issue a diagnostic. >Fix: --- gid_t.diff begins here --- Index: src/lib/libc/gen/initgroups.c =================================================================== RCS file: /usr/home/ncvs/src/lib/libc/gen/initgroups.c,v retrieving revision 1.7 diff -u -r1.7 initgroups.c --- src/lib/libc/gen/initgroups.c 1 Feb 2002 00:57:29 -0000 1.7 +++ src/lib/libc/gen/initgroups.c 8 Sep 2003 00:12:53 -0000 @@ -50,7 +50,8 @@ const char *uname; gid_t agroup; { - int groups[NGROUPS], ngroups; + gid_t groups[NGROUPS]; + int ngroups; ngroups = NGROUPS; getgrouplist(uname, agroup, groups, &ngroups); Index: src/usr.bin/id/id.c =================================================================== RCS file: /usr/home/ncvs/src/usr.bin/id/id.c,v retrieving revision 1.19 diff -u -r1.19 id.c --- src/usr.bin/id/id.c 4 Sep 2002 23:29:02 -0000 1.19 +++ src/usr.bin/id/id.c 9 Sep 2003 17:21:02 -0000 @@ -260,7 +260,8 @@ { 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; Index: src/usr.sbin/jail/jail.c =================================================================== RCS file: /usr/home/ncvs/src/usr.sbin/jail/jail.c,v retrieving revision 1.14 diff -u -r1.14 jail.c --- src/usr.sbin/jail/jail.c 6 Jul 2003 12:44:11 -0000 1.14 +++ src/usr.sbin/jail/jail.c 9 Sep 2003 17:24:51 -0000 @@ -34,7 +34,8 @@ struct jail j; struct passwd *pwd; struct in_addr in; - int ch, groups[NGROUPS], i, iflag, ngroups; + gid_t groups[NGROUPS]; + int ch, i, iflag, ngroups; char *username; iflag = 0; Index: src/usr.sbin/mountd/mountd.c =================================================================== RCS file: /usr/home/ncvs/src/usr.sbin/mountd/mountd.c,v retrieving revision 1.72 diff -u -r1.72 mountd.c --- src/usr.sbin/mountd/mountd.c 17 Jul 2003 10:11:26 -0000 1.72 +++ src/usr.sbin/mountd/mountd.c 8 Sep 2003 21:57:54 -0000 @@ -2092,7 +2092,8 @@ 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; /* --- gid_t.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: