freebsd-dev/sys/rpc
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
..
rpcsec_gss Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
auth_none.c Implement support for RPCSEC_GSS authentication to both the NFS client 2008-11-03 10:38:00 +00:00
auth_unix.c Implement support for RPCSEC_GSS authentication to both the NFS client 2008-11-03 10:38:00 +00:00
auth.h Implement support for RPCSEC_GSS authentication to both the NFS client 2008-11-03 10:38:00 +00:00
authunix_prot.c Place hostnames and similar information fully under the prison system. 2009-05-29 21:27:12 +00:00
clnt_dg.c Fix upcall races in the client side krpc. For the client side upcall, 2009-06-04 14:49:27 +00:00
clnt_rc.c For the case where another thread was doing a connect and that 2009-06-10 19:02:09 +00:00
clnt_stat.h Add the new kernel-mode NFS Lock Manager. To use it instead of the 2008-03-26 15:23:12 +00:00
clnt_vc.c Fix upcall races in the client side krpc. For the client side upcall, 2009-06-04 14:49:27 +00:00
clnt.h Implement support for RPCSEC_GSS authentication to both the NFS client 2008-11-03 10:38:00 +00:00
getnetconfig.c Add the new kernel-mode NFS Lock Manager. To use it instead of the 2008-03-26 15:23:12 +00:00
inet_ntop.c Minor changes to improve compatibility with older FreeBSD releases. 2008-03-28 09:50:32 +00:00
inet_pton.c Minor changes to improve compatibility with older FreeBSD releases. 2008-03-28 09:50:32 +00:00
netconfig.h Add the new kernel-mode NFS Lock Manager. To use it instead of the 2008-03-26 15:23:12 +00:00
nettype.h Add the new kernel-mode NFS Lock Manager. To use it instead of the 2008-03-26 15:23:12 +00:00
pmap_prot.h Rename RPC's 'struct pmap' to 'struct portmap' to avoid confusing it with 2008-08-25 09:36:17 +00:00
replay.c Implement support for RPCSEC_GSS authentication to both the NFS client 2008-11-03 10:38:00 +00:00
replay.h Implement support for RPCSEC_GSS authentication to both the NFS client 2008-11-03 10:38:00 +00:00
rpc_callmsg.c Add the new kernel-mode NFS Lock Manager. To use it instead of the 2008-03-26 15:23:12 +00:00
rpc_com.h Implement support for RPCSEC_GSS authentication to both the NFS client 2008-11-03 10:38:00 +00:00
rpc_generic.c Implement support for RPCSEC_GSS authentication to both the NFS client 2008-11-03 10:38:00 +00:00
rpc_msg.h Implement support for RPCSEC_GSS authentication to both the NFS client 2008-11-03 10:38:00 +00:00
rpc_prot.c Implement support for RPCSEC_GSS authentication to both the NFS client 2008-11-03 10:38:00 +00:00
rpc.h Add the new kernel-mode NFS Lock Manager. To use it instead of the 2008-03-26 15:23:12 +00:00
rpcb_clnt.c It may be #if 0'd out code, but change a varname to not shadow a global. 2008-06-29 01:04:48 +00:00
rpcb_clnt.h Add the new kernel-mode NFS Lock Manager. To use it instead of the 2008-03-26 15:23:12 +00:00
rpcb_prot.c Rename RPC's 'struct pmap' to 'struct portmap' to avoid confusing it with 2008-08-25 09:36:17 +00:00
rpcb_prot.h Add the new kernel-mode NFS Lock Manager. To use it instead of the 2008-03-26 15:23:12 +00:00
rpcm_subs.h
rpcsec_gss.h Implement support for RPCSEC_GSS authentication to both the NFS client 2008-11-03 10:38:00 +00:00
svc_auth_unix.c Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
svc_auth.c Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
svc_auth.h Implement support for RPCSEC_GSS authentication to both the NFS client 2008-11-03 10:38:00 +00:00
svc_dg.c Rework socket upcalls to close some races with setup/teardown of upcalls. 2009-06-01 21:17:03 +00:00
svc_generic.c Since svc_[dg|vc|tli|tp]_create() did not hold a reference count on the 2009-06-17 22:50:26 +00:00
svc_vc.c Since svc_[dg|vc|tli|tp]_create() did not hold a reference count on the 2009-06-17 22:50:26 +00:00
svc.c Since svc_[dg|vc|tli|tp]_create() did not hold a reference count on the 2009-06-17 22:50:26 +00:00
svc.h Fix two races in the server side krpc w.r.t upcalls: 2009-06-04 14:13:06 +00:00
types.h Add the new kernel-mode NFS Lock Manager. To use it instead of the 2008-03-26 15:23:12 +00:00
xdr.h fix xdrmem_control to be safe in an if statement 2009-05-30 22:23:58 +00:00