]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cifs: Fix creating native symlinks pointing to current or parent directory
authorPali Rohár <pali@kernel.org>
Sat, 5 Oct 2024 14:02:56 +0000 (16:02 +0200)
committerSteve French <stfrench@microsoft.com>
Mon, 7 Oct 2024 03:57:12 +0000 (22:57 -0500)
commit63271b7d569fbe924bccc7dadc17d3d07a4e5f7a
tree9779fad7243cb9d3386d5c238b413be6fbb66a4a
parent3eb40512530e4f64f819d8e723b6f41695dace5a
cifs: Fix creating native symlinks pointing to current or parent directory

Calling 'ln -s . symlink' or 'ln -s .. symlink' creates symlink pointing to
some object name which ends with U+F029 unicode codepoint. This is because
trailing dot in the object name is replaced by non-ASCII unicode codepoint.

So Linux SMB client currently is not able to create native symlink pointing
to current or parent directory on Windows SMB server which can be read by
either on local Windows server or by any other SMB client which does not
implement compatible-reverse character replacement.

Fix this problem in cifsConvertToUTF16() function which is doing that
character replacement. Function comment already says that it does not need
to handle special cases '.' and '..', but after introduction of native
symlinks in reparse point form, this handling is needed.

Note that this change depends on the previous change
"cifs: Improve creating native symlinks pointing to directory".

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