Check the version of ex_anon (a `struct xucred') before using it to

fill out netc_anon (a `struct ucred'), and add an XXX around the
entire operation since it isn't clear whether it's doing the right
thing with things like cr_uidinfo and cr_prison.
This commit is contained in:
dd 2002-03-03 06:07:57 +00:00
parent 35f67b85ba
commit a9f1d1dab4

View File

@ -93,6 +93,16 @@ vfs_hang_addrlist(mp, nep, argp)
struct domain *dom;
int error;
/*
* XXX: This routine converts from a `struct xucred'
* (argp->ex_anon) to a `struct ucred' (np->netc_anon). This
* operation is questionable; for example, what should be done
* with fields like cr_uidinfo and cr_prison? Currently, this
* routine does not touch them (leaves them as NULL).
*/
if (argp->ex_anon.cr_version != XUCRED_VERSION)
return (EINVAL);
if (argp->ex_addrlen == 0) {
if (mp->mnt_flag & MNT_DEFEXPORTED)
return (EPERM);