[Samba] server not using utf8-mode with Synology client

Xen list at xenhideout.nl
Mon Jul 11 23:56:57 UTC 2016


Jeremy Allison schreef op 12-07-2016 1:27:

> With unix extensions disabled, I think the cifsfs client
> does the private character area mapping to be able to
> store ':' and other banned characters.

The issue was not special characters in the first place.

With extensions enabled, what happened was this:

the server received every filename as:

2F F0 65 00

where 65 00 would for example be the first letter of the timename (like 
's' or something) and 2F F0 would be a preceding character.

This is little-endian notation. Apparently this is the buffer received 
by the server.

So it gets read as #F02F which is a unicode code point that translates 
to #ef80af in utf-8 on disk. So the file created by the client called 
"some_file" becomes

"^some_file" where ^ is the special character resulting from that utf8 
character.

Equally, when reading files, the client apparent sends a request that 
gets received as that same. Consequently If I send a request for 
"some_file" the server receives it as a request for "^some_file" and 
cannot find the file requested.

I don't have the log right now. It is on another computer and I have a 
hard time walking.

But in the log with verbosity 10 you can see a buffer dump as above with 
little-ending 16-bit values and each time there will be that 2F F0 
preceding the actual filename.


At that point I started using special characters to see what would 
happen and found that multi-byte utf-8 was getting interpreted as 
individual unicode values (16-bit) by the server.

This doensn't happen on output *from* the server; ie. a directory 
listing is actually correct. Done by the client. However filenames 
requested or used by the client get mangled.




More information about the samba mailing list