diff options
author | J. Bruce Fields <bfields@redhat.com> | 2014-06-20 11:52:21 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-07-08 17:14:23 -0400 |
commit | 52ee04330f585d1b5bc40442f07df07248fa3aee (patch) | |
tree | 6a176680872e4bc505cdf410645afe9252ad2619 /fs/nfsd/nfs4proc.c | |
parent | 0aeae33f5d5fbd4af775e7c84795db9254d4a165 (diff) | |
download | linux-52ee04330f585d1b5bc40442f07df07248fa3aee.tar.gz linux-52ee04330f585d1b5bc40442f07df07248fa3aee.tar.bz2 linux-52ee04330f585d1b5bc40442f07df07248fa3aee.zip |
nfsd: let nfsd_symlink assume null-terminated data
Currently nfsd_symlink has a weird hack to serve callers who don't
null-terminate symlink data: it looks ahead at the next byte to see if
it's zero, and copies it to a new buffer to null-terminate if not.
That means callers don't have to null-terminate, but they *do* have to
ensure that the byte following the end of the data is theirs to read.
That's a bit subtle, and the NFSv4 code actually got this wrong.
So let's just throw out that code and let callers pass null-terminated
strings; we've already fixed them to do that.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4proc.c')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 2b3795a135e8..7aa83bf34fa9 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -623,7 +623,7 @@ nfsd4_create(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, case NF4LNK: status = nfsd_symlink(rqstp, &cstate->current_fh, create->cr_name, create->cr_namelen, - create->cr_linkname, create->cr_linklen, + create->cr_linkname, &resfh, &create->cr_iattr); break; |