diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2020-11-19 13:56:42 -0500 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2020-11-30 14:46:36 -0500 |
commit | 9853a5ac9be381917e9be0b4133cd4ac5a7ad875 (patch) | |
tree | dc8f1b58d4bbbd95c81d5dfabe7d915e4172dce1 /fs | |
parent | 1c8f0ad7dd35fd12307904036c7c839f77b6e3f9 (diff) |
NFSD: Replace READ* macros that decode the fattr4 owner attribute
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index e6c3b6766997..903b4db90aaf 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -360,11 +360,16 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, iattr->ia_valid |= ATTR_MODE; } if (bmval[1] & FATTR4_WORD1_OWNER) { - READ_BUF(4); - dummy32 = be32_to_cpup(p++); - READ_BUF(dummy32); - READMEM(buf, dummy32); - if ((status = nfsd_map_name_to_uid(argp->rqstp, buf, dummy32, &iattr->ia_uid))) + u32 length; + + if (xdr_stream_decode_u32(argp->xdr, &length) < 0) + return nfserr_bad_xdr; + p = xdr_inline_decode(argp->xdr, length); + if (!p) + return nfserr_bad_xdr; + status = nfsd_map_name_to_uid(argp->rqstp, (char *)p, length, + &iattr->ia_uid); + if (status) return status; iattr->ia_valid |= ATTR_UID; } |