linux-kernel-test/fs/cifs
Steve French b693855fe6 Allow conversion of characters in Mac remap range. Part 1
This allows directory listings to Mac to display filenames
correctly which have been created with illegal (to Windows)
characters in their filename. It does not allow
converting the other direction yet ie opening files with
these characters (followon patch).

There are seven reserved characters that need to be remapped when
mounting to Windows, Mac (or any server without Unix Extensions) which
are valid in POSIX but not in the other OS.

: \ < > ? * |

We used the normal UCS-2 remap range for this in order to convert this
to/from UTF8 as did Windows Services for Unix (basically add 0xF000 to
any of the 7 reserved characters), at least when the "mapchars" mount
option was specified.

Mac used a very slightly different "Services for Mac" remap range
0xF021 through 0xF027.  The attached patch allows cifs.ko (the kernel
client) to read directories on macs containing files with these
characters and display their names properly.  In theory this even
might be useful on mounts to Samba when the vfs_catia or new
"vfs_fruit" module is loaded.

Currently the 7 reserved characters look very strange in directory
listings from cifs.ko to Mac server.  This patch allows these file
name characters to be read (requires specifying mapchars on mount).

Two additional changes are needed:
1) Make it more automatic: a way of detecting enough info so that
we know to try to always remap these characters or not. Various
have suggested that the SFM approach be made the default when
the server does not support POSIX Unix extensions (cifs mounts
to Samba for example) so need to make SFM remapping the default
unless mapchars (SFU style mapping) specified on mount or no
mapping explicitly requested or no mapping needed (cifs mounts to Samba).

