CIFS: add misssing SFM mapping for doublequote
authorBjörn Jacke <bj@sernet.de>
Fri, 5 May 2017 02:36:16 +0000 (04:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 May 2017 12:27:01 +0000 (14:27 +0200)
commit 85435d7a15294f9f7ef23469e6aaf7c5dfcc54f0 upstream.

SFM is mapping doublequote to 0xF020

Without this patch creating files with doublequote fails to Windows/Mac

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/cifs_unicode.c
fs/cifs/cifs_unicode.h

index 02b071bf3732ac29808183974636e2ac9ca56ce6..a0b3e7d1be484fd3f026258577e18c165f738f0e 100644 (file)
@@ -83,6 +83,9 @@ convert_sfm_char(const __u16 src_char, char *target)
        case SFM_COLON:
                *target = ':';
                break;
+       case SFM_DOUBLEQUOTE:
+               *target = '"';
+               break;
        case SFM_ASTERISK:
                *target = '*';
                break;
@@ -418,6 +421,9 @@ static __le16 convert_to_sfm_char(char src_char, bool end_of_string)
        case ':':
                dest_char = cpu_to_le16(SFM_COLON);
                break;
+       case '"':
+               dest_char = cpu_to_le16(SFM_DOUBLEQUOTE);
+               break;
        case '*':
                dest_char = cpu_to_le16(SFM_ASTERISK);
                break;
index a61b9166622ca969ea585ab0b7189fa65ea46bf8..07ade707fa60a43c9f64ad72512b1992c98c4ff1 100644 (file)
@@ -57,6 +57,7 @@
  * not conflict (although almost does) with the mapping above.
  */
 
+#define SFM_DOUBLEQUOTE ((__u16) 0xF020)
 #define SFM_ASTERISK    ((__u16) 0xF021)
 #define SFM_QUESTION    ((__u16) 0xF025)
 #define SFM_COLON       ((__u16) 0xF022)