[PATCH][CIFS] Mapping reserved characters over CIFS and SMB3. Part 3 of 3
smfrench at gmail.com
Sun Sep 28 19:33:41 MDT 2014
Remap reserved posix characters by default (part 3/3)
Following suggestions from multiple people to map the
seven reserved characters by default rather than require
. the user to remember to pass a mount option. Attached is
the last patch (of 3) in the series. The whole series of
three patches is at:
This is a bigger patch, but its size is mostly due to a single change
(repeated multiple times) to how we check for remapping illegal characters
in file names - repeated, small changes to the way callers request
converting file names.
This final patch in the series does the following:
1) changes default behavior for cifs to be more intuitive.
Currently we do not map by default to seven reserved characters,
ie those valid in POSIX but not in NTFS/CIFS/SMB3/Windows,
unless a mount option (mapchars) is specified. Change this
to by default always map and map using the SFM maping
(like the Mac uses) unless the server negotiates the CIFS Unix
Extensions (like Samba does when mounting with the cifs protocol)
when the remapping of the characters is unnecessary. This should
help SMB3 mounts in particular since Samba will likely be
able to implement this mapping with its new "vfs_fruit" module
as it will be doing for the Mac.
2) if the user specifies the existing "mapchars" mount option then
use the "SFU" (Microsoft Services for Unix, SUA) style mapping of
the seven characters instead.
3) if the user specifies "nomapposix" then disable SFM/MAC style mapping
(so no character remapping would be used unless the user specifies
"mapchars" on mount as well, as above).
4) change all the places in the code that check for the superblock
flag on the mount which is set by mapchars and passed in on all
path based operation and change it to use a small function call
instead to set the mapping type properly (and check for the
mapping type in the cifs unicode functions)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 24582 bytes
Desc: not available
More information about the samba-technical