Unicode bugs still with Win2K (PATCH#517)

Jeremy Allison jra at samba.org
Fri Sep 14 13:09:02 GMT 2001


Ok - here's the fix for the NTtrans Unicode problems
I'm going to commit. Alan, can you test this out please
and see if you can still reproduce the problem ?

Thanks,

	Jeremy.

Index: smbd/nttrans.c
===================================================================
RCS file: /data/cvs/samba/source/smbd/nttrans.c,v
retrieving revision 1.104.4.25
diff -u -w -b -r1.104.4.25 nttrans.c
--- smbd/nttrans.c      29 Aug 2001 19:56:27 -0000      1.104.4.25
+++ smbd/nttrans.c      14 Sep 2001 20:08:13 -0000
@@ -286,10 +286,6 @@
 
 static void get_filename_transact( char *fname, char *inbuf, int data_offset, int data_len, int fname_len)
 {
-  /*
-   * We need various heuristics here to detect a unicode string... JRA.
-   */
-
   DEBUG(10,("get_filename_transact: data_offset = %d, data_len = %d, fname_len = %d\n",
            data_offset, data_len, fname_len ));
 
@@ -299,7 +295,17 @@
    * the end here.
    */
 
-  if((data_len == 1) || (inbuf[data_offset] == '\0')) {
+       /*
+        * We need various heuristics here to detect a unicode string... JRA.
+        */
+
+       if( ((fname_len % 2) == 0) &&
+               (
+                       (data_len == 1) ||
+                       (inbuf[data_offset] == '\0') ||
+                       ((fname_len > 1) && (inbuf[data_offset+1] == '\\') && (inbuf[data_offset+2] == '\0'))
+               )) {
+
     /*
      * Ensure that the data offset is aligned
      * on a 2 byte boundary - add one if not.




More information about the samba-technical mailing list