Initializing case based parameters during share switch in create_conn_struct_tos_cwd()

Jeremy Allison jra at samba.org
Tue Jan 12 19:16:36 UTC 2021


On Tue, Jan 12, 2021 at 11:13:28AM -0800, Jeremy Allison via samba-technical wrote:
>On Fri, Jan 08, 2021 at 03:27:20PM +0530, Shilpa K via samba-technical wrote:
>>Hello,
>>
>>We are creating DFS referrals when a folder is created under the share
>>root. In one instance, an user was trying to create a folder with the name
>>"FOLDER~1" (with exactly 8 chars in the folder name) from Windows. So, we
>>created the DFS referral with the name ending "FOLDER~1" and returned the
>>error STATUS_PATH_NOT_COVERED to the client. Then,the client had sent
>>DFS_GET_REFERRALS request. While  processing this request, when
>>unix_convert() is called as part of returning the referral, it was
>>normalizing the name to lowercase because the name is a mangled name and
>>the below parameters were null:
>>
>>conn->case sensitive = 0
>>conn->share_case_preserve = 0
>>and default case is lower
>>
>>The case_sensitive and short_case_preserve were null because we were not
>>initializing these values in conn struct to the share configuration that we
>>were switching to. We are using below settings for the share:
>>
>>case sensitive = no
>>preserve case = yes
>>short preserve case = yes
>>default case = lower
>>
>>I used the code changes that are in the below patch and now we return the
>>folder name in the referral as is. Could you please review this patch and
>>let me know if it is fine?
>>
>>Thanks,
>>Shilpa
>
>Thanks Shilpa, this does look correct. It sets up the
>dfs share in the same way as the case options are created
>in source3/smbd/service.c:make_connection_snum().
>
>I think the best fix here would be to factor this code
>out into a function called by both make_connection_snum()
>and create_conn_struct_as_root() so we know they are
>setting things up identically.
>
>I'll set up a gitlab-MR for this. Thanks for your
>help !

Logged as bug: https://bugzilla.samba.org/show_bug.cgi?id=14612
so we can track it. Thanks !



More information about the samba-technical mailing list