Commit 93310053 authored by Philipp Kerling's avatar Philipp Kerling Committed by Steve French
Browse files

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: default avatarPhilipp Kerling <pkerling@casix.org>
Reviewed-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 19272b37
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -270,6 +270,8 @@ configured for Unix Extensions (and the client has not disabled
illegal Windows/NTFS/SMB characters to a remap range (this mount parameter
is the default for SMB3). This remap (``mapposix``) range is also
compatible with Mac (and "Services for Mac" on some older Windows).
When POSIX Extensions for SMB 3.1.1 are negotiated, remapping is automatically
disabled.

CIFS VFS Mount Options
======================
+8 −2
Original line number Diff line number Diff line
@@ -3718,9 +3718,15 @@ int cifs_mount_get_tcon(struct cifs_mount_ctx *mnt_ctx)
		goto out;
	}

	/* if new SMB3.11 POSIX extensions are supported do not remap / and \ */
	if (tcon->posix_extensions)
	/*
	 * if new SMB3.11 POSIX extensions are supported, do not change anything in the
	 * path (i.e., do not remap / and \ and do not map any special characters)
	 */
	if (tcon->posix_extensions) {
		cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_POSIX_PATHS;
		cifs_sb->mnt_cifs_flags &= ~(CIFS_MOUNT_MAP_SFM_CHR |
					     CIFS_MOUNT_MAP_SPECIAL_CHR);
	}

#ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
	/* tell server which Unix caps we support */