]> Git Repo - linux.git/commit
cifs: Fix parsing native symlinks directory/file type
authorPali Rohár <[email protected]>
Mon, 23 Sep 2024 20:29:30 +0000 (22:29 +0200)
committerSteve French <[email protected]>
Fri, 31 Jan 2025 18:51:44 +0000 (12:51 -0600)
commita49da4ef4b94345554923cdba1127a2d2a73d1e6
treed43f1e67bd26a4b776c55523bde9dc5e7e5deedc
parent2008d8c7121a9eee0ef8ea121581269886535150
cifs: Fix parsing native symlinks directory/file type

As SMB protocol distinguish between symlink to directory and symlink to
file, add some mechanism to disallow resolving incompatible types.

When SMB symlink is of the directory type, ensure that its target path ends
with slash. This forces Linux to not allow resolving such symlink to file.

And when SMB symlink is of the file type and its target path ends with
slash then returns an error as such symlink is unresolvable. Such symlink
always points to invalid location as file cannot end with slash.

As POSIX server does not distinguish between symlinks to file and symlink
directory, do not apply this change for symlinks from POSIX SMB server. For
POSIX SMB servers, this change does nothing.

This mimics Windows behavior of native SMB symlinks.

Signed-off-by: Pali Rohár <[email protected]>
Signed-off-by: Steve French <[email protected]>
fs/smb/client/inode.c
fs/smb/client/smb2file.c
fs/smb/client/smb2inode.c
fs/smb/client/smb2proto.h
This page took 0.047603 seconds and 4 git commands to generate.