ksmbd: add support for surrogate pair conversion
authorNamjae Jeon <linkinjeon@kernel.org>
Sat, 21 Oct 2023 12:01:20 +0000 (21:01 +0900)
committerSteve French <stfrench@microsoft.com>
Mon, 23 Oct 2023 00:06:27 +0000 (19:06 -0500)
commit0c180317c654a494fe429adbf7bc9b0793caf9e2
tree575bc22b33f825cb3af341eef8320f5f081f2869
parentecce70cf17d91c3dd87a0c4ea00b2d1387729701
ksmbd: add support for surrogate pair conversion

ksmbd is missing supporting to convert filename included surrogate pair
characters. It triggers a "file or folder does not exist" error in
Windows client.

[Steps to Reproduce for bug]
1. Create surrogate pair file
 touch $(echo -e '\xf0\x9d\x9f\xa3')
 touch $(echo -e '\xf0\x9d\x9f\xa4')

2. Try to open these files in ksmbd share through Windows client.

This patch update unicode functions not to consider about surrogate pair
(and IVS).

Reviewed-by: Marios Makassikis <mmakassikis@freebox.fr>
Tested-by: Marios Makassikis <mmakassikis@freebox.fr>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/server/unicode.c