freebsd-dev/sys/nfsserver
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
..
nfs_fha.c We need to pass a structure with enough space for an NFSv2 filehandle to 2008-12-10 14:49:54 +00:00
nfs_fha.h Implement support for RPCSEC_GSS authentication to both the NFS client 2008-11-03 10:38:00 +00:00
nfs_serv.c Remove the thread argument from the FSD (File-System Dependent) parts of 2009-05-11 15:33:26 +00:00
nfs_srvcache.c Implement support for RPCSEC_GSS authentication to both the NFS client 2008-11-03 10:38:00 +00:00
nfs_srvkrpc.c Since svc_[dg|vc|tli|tp]_create() did not hold a reference count on the 2009-06-17 22:50:26 +00:00
nfs_srvsock.c Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
nfs_srvsubs.c Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
nfs_syscalls.c Rework socket upcalls to close some races with setup/teardown of upcalls. 2009-06-01 21:17:03 +00:00
nfs.h Rework socket upcalls to close some races with setup/teardown of upcalls. 2009-06-01 21:17:03 +00:00
nfsm_subs.h Implement support for RPCSEC_GSS authentication to both the NFS client 2008-11-03 10:38:00 +00:00
nfsrvcache.h Implement support for RPCSEC_GSS authentication to both the NFS client 2008-11-03 10:38:00 +00:00
nfsrvstats.h