mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-03 09:00:21 +00:00
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.
This commit is contained in:
parent
5f0de71223
commit
30268a208b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=100606
@ -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++);
|
||||
|
Loading…
Reference in New Issue
Block a user