diff options
author | Nandor Kracser <bonifaido@gmail.com> | 2024-05-21 15:56:17 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2024-05-23 01:26:29 +0200 |
commit | 405ee4097c4bc3e70556520aed5ba52a511c2266 (patch) | |
tree | 2a7409aa72e3ab31ff1b2cf77b409338eb3c9217 /fs/smb | |
parent | ksmbd: avoid to send duplicate oplock break notifications (diff) | |
download | linux-405ee4097c4bc3e70556520aed5ba52a511c2266.tar.xz linux-405ee4097c4bc3e70556520aed5ba52a511c2266.zip |
ksmbd: ignore trailing slashes in share paths
Trailing slashes in share paths (like: /home/me/Share/) caused permission
issues with shares for clients on iOS and on Android TV for me,
but otherwise they work fine with plain old Samba.
Cc: stable@vger.kernel.org
Signed-off-by: Nandor Kracser <bonifaido@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb')
-rw-r--r-- | fs/smb/server/mgmt/share_config.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/smb/server/mgmt/share_config.c b/fs/smb/server/mgmt/share_config.c index a2f0a2edceb8..e0a6b758094f 100644 --- a/fs/smb/server/mgmt/share_config.c +++ b/fs/smb/server/mgmt/share_config.c @@ -165,8 +165,12 @@ static struct ksmbd_share_config *share_config_request(struct unicode_map *um, share->path = kstrndup(ksmbd_share_config_path(resp), path_len, GFP_KERNEL); - if (share->path) + if (share->path) { share->path_sz = strlen(share->path); + while (share->path_sz > 1 && + share->path[share->path_sz - 1] == '/') + share->path[--share->path_sz] = '\0'; + } share->create_mask = resp->create_mask; share->directory_mask = resp->directory_mask; share->force_create_mode = resp->force_create_mode; |