2) Adding a patch to map the characters the other direction
(ie UTF-8 to UCS-2 on open).  This patch does it for translating
readdir entries (ie UCS-2 to UTF-8)

Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
2014-10-16 15:20:20 -05:00
..
asn1.c [CIFS] cifs: Rename cERROR and cFYI to cifs_dbg 2013-05-04 22:17:23 -05:00
cache.c [CIFS] cifs: Rename cERROR and cFYI to cifs_dbg 2013-05-04 22:17:23 -05:00
cifs_debug.c [CIFS] Fix incorrect hex vs. decimal in some debug print statements 2014-08-02 21:16:48 -05:00
cifs_debug.h [CIFS] cifs: Rename cERROR and cFYI to cifs_dbg 2013-05-04 22:17:23 -05:00
cifs_dfs_ref.c cifs: replace strnicmp with strncasecmp 2014-10-14 02:18:24 +02:00
cifs_fs_sb.h Allow conversion of characters in Mac remap range. Part 1 2014-10-16 15:20:20 -05:00
cifs_spnego.c KEYS: Remove key_type::match in favour of overriding default by match_preparse 2014-09-16 17:36:06 +01:00
cifs_spnego.h [CIFS] Rename three structures to avoid camel case 2011-05-27 04:34:02 +00:00
cifs_unicode.c Allow conversion of characters in Mac remap range. Part 1 2014-10-16 15:20:20 -05:00
cifs_unicode.h Allow conversion of characters in Mac remap range. Part 1 2014-10-16 15:20:20 -05:00
cifs_uniupr.h cifs: correction of unicode header files 2010-08-20 00:46:42 +00:00
cifsacl.c KEYS: Remove key_type::match in favour of overriding default by match_preparse 2014-09-16 17:36:06 +01:00
cifsacl.h cifs: fix SID binary to string conversion 2012-12-11 11:48:49 -06:00
cifsencrypt.c Allow conversion of characters in Mac remap range. Part 1 2014-10-16 15:20:20 -05:00
cifsfs.c File locking related changes for v3.18 (pile #1) 2014-10-11 13:21:34 -04:00
cifsfs.h Update version number displayed by modinfo for cifs.ko 2014-09-16 05:31:01 -05:00
cifsglob.h Allow mknod and mkfifo on SMB2/SMB3 mounts 2014-10-16 15:20:19 -05:00
cifspdu.h Add missing definitions for CIFS File System Attributes 2014-08-12 23:47:14 -05:00
cifsproto.h CIFS: Use multicredits for SMB 2.1/3 writes 2014-08-02 01:23:03 -05:00
cifssmb.c CIFS: Optimize cifs_user_read() in a short read case on reconnects 2014-08-02 01:23:04 -05:00
connect.c Allow mknod and mkfifo on SMB2/SMB3 mounts 2014-10-16 15:20:19 -05:00
dir.c Allow mknod and mkfifo on SMB2/SMB3 mounts 2014-10-16 15:20:19 -05:00
dns_resolve.c cifs: fix composing of mount options for DFS referrals 2013-05-24 13:08:31 -05:00
dns_resolve.h DNS: Separate out CIFS DNS Resolver code 2010-08-05 17:17:51 +00:00
export.c [CIFS] cifs: Rename cERROR and cFYI to cifs_dbg 2013-05-04 22:17:23 -05:00
file.c Allow mknod and mkfifo on SMB2/SMB3 mounts 2014-10-16 15:20:19 -05:00
fscache.c NFS client updates for Linux 3.13 2013-11-08 05:57:46 +09:00
fscache.h CIFS: FS-Cache: Uncache unread pages in cifs_readpages() before freeing them 2013-09-18 10:17:03 -05:00
inode.c Allow mknod and mkfifo on SMB2/SMB3 mounts 2014-10-16 15:20:19 -05:00
ioctl.c fs: cifs: new helper: file_inode(file) 2014-05-21 10:18:05 -07:00
Kconfig Clarify Kconfig help text for CIFS and SMB2/SMB3 2014-08-25 17:01:05 -05:00
link.c mfsymlinks support for SMB2.1/SMB3. Part 2 query symlink 2014-10-16 15:20:20 -05:00
Makefile cifs: add new case-insensitive conversion routines that are based on wchar_t's 2013-09-08 14:38:05 -05:00
misc.c cifs: remove unused function cifs_oplock_break_wait 2014-08-11 01:31:03 -05:00
netmisc.c [CIFS] Fix setting time before epoch (negative time values) 2014-09-14 17:06:36 -05:00
nterr.c CIFS: Rename 7 error codes to NT_ style 2012-07-24 10:25:10 -05:00
nterr.h CIFS: Rename 7 error codes to NT_ style 2012-07-24 10:25:10 -05:00
ntlmssp.h CIFS: Add session setup/logoff capability for SMB2 2012-07-24 21:54:57 +04:00
readdir.c Allow conversion of characters in Mac remap range. Part 1 2014-10-16 15:20:20 -05:00
rfc1002pdu.h
sess.c cifs: remove dead code 2014-09-16 05:30:11 -05:00
smb1ops.c Allow mknod and mkfifo on SMB2/SMB3 mounts 2014-10-16 15:20:19 -05:00
smb2file.c CIFS: Fix wrong filename length for SMB2 2014-08-25 16:45:17 -05:00
smb2glob.h CIFS: Fix too big maxBuf size for SMB3 mounts 2014-02-14 16:50:47 -06:00
smb2inode.c CIFS: Fix wrong filename length for SMB2 2014-08-25 16:45:17 -05:00
smb2maperror.c Fix problem recognizing symlinks 2014-10-02 14:10:04 -05:00
smb2misc.c [CIFS] Workaround MacOS server problem with SMB2.1 write 2014-08-15 23:49:01 -05:00
smb2ops.c mfsymlinks support for SMB2.1/SMB3. Part 2 query symlink 2014-10-16 15:20:20 -05:00
smb2pdu.c Allow mknod and mkfifo on SMB2/SMB3 mounts 2014-10-16 15:20:19 -05:00
smb2pdu.h add defines for two new file attributes 2014-10-16 15:20:19 -05:00
smb2proto.h mfsymlinks support for SMB2.1/SMB3. Part 2 query symlink 2014-10-16 15:20:20 -05:00
smb2status.h CIFS: Add SMB2 status codes 2012-07-24 10:25:13 -05:00
smb2transport.c CIFS: Use multicredits for SMB 2.1/3 writes 2014-08-02 01:23:03 -05:00
smbencrypt.c [CIFS] cifs: Rename cERROR and cFYI to cifs_dbg 2013-05-04 22:17:23 -05:00
smberr.h cifs: map NT_STATUS_ERROR_WRITE_PROTECTED to -EROFS 2010-08-02 12:40:40 +00:00
smbfsctl.h enable fallocate punch hole ("fallocate -p") for SMB3 2014-08-17 18:12:38 -05:00
transport.c CIFS: Use multicredits for SMB 2.1/3 writes 2014-08-02 01:23:03 -05:00
winucase.c [CIFS] quiet sparse compile warning 2013-09-08 14:54:24 -05:00
xattr.c retrieving CIFS ACLs when mounted with SMB2 fails dropping session 2014-02-07 11:08:17 -06:00