opnsense-src/sys/fs
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
..
cd9660 Update the inline version of vn_get_ino() for ".." lookups to match the 2009-06-12 21:19:57 +00:00
coda Remove the thread argument from the FSD (File-System Dependent) parts of 2009-05-11 15:33:26 +00:00
deadfs Add a simple VOP_VPTOCNP implementation for deadfs which returns EBADF. 2008-12-12 00:59:36 +00:00
devfs VOP_IOCTL takes unlocked vnode as an argument. Due to this, v_data may 2009-06-10 13:57:36 +00:00
fdescfs Report all fdescfs vnodes as VCHR for stat(2). Fake the unique 2009-05-12 09:28:45 +00:00
fifofs s/a_fdidx/a_fp/ for VOP_OPEN comments that inline struct vop_open_args 2009-06-10 14:09:05 +00:00
hpfs Remove the thread argument from the FSD (File-System Dependent) parts of 2009-05-11 15:33:26 +00:00
msdosfs Fix r193923 by noting that type of a_fp is struct file *, not int. 2009-06-10 14:24:31 +00:00
nfs Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
nfsclient Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
nfsserver Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
ntfs Remove the thread argument from the FSD (File-System Dependent) parts of 2009-05-11 15:33:26 +00:00
nullfs Implement the bypass routine for VOP_VPTOCNP in nullfs. 2009-05-31 14:58:43 +00:00
nwfs Eliminate the unnecessary clearing of a page's dirty bits from 2009-05-23 18:25:11 +00:00
portalfs Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
procfs Add hierarchical jails. A jail may further virtualize its environment 2009-05-27 14:11:23 +00:00
pseudofs VOP_IOCTL takes unlocked vnode as an argument. Due to this, v_data may 2009-06-10 13:57:36 +00:00
smbfs Make *getpages()s' assertion on the state of each page's dirty bits 2009-05-28 18:11:09 +00:00
tmpfs Eliminate unnecessary variables. 2009-06-13 20:21:08 +00:00
udf Use #ifdef APPLE_MAC instead of #ifdef MAC to conditionalize Apple-specific 2009-06-06 07:13:57 +00:00
unionfs Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00