Filenames with double quotes broken somewhere between 4.0.17 and 4.0.26

Jan Mikkelsen janm at transactionware.com
Wed Jul 29 11:44:09 UTC 2015


Hi,

Filenames with double quotes seem to have broken sometime between these versions.

With standard 4.0.26 a file called say "Test” (including the double quotes) gets mangled when presented to the client. I have tested this with OS X 10.9 OSX 10.10.4 and Windows 7 clients.

This worked fine a few releases ago -- the problem I am seeing is that files that were created from the client are no longer accessible using their name with double quotes and only the mangled name is available.

Changing source3/smbd/mangle_hash2.c like to not treat double quotes as a special character (patch below) make the mangling stop but the the 0x22 double quote character is translated to Unicode 0xf80 on the Unix side. I don’t see where this is happening.

Doing

   touch \”XYZ\”
   ls *XYZ* | xxd

when in a share directory on the client side gives:

0000000: 2258 595a 220a                           "XYZ”.

On the server side, in the same directory, ls *XYZ* | xxd gives:

00000000: ef80 a058 595a ef80 a00a                 ...XYZ….

Then the names aren’t matched and aren’t available even though it looks like they’re there.

This is on FreeBSD 10.2-PRERELEASE with a ZFS filesystem, with Unicode filenames enabled. This is samba 4.0.26 installed using the standard FreeBSD port.

Can anyone point me to where this translation might be happening? Or better yet, happen to know where the recent-ish change that might have caused this behaviour might be?

Thanks,

Jan Mikkelsen


--- source3/smbd/mangle_hash2.c.orig	2015-07-29 13:10:58.889516029 +1000
+++ source3/smbd/mangle_hash2.c	2015-07-29 16:47:16.535899881 +1000
@@ -109,7 +109,7 @@
 { "AUX", "LOCK$", "CON", "COM1", "COM2", "COM3", "COM4",
   "LPT1", "LPT2", "LPT3", "NUL", "PRN", NULL };
 
-#define DYNAMIC_MANGLE_TABLES 0
+#define DYNAMIC_MANGLE_TABLES 1
 
 #if DYNAMIC_MANGLE_TABLES
 
@@ -145,11 +145,11 @@
 			char_flags[i] |= FLAG_ASCII;
 		}
 
-		if (strchr("*\\/?<>|\":", i)) {
+		if (strchr("*\\/?<>|:", i)) {
 			char_flags[i] |= FLAG_ILLEGAL;
 		}
 
-		if (strchr("*?\"<>", i)) {
+		if (strchr("*?<>", i)) {
 			char_flags[i] |= FLAG_WILDCARD;
 		}
 	}
@@ -181,7 +181,7 @@
 		char_flags[(unsigned char)'.'] |= FLAG_POSSIBLE4;
 	}
 
-#if 0
+#if 1
 	DEBUG(10, ("char_flags\n"));
 	dump_data(10, char_flags, sizeof(char_flags));
 




More information about the samba-technical mailing list