mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-11 20:05:22 +02:00
ksmbd: ignore trailing slashes in share paths
commit 405ee4097c
upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6772584945
commit
5698ba6932
|
@ -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,
|
share->path = kstrndup(ksmbd_share_config_path(resp), path_len,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (share->path)
|
if (share->path) {
|
||||||
share->path_sz = strlen(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->create_mask = resp->create_mask;
|
||||||
share->directory_mask = resp->directory_mask;
|
share->directory_mask = resp->directory_mask;
|
||||||
share->force_create_mode = resp->force_create_mode;
|
share->force_create_mode = resp->force_create_mode;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user