Date: Fri, 24 Jul 2009 21:42:10 +0000 (UTC) From: Brooks Davis <brooks@FreeBSD.org> To: cvs-src-old@freebsd.org 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 ... Message-ID: <200907242142.n6OLgjij081180@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907242142.n6OLgjij081180>