From owner-cvs-src-old@FreeBSD.ORG Fri Jul 24 21:42:45 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7039D1065692 for ; Fri, 24 Jul 2009 21:42:45 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 3CE268FC2F for ; Fri, 24 Jul 2009 21:42:45 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OLgj1V081181 for ; Fri, 24 Jul 2009 21:42:45 GMT (envelope-from brooks@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6OLgjij081180 for cvs-src-old@freebsd.org; Fri, 24 Jul 2009 21:42:45 GMT (envelope-from brooks@repoman.freebsd.org) Message-Id: <200907242142.n6OLgjij081180@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to brooks@repoman.freebsd.org using -f From: Brooks Davis Date: Fri, 24 Jul 2009 21:42:10 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_7 Subject: cvs commit: src/lib/libc/gen initgroups.3 initgroups.c src/lib/libc/rpc auth_unix.c src/lib/libc/sys getgroups.2 setgroups.2 src/usr.bin/id id.c src/usr.bin/newgrp newgrp.c src/usr.bin/quota quota.c src/usr.sbin/chown chown.c ... X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 21:42:47 -0000 brooks 2009-07-24 21:42:10 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) lib/libc/gen initgroups.3 initgroups.c lib/libc/rpc auth_unix.c lib/libc/sys getgroups.2 setgroups.2 usr.bin/id id.c usr.bin/newgrp newgrp.c usr.bin/quota quota.c usr.sbin/chown chown.c usr.sbin/chroot chroot.c usr.sbin/jail jail.c usr.sbin/jexec jexec.c usr.sbin/lpr/lpc lpc.c Log: SVN rev 195859 on 2009-07-24 21:42:10Z by brooks MFC r194494 to improve support for 7.x worlds on >=8.0 kernels: In preparation for raising NGROUPS and NGROUPS_MAX, change base system callers of getgroups(), getgrouplist(), and setgroups() to allocate buffers dynamically. Specifically, allocate a buffer of size sysconf(_SC_NGROUPS_MAX)+1 (+2 in a few cases to allow for overflow). This (or similar gymnastics) is required for the code to actually follow the POSIX.1-2008 specification where {NGROUPS_MAX} may differ at runtime and where getgroups may return {NGROUPS_MAX}+1 results on systems like FreeBSD which include the primary group. In id(1), don't pointlessly add the primary group to the list of all groups, it is always the first result from getgroups(). In principle the old code was more portable, but this was only done in one of the two places where getgroups() was called to the overall effect was pointless. Document the actual POSIX requirements in the getgroups(2) and setgroups(2) manpages. We do not yet support a dynamic NGROUPS, but we may in the future. Revision Changes Path 1.13.2.1 +7 -0 src/lib/libc/gen/initgroups.3 1.9.2.1 +15 -6 src/lib/libc/gen/initgroups.c 1.18.2.1 +12 -6 src/lib/libc/rpc/auth_unix.c 1.13.2.1 +6 -4 src/lib/libc/sys/getgroups.2 1.14.2.1 +2 -4 src/lib/libc/sys/setgroups.2 1.33.2.2 +18 -7 src/usr.bin/id/id.c 1.2.20.1 +8 -4 src/usr.bin/newgrp/newgrp.c 1.31.2.1 +8 -2 src/usr.bin/quota/quota.c 1.29.18.1 +6 -2 src/usr.sbin/chown/chown.c 1.11.18.1 +7 -3 src/usr.sbin/chroot/chroot.c 1.25.2.2 +7 -2 src/usr.sbin/jail/jail.c 1.4.2.3 +7 -2 src/usr.sbin/jexec/jexec.c 1.31.2.1 +6 -2 src/usr.sbin/lpr/lpc/lpc.c