Skip to content

Commit

Permalink
ignore trailing slashes in share paths
Browse files Browse the repository at this point in the history
Signed-off-by: Nandor Kracser <[email protected]>
  • Loading branch information
bonifaido committed May 21, 2024
1 parent f878f24 commit fb35330
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mgmt/share_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,14 @@ 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 - 1] = '\0';
share->path_sz--;
}
}
share->create_mask = resp->create_mask;
share->directory_mask = resp->directory_mask;
share->force_create_mode = resp->force_create_mode;
Expand Down

0 comments on commit fb35330

Please sign in to comment.