freebsd-dev/usr.sbin/mount_portalfs
brooks f8701ebdca 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
..
activate.c Clean up compilation warnings. Set WARNS=6 in Makefile. 2007-01-20 21:35:11 +00:00
conf.c Clean up compilation warnings. Set WARNS=6 in Makefile. 2007-01-20 21:35:11 +00:00
cred.c
Makefile Decrease to WARNS=3. 2007-01-20 23:24:11 +00:00
mount_portalfs.8
mount_portalfs.c Add volatile to sig_atomic_t where it was missing. 2009-06-14 21:39:52 +00:00
pathnames.h
portal.conf
portald.h Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
pt_conf.c
pt_exec.c Clean up compilation warnings. Set WARNS=6 in Makefile. 2007-01-20 21:35:11 +00:00
pt_file.c Clean up compilation warnings. Set WARNS=6 in Makefile. 2007-01-20 21:35:11 +00:00
pt_pipe.c Clean up compilation warnings. Set WARNS=6 in Makefile. 2007-01-20 21:35:11 +00:00
pt_tcp.c Clean up compilation warnings. Set WARNS=6 in Makefile. 2007-01-20 21:35:11 +00:00
pt_tcplisten.c Clean up compilation warnings. Set WARNS=6 in Makefile. 2007-01-20 21:35:11 +00:00