From 2fe187e9c495a09496907a116fda837f56f28624 Mon Sep 17 00:00:00 2001 From: rwatson Date: Wed, 24 Jul 2002 14:24:16 +0000 Subject: Stick a dark comment in about the fact that the NFS server code allocates a ucred by itself as part of an nfs descriptor, then bzero's the ucred, fails to initialize the mutex, etc. This is very bad, but I don't have time to fix it right now. nfsd should instead hold a cred pointer, and the credential should be properly initialized, probably from a descendent of a kernel process credential. --- sys/nfsserver/nfs_srvsock.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sys/nfsserver') diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c index c03a38a..bf4e985 100644 --- a/sys/nfsserver/nfs_srvsock.c +++ b/sys/nfsserver/nfs_srvsock.c @@ -354,6 +354,13 @@ nfs_getreq(struct nfsrv_descript *nd, struct nfsd *nfsd, int has_header) } nfsm_adv(nfsm_rndup(len)); tl = nfsm_dissect(u_int32_t *, 3 * NFSX_UNSIGNED); + /* + * XXX: This credential should be managed using crget(9) + * and related calls. Right now, this tramples on any + * extensible data in the ucred, fails to initialize the + * mutex, and worse. This must be fixed before FreeBSD + * 5.0-RELEASE. + */ bzero((caddr_t)&nd->nd_cr, sizeof (struct ucred)); nd->nd_cr.cr_ref = 1; nd->nd_cr.cr_uid = fxdr_unsigned(uid_t, *tl++); -- cgit v1.1