Fix longstanding bug in Win2k clients by clearing the shortname
authorJeremy Allison <jra@samba.org>
Wed, 21 Aug 2002 21:07:27 +0000 (21:07 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 21 Aug 2002 21:07:27 +0000 (21:07 +0000)
buffer before returning ascii short name.
Jeremy.
(This used to be commit d01bbd42ff043d9fb0dc40dc4e207da8df0c9c14)

source3/smbd/trans2.c

index 8da55ba4ec5b179c41701e889c0e83ee9d726739..91e76012e6db0ab02f2719b8a0487b966b2b601a 100644 (file)
@@ -660,6 +660,11 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn,
                        SIVAL(p,0,nt_extmode); p += 4;
                        q = p; p += 4;
                        SIVAL(p,0,0); p += 4;
+                       /* Clear the short name buffer. This is
+                        * IMPORTANT as not doing so will trigger
+                        * a Win2k client bug. JRA.
+                        */
+                       memset(p,'\0',26);
                        if (!was_8_3) {
                                pstring mangled_name;
                                pstrcpy(mangled_name, fname);