Patch agaisnt lib/charcnv.c:convert_string(164) convert_string Message in log files

Dr. Tilo Levante tilo at levante.de
Wed Apr 30 14:08:11 GMT 2003


Hello,

I got a number of these message, always when I walked through a profile share
with the Windows Explorer.

The problem is in the Query for the Alternate Filename in trans2.c.
Instead of the 8.3 filename, the full filename was returned.
I patched it, so that it returns the same name as used in another query
for the alternate file name.

I include the diff againt the current cvs SAMBO_3_0 from today.

Greetings#

tilo
tilo at levante.de

cvs diff -u trans2.c
Index: trans2.c
===================================================================
RCS file: /cvsroot/samba/source/smbd/trans2.c,v
retrieving revision 1.217.2.17
diff -u -r1.217.2.17 trans2.c
--- trans2.c    24 Apr 2003 18:58:26 -0000      1.217.2.17
+++ trans2.c    30 Apr 2003 13:43:33 -0000
@@ -1936,12 +1936,19 @@
 #endif

                case SMB_FILE_ALTERNATE_NAME_INFORMATION:
-                       /* Last component of pathname. */
+                       /* return 8.3 filename */
                        {
-                               size_t byte_len = dos_PutUniCode(pdata+4,fname,max_data_bytes,False);
-                               SIVAL(pdata,0,byte_len);
-                               data_size = 4 + byte_len;
-                               break;
+                       pstring short_name;
+
+                       pstrcpy(short_name,base_name);
+                       /* Mangle if not already 8.3 */
+                       if(!mangle_is_8_3(short_name, True)) {
+                               mangle_map(short_name,True,True,SNUM(conn));
+                       }
+                       size_t byte_len = dos_PutUniCode(pdata+4,short_name,max_data_bytes,False);
+                       SIVAL(pdata,0,byte_len);
+                       data_size = 4 + byte_len;
+                       break;
                        }

 #if 0



More information about the samba-technical mailing list