Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

smb: client: disable path remapping with POSIX extensions

If SMB 3.1.1 POSIX Extensions are available and negotiated, the client
should be able to use all characters and not remap anything. Currently, the
user has to explicitly request this behavior by specifying the "nomapposix"
mount option.

Link: https://lore.kernel.org/4195bb677b33d680e77549890a4f4dd3b474ceaf.camel@rx2.rx-server.de
Signed-off-by: Philipp Kerling <pkerling@casix.org>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>

authored by

Philipp Kerling and committed by
Steve French
93310053 19272b37

+10 -2
+2
Documentation/admin-guide/cifs/usage.rst
··· 270 270 illegal Windows/NTFS/SMB characters to a remap range (this mount parameter 271 271 is the default for SMB3). This remap (``mapposix``) range is also 272 272 compatible with Mac (and "Services for Mac" on some older Windows). 273 + When POSIX Extensions for SMB 3.1.1 are negotiated, remapping is automatically 274 + disabled. 273 275 274 276 CIFS VFS Mount Options 275 277 ======================
+8 -2
fs/smb/client/connect.c
··· 3718 3718 goto out; 3719 3719 } 3720 3720 3721 - /* if new SMB3.11 POSIX extensions are supported do not remap / and \ */ 3722 - if (tcon->posix_extensions) 3721 + /* 3722 + * if new SMB3.11 POSIX extensions are supported, do not change anything in the 3723 + * path (i.e., do not remap / and \ and do not map any special characters) 3724 + */ 3725 + if (tcon->posix_extensions) { 3723 3726 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_POSIX_PATHS; 3727 + cifs_sb->mnt_cifs_flags &= ~(CIFS_MOUNT_MAP_SFM_CHR | 3728 + CIFS_MOUNT_MAP_SPECIAL_CHR); 3729 + } 3724 3730 3725 3731 #ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY 3726 3732 /* tell server which Unix caps we support */