cifs: Add support for parsing WSL-style symlinks
authorPali Rohár <pali@kernel.org>
Sat, 28 Sep 2024 11:21:24 +0000 (13:21 +0200)
committerSteve French <stfrench@microsoft.com>
Mon, 25 Nov 2024 20:50:32 +0000 (14:50 -0600)
commit06a7adf318a30bdcfa1222ed6d2640e6bb266d7b
treed4a9b8e78573968694d74dc60544188cd8a7d639
parentdd26bc067e44956e43a273e6e0a9c1fc4ed32cb7
cifs: Add support for parsing WSL-style symlinks

Linux CIFS client currently does not implement readlink() for WSL-style
symlinks. It is only able to detect that file is of WSL-style symlink, but
is not able to read target symlink location.

Add this missing functionality and implement support for parsing content of
WSL-style symlink.

The important note is that symlink target location stored for WSL symlink
reparse point (IO_REPARSE_TAG_LX_SYMLINK) is in UTF-8 encoding instead of
UTF-16 (which is used in whole SMB protocol and also in all other symlink
styles). So for proper locale/cp support it is needed to do conversion from
UTF-8 to local_nls.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/reparse.c
fs/smb/common/smb2pdu.h