freebsd-skq/sys/fs/nfs
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_commonacl.c Don't check MAC in the NFS server ACL set path, right now we aren't 2009-06-05 14:15:00 +00:00
nfs_commonkrpc.c Crib the realign function out of nfs_krpc.c and add a call 2009-05-24 19:46:12 +00:00
nfs_commonport.c Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
nfs_commonsubs.c Fix the experimental nfs subsystem so that it builds with the 2009-05-26 22:21:53 +00:00
nfs_var.h Change the experimental NFSv4 client so that it does not do 2009-05-18 21:22:03 +00:00
nfs.h Fix the comment in sys/fs/nfs/nfs.h to correctly reflect the 2009-05-22 14:53:26 +00:00
nfscl.h
nfsclstate.h
nfsdport.h Apply changes to the experimental nfs server so that it uses the security 2009-05-14 21:39:08 +00:00
nfskpiport.h
nfsm_subs.h
nfsport.h Add the explicit include of vimage.h to another five .c files still 2009-06-17 12:44:11 +00:00
nfsproto.h Move the nfsstat structure and proc/op number definitions on the 2009-05-15 19:33:59 +00:00
nfsrvcache.h
nfsrvstate.h
nfsv4_errstr.h
rpcv2.h
xdr_subs.h