diff options
author | Pali Rohár <pali@kernel.org> | 2024-10-05 16:02:55 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2024-10-06 22:57:12 -0500 |
commit | 3eb40512530e4f64f819d8e723b6f41695dace5a (patch) | |
tree | 94ea010375fc222fb643f90e1537bff83562d358 /drivers/fpga/tests/fpga-bridge-test.c | |
parent | 8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b (diff) |
cifs: Improve creating native symlinks pointing to directory
SMB protocol for native symlinks distinguish between symlink to directory
and symlink to file. These two symlink types cannot be exchanged, which
means that symlink of file type pointing to directory cannot be resolved at
all (and vice-versa).
Windows follows this rule for local filesystems (NTFS) and also for SMB.
Linux SMB client currenly creates all native symlinks of file type. Which
means that Windows (and some other SMB clients) cannot resolve symlinks
pointing to directory created by Linux SMB client.
As Linux system does not distinguish between directory and file symlinks,
its API does not provide enough information for Linux SMB client during
creating of native symlinks.
Add some heuristic into the Linux SMB client for choosing the correct
symlink type during symlink creation. Check if the symlink target location
ends with slash, or last path component is dot or dot-dot, and check if the
target location on SMB share exists and is a directory. If at least one
condition is truth then create a new SMB symlink of directory type.
Otherwise create it as file type symlink.
This change improves interoperability with Windows systems. Windows systems
would be able to resolve more SMB symlinks created by Linux SMB client
which points to existing directory.
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'drivers/fpga/tests/fpga-bridge-test.c')
0 files changed, 0 insertions, 0 deletions