]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
cifs: fix artificial limit on reading symlinks
authorJeff Layton <jlayton@redhat.com>
Sun, 24 May 2009 22:45:17 +0000 (18:45 -0400)
committerSteve French <sfrench@us.ibm.com>
Tue, 26 May 2009 21:09:14 +0000 (21:09 +0000)
There's no reason to limit the size of a symlink that we can read to
4000 bytes. That may be nowhere near PATH_MAX if the server is sending
UCS2 strings. CIFS should be able to read in a symlink up to the size of
the buffer. The size of the header has already been accounted for when
creating the slabcache, so CIFSMaxBufSize should be the correct size to
pass in.

Fixes samba bug #6384.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifssmb.c

index d06260251c304692dc2789c14059170245ad2957..aece2a8c1a7c396df30273d15f8f8f55d7605748 100644 (file)
@@ -2427,8 +2427,7 @@ querySymLinkRetry:
        params = 2 /* level */  + 4 /* rsrvd */  + name_len /* incl null */ ;
        pSMB->TotalDataCount = 0;
        pSMB->MaxParameterCount = cpu_to_le16(2);
-       /* BB find exact max data count below from sess structure BB */
-       pSMB->MaxDataCount = cpu_to_le16(4000);
+       pSMB->MaxDataCount = cpu_to_le16(CIFSMaxBufSize);
        pSMB->MaxSetupCount = 0;
        pSMB->Reserved = 0;
        pSMB->Flags = 0;