]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] cifs: append \* properly on ASCII servers
authorSteve French <smfrench@austin.rr.com>
Sat, 30 Apr 2005 18:10:57 +0000 (11:10 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 30 Apr 2005 18:10:57 +0000 (11:10 -0700)
For older servers which do not support Unicode

Signed-off-by: Steve French (sfrench@us.ibm.com)
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/cifs/CHANGES
fs/cifs/cifssmb.c

index 4d2404305ab687c2a0eee84b3c5842ba9852965a..95483baab706baa9921eb14757c08da90970fdb5 100644 (file)
@@ -4,7 +4,9 @@ Fix error mapping of the TOO_MANY_LINKS (hardlinks) case.
 Do not oops if root user kills cifs oplock kernel thread or
 kills the cifsd thread (NB: killing the cifs kernel threads is not
 recommended, unmount and rmmod cifs will kill them when they are
-no longer needed).
+no longer needed).  Fix readdir to ASCII servers (ie older servers
+which do not support Unicode) and also require asterik.
+
 
 Version 1.33
 ------------
index b004fef0a42bac42e8b3490fba19df1ea233762d..741ff0c69f37f44154247020649b4104afff0cda 100644 (file)
@@ -2451,12 +2451,14 @@ findFirstRetry:
                name_len += 2;
        } else {        /* BB add check for overrun of SMB buf BB */
                name_len = strnlen(searchName, PATH_MAX);
-               name_len++;     /* trailing null */
 /* BB fix here and in unicode clause above ie
                if(name_len > buffersize-header)
                        free buffer exit; BB */
                strncpy(pSMB->FileName, searchName, name_len);
-               pSMB->FileName[name_len] = 0; /* just in case */
+               pSMB->FileName[name_len] = '\\';
+               pSMB->FileName[name_len+1] = '*';
+               pSMB->FileName[name_len+2] = 0;
+               name_len += 3;
        }
 
        params = 12 + name_len /* includes null */ ;