summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver/nfs_srvsock.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-07-24 14:24:16 +0000
committerrwatson <rwatson@FreeBSD.org>2002-07-24 14:24:16 +0000
commit2fe187e9c495a09496907a116fda837f56f28624 (patch)
tree64c8597e9ae5f10b5594a384c394677b4d6b42f6 /sys/nfsserver/nfs_srvsock.c
parentdec15c3add5193c456e3fe80a06abfcf8acfc146 (diff)
downloadFreeBSD-src-2fe187e9c495a09496907a116fda837f56f28624.zip
FreeBSD-src-2fe187e9c495a09496907a116fda837f56f28624.tar.gz
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.
Diffstat (limited to 'sys/nfsserver/nfs_srvsock.c')
-rw-r--r--sys/nfsserver/nfs_srvsock.c7
1 files changed, 7 insertions, 0 deletions
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++);
OpenPOWER on IntegriCloud