mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-21 01:03:42 +00:00
The NFSv4 server incorrectly assumed that the high order words of
the attribute bitmap argument would be non-zero. This caused an interoperability problem for a recent patch to the Linux NFSv4 client. The Linux folks have changed their patch to avoid this, but this patch fixes the problem on the server. Reported and tested by: Andre Heider (a.heider@gmail.com) MFC after: 3 days
This commit is contained in:
parent
fd1fba7ce3
commit
a36b76a787
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=253506
|
@ -761,21 +761,21 @@ nfsrv_getattrbits(struct nfsrv_descript *nd, nfsattrbit_t *attrbitp, int *cntp,
|
||||||
error = NFSERR_BADXDR;
|
error = NFSERR_BADXDR;
|
||||||
goto nfsmout;
|
goto nfsmout;
|
||||||
}
|
}
|
||||||
if (cnt > NFSATTRBIT_MAXWORDS) {
|
if (cnt > NFSATTRBIT_MAXWORDS)
|
||||||
outcnt = NFSATTRBIT_MAXWORDS;
|
outcnt = NFSATTRBIT_MAXWORDS;
|
||||||
if (retnotsupp)
|
else
|
||||||
*retnotsupp = NFSERR_ATTRNOTSUPP;
|
|
||||||
} else {
|
|
||||||
outcnt = cnt;
|
outcnt = cnt;
|
||||||
}
|
|
||||||
NFSZERO_ATTRBIT(attrbitp);
|
NFSZERO_ATTRBIT(attrbitp);
|
||||||
if (outcnt > 0) {
|
if (outcnt > 0) {
|
||||||
NFSM_DISSECT(tl, u_int32_t *, outcnt * NFSX_UNSIGNED);
|
NFSM_DISSECT(tl, u_int32_t *, outcnt * NFSX_UNSIGNED);
|
||||||
for (i = 0; i < outcnt; i++)
|
for (i = 0; i < outcnt; i++)
|
||||||
attrbitp->bits[i] = fxdr_unsigned(u_int32_t, *tl++);
|
attrbitp->bits[i] = fxdr_unsigned(u_int32_t, *tl++);
|
||||||
}
|
}
|
||||||
if (cnt > outcnt)
|
for (i = 0; i < (cnt - outcnt); i++) {
|
||||||
error = nfsm_advance(nd, (cnt - outcnt) * NFSX_UNSIGNED, -1);
|
NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED);
|
||||||
|
if (retnotsupp != NULL && *tl != 0)
|
||||||
|
*retnotsupp = NFSERR_ATTRNOTSUPP;
|
||||||
|
}
|
||||||
if (cntp)
|
if (cntp)
|
||||||
*cntp = NFSX_UNSIGNED + (cnt * NFSX_UNSIGNED);
|
*cntp = NFSX_UNSIGNED + (cnt * NFSX_UNSIGNED);
|
||||||
nfsmout:
|
nfsmout:
|
||||||
|
|
Loading…
Reference in a new issue