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 /sbin | |
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 'sbin')
-rw-r--r-- | sbin/mountd/mountd.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c index ffb1b6e..2f46a9f 100644 --- a/sbin/mountd/mountd.c +++ b/sbin/mountd/mountd.c @@ -161,9 +161,9 @@ int chk_host __P((struct dirlist *, u_int32_t, int *, int *)); void del_mlist __P((char *, char *)); struct dirlist *dirp_search __P((struct dirlist *, char *)); int do_mount __P((struct exportlist *, struct grouplist *, int, - struct ucred *, char *, int, struct statfs *)); + struct xucred *, char *, int, struct statfs *)); int do_opt __P((char **, char **, struct exportlist *, struct grouplist *, - int *, int *, struct ucred *)); + int *, int *, struct xucred *)); struct exportlist *ex_search __P((fsid_t *)); struct exportlist *get_exp __P((void)); void free_dir __P((struct dirlist *)); @@ -184,7 +184,7 @@ void hang_dirp __P((struct dirlist *, struct grouplist *, void mntsrv __P((struct svc_req *, SVCXPRT *)); void nextfield __P((char **, char **)); void out_of_mem __P((void)); -void parsecred __P((char *, struct ucred *)); +void parsecred __P((char *, struct xucred *)); int put_exlist __P((struct dirlist *, XDR *, struct dirlist *, int *)); int scan_tree __P((struct dirlist *, u_int32_t)); static void usage __P((void)); @@ -202,11 +202,12 @@ struct exportlist *exphead; struct mountlist *mlhead; struct grouplist *grphead; char exname[MAXPATHLEN]; -struct ucred def_anon = { +struct xucred def_anon = { + 0, + (uid_t)-2, 1, - (uid_t) -2, - 1, - { (gid_t) -2 } + { (gid_t)-2 }, + NULL }; int force_v2 = 0; int resvport_only = 1; @@ -732,7 +733,7 @@ get_exportlist() struct dirlist *dirhead; struct statfs fsb, *fsp; struct hostent *hpe; - struct ucred anon; + struct xucred anon; char *cp, *endcp, *dirp, *hst, *usr, *dom, savedc; int len, has_host, exflags, got_nondir, dirplen, num, i, netgrp; @@ -1332,7 +1333,7 @@ do_opt(cpp, endcpp, ep, grp, has_hostp, exflagsp, cr) struct grouplist *grp; int *has_hostp; int *exflagsp; - struct ucred *cr; + struct xucred *cr; { char *cpoptarg, *cpoptend; char *cp, *endcp, *cpopt, savedc, savedc2; @@ -1591,7 +1592,7 @@ do_mount(ep, grp, exflags, anoncrp, dirp, dirplen, fsb) struct exportlist *ep; struct grouplist *grp; int exflags; - struct ucred *anoncrp; + struct xucred *anoncrp; char *dirp; int dirplen; struct statfs *fsb; @@ -1842,7 +1843,7 @@ get_line() void parsecred(namelist, cr) char *namelist; - struct ucred *cr; + struct xucred *cr; { char *name; int cnt; @@ -1854,7 +1855,6 @@ parsecred(namelist, cr) /* * Set up the unprivileged user. */ - cr->cr_ref = 1; cr->cr_uid = -2; cr->cr_groups[0] = -2; cr->cr_ngroups = 1; |