diff options
author | green <green@FreeBSD.org> | 2001-02-18 13:30:20 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 2001-02-18 13:30:20 +0000 |
commit | 18d474781ff1acbc67429e2db4fa0cf9a0d3c51e (patch) | |
tree | 808a921485b80fef4bca2cceb1aebb079b676224 /sys/kern/vfs_export.c | |
parent | e3ae1d8f1208e5e776d6d807b5d3249c810fa857 (diff) | |
download | FreeBSD-src-18d474781ff1acbc67429e2db4fa0cf9a0d3c51e.zip FreeBSD-src-18d474781ff1acbc67429e2db4fa0cf9a0d3c51e.tar.gz |
Switch to using a struct xucred instead of a struct xucred when not
actually in the kernel. This structure is a different size than
what is currently in -CURRENT, but should hopefully be the last time
any application breakage is caused there. As soon as any major
inconveniences are removed, the definition of the in-kernel struct
ucred should be conditionalized upon defined(_KERNEL).
This also changes struct export_args to remove dependency on the
constantly-changing struct ucred, as well as limiting the bounds
of the size fields to the correct size. This means: a) mountd and
friends won't break all the time, b) mountd and friends won't crash
the kernel all the time if they don't know what they're doing wrt
actual struct export_args layout.
Reviewed by: bde
Diffstat (limited to 'sys/kern/vfs_export.c')
-rw-r--r-- | sys/kern/vfs_export.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index 38c1895..3c99779 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -2319,7 +2319,11 @@ vfs_hang_addrlist(mp, nep, argp) return (EPERM); np = &nep->ne_defexported; np->netc_exflags = argp->ex_flags; - np->netc_anon = argp->ex_anon; + bzero(&np->netc_anon, sizeof(np->netc_anon)); + np->netc_anon.cr_uid = argp->ex_anon.cr_uid; + np->netc_anon.cr_ngroups = argp->ex_anon.cr_ngroups; + bcopy(argp->ex_anon.cr_groups, np->netc_anon.cr_groups, + sizeof(np->netc_anon.cr_groups)); np->netc_anon.cr_ref = 1; mp->mnt_flag |= MNT_DEFEXPORTED; return (0); @@ -2363,7 +2367,11 @@ vfs_hang_addrlist(mp, nep, argp) goto out; } np->netc_exflags = argp->ex_flags; - np->netc_anon = argp->ex_anon; + bzero(&np->netc_anon, sizeof(np->netc_anon)); + np->netc_anon.cr_uid = argp->ex_anon.cr_uid; + np->netc_anon.cr_ngroups = argp->ex_anon.cr_ngroups; + bcopy(argp->ex_anon.cr_groups, np->netc_anon.cr_groups, + sizeof(np->netc_anon.cr_groups)); np->netc_anon.cr_ref = 1; return (0); out: |