The Samba-Bugzilla – Bug 11307
Files/directories with reserved characters (colon or question mark) behave strangely
Last modified: 2015-12-16 07:55:43 UTC
Created attachment 11118 [details]
Example of behavior showing old system and new system
Recent updates have caused mounted files/directories named with Windows reserved characters (*, :, |, <, >, ?) to behave strangely.
Files containing the special characters can be read normally but cannot be deleted. Directories containing the special characters will appear with an `ls` but the contents of the directory will not appear. Files in the directory appear to be readable if the full path is known.
The problem is evident with kernel version is 4.0.4-2-ARCH. On an older system (kernel version 3.16.3-1-ARCH) it's fine. I am attaching a file showing some examples of the behavior.
Downgrading cifs-utils didn't seem to help. smbclient appears to be unaffected, as I can access the remote server just fine.
If it's relevant, I am fairly certain the remote server supports unicode, as I have a number of files on the share that contain CJK characters in filenames (the remote server is the default on the ASUS RT-N66U router).
The change seems to have happened in arch sometime between November 2014 and February 2015. I believe this is not an arch-specific bug, as at least one other user has seen the same issue on Debian sid:
I've narrowed down the kernel version this behavior was introduced in, at least in the Arch Linux packages.
Version 3.17.6-1-ARCH behaves as expected, but 3.18.2-2-ARCH does not.
According to the Arch Rollback Machine, that package was introduced 2015-01-15:
So the change was introduced sometime betweer 3.17.6 and 3.18.2. Could it be related to this?
The wiki also says there was a change to the way the reserved characters were mapped:
"By default support mapchars ('SFM' style remapping, ie the same way the Mac remaps them) for the seven reserved characters (*, ?, : etc.) when mounting with SMB3."
I can confirm this -- I have the same issue. I have a Linux Samba server and Linux client. I believe I am using protocol version 1 (seems to be the default). I changed nothing on the server, but I did upgrade the kernel on my client machine from 3.12.13 to 4.1.12. Since then, I can list but not read files which contain the Windows reserved chars, and I cannot enter directories which contain those chars. Also, since UNIX extensions are enabled on the server and client (this is the default since both are Linux) I cannot use symlinks to read files/directories which have such chars in their paths, even if the symlinks themselves do not have such chars in their names.
I use Gentoo Linux on both my client and server. On the client machine, I tried cifs-utils-6.1-r1 and 6.4 -- neither worked.
The bug you linked to https://bugzilla.kernel.org/show_bug.cgi?id=92401 describes exactly what I am seeing.