freebsd-dev/lib/libkvm
Brooks Davis 838d985825 Rework the credential code to support larger values of NGROUPS and
NGROUPS_MAX, eliminate ABI dependencies on them, and raise the to 1024
and 1023 respectively.  (Previously they were equal, but under a close
reading of POSIX, NGROUPS_MAX was defined to be too large by 1 since it
is the number of supplemental groups, not total number of groups.)

The bulk of the change consists of converting the struct ucred member
cr_groups from a static array to a pointer.  Do the equivalent in
kinfo_proc.

Introduce new interfaces crcopysafe() and crsetgroups() for duplicating
a process credential before modifying it and for setting group lists
respectively.  Both interfaces take care for the details of allocating
groups array. crsetgroups() takes care of truncating the group list
to the current maximum (NGROUPS) if necessary.  In the future,
crsetgroups() may be responsible for insuring invariants such as sorting
the supplemental groups to allow groupmember() to be implemented as a
binary search.

Because we can not change struct xucred without breaking application
ABIs, we leave it alone and introduce a new XU_NGROUPS value which is
always 16 and is to be used or NGRPS as appropriate for things such as
NFS which need to use no more than 16 groups.  When feasible, truncate
the group list rather than generating an error.

Minor changes:
  - Reduce the number of hand rolled versions of groupmember().
  - Do not assign to both cr_gid and cr_groups[0].
  - Modify ipfw to cache ucreds instead of part of their contents since
    they are immutable once referenced by more than one entity.

Submitted by:	Isilon Systems (initial implementation)
X-MFC after:	never
PR:		bin/113398 kern/133867
2009-06-19 17:10:35 +00:00
..
kvm_amd64.c Fix missing includes of <string.h>, to silence some compiler warnings. 2009-06-14 12:42:06 +00:00
kvm_arm.c Fix missing includes of <string.h>, to silence some compiler warnings. 2009-06-14 12:42:06 +00:00
kvm_cptime.c Fix missing includes of <string.h>, to silence some compiler warnings. 2009-06-14 12:42:06 +00:00
kvm_file.c Fix missing includes of <string.h>, to silence some compiler warnings. 2009-06-14 12:42:06 +00:00
kvm_getcptime.3 Add a new routine kvm_getcptime(3) for fetching the equivalent of 2008-08-19 21:30:36 +00:00
kvm_geterr.3 Remove the advertising clause. UCB did this some time ago, but these 2007-01-08 17:35:36 +00:00
kvm_getfiles.3 Remove the advertising clause. UCB did this some time ago, but these 2007-01-08 17:35:36 +00:00
kvm_getloadavg.3 Remove the advertising clause. UCB did this some time ago, but these 2007-01-08 17:35:36 +00:00
kvm_getloadavg.c Remove the advertising clause. UCB did this some time ago, but these 2007-01-08 17:35:36 +00:00
kvm_getpcpu.3 Add a "CACHING" section regarding the internal caching of kernel variables 2008-08-21 19:22:13 +00:00
kvm_getprocs.3 Remove the advertising clause. UCB did this some time ago, but these 2007-01-08 17:35:36 +00:00
kvm_getswapinfo.3 Expand the license referenced indirectly inline. 2004-07-31 18:49:53 +00:00
kvm_getswapinfo.c - Move 'struct swdevt' back into swap_pager.h and expose it to userland. 2007-02-07 17:43:11 +00:00
kvm_i386.c Fix missing includes of <string.h>, to silence some compiler warnings. 2009-06-14 12:42:06 +00:00
kvm_ia64.c Add a level of indirection to the kernel PTE table. The old 2007-05-19 13:11:27 +00:00
kvm_minidump_amd64.c Fix missing includes of <string.h>, to silence some compiler warnings. 2009-06-14 12:42:06 +00:00
kvm_minidump_arm.c Support kernel crash mini dumps on ARM architecture. 2008-11-06 16:20:27 +00:00
kvm_minidump_i386.c Fix missing includes of <string.h>, to silence some compiler warnings. 2009-06-14 12:42:06 +00:00
kvm_mips.c First cut at doing the kvm file needed for mips. 2008-07-23 07:24:55 +00:00
kvm_nlist.3 Remove the advertising clause. UCB did this some time ago, but these 2007-01-08 17:35:36 +00:00
kvm_open.3 Remove the advertising clause. UCB did this some time ago, but these 2007-01-08 17:35:36 +00:00
kvm_pcpu.c Add two new routines to libkvm for working with per-CPU data: 2008-08-19 19:55:33 +00:00
kvm_powerpc.c Add support for PowerPC kernel core files. This commit only adds 2009-04-06 21:52:10 +00:00
kvm_private.h Support kernel crash mini dumps on ARM architecture. 2008-11-06 16:20:27 +00:00
kvm_proc.c Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
kvm_read.3 Remove the advertising clause. UCB did this some time ago, but these 2007-01-08 17:35:36 +00:00
kvm_sparc64.c Remove the advertising clause. UCB did this some time ago, but these 2007-01-08 17:35:36 +00:00
kvm_sparc.c Remove the advertising clause. UCB did this some time ago, but these 2007-01-08 17:35:36 +00:00
kvm.3 Remove the advertising clause. UCB did this some time ago, but these 2007-01-08 17:35:36 +00:00
kvm.c Reduce code duplication: use calloc() intead of malloc() 2008-10-17 20:11:28 +00:00
kvm.h Add a new routine kvm_getcptime(3) for fetching the equivalent of 2008-08-19 21:30:36 +00:00
Makefile Support kernel crash mini dumps on ARM architecture. 2008-11-06 16:20:27 +00:00