1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

libsmbconf:registry: Return correct case for get_share

get_share (called from 'net conf showshare') does a lookup of the share
name case-insensitively. As the registry stores the share name in the
correct case and 'net conf list' prints the correct case, also lookup
the correct case for get_share.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Christof Schmitt 2019-05-15 16:05:26 -07:00 committed by Jeremy Allison
parent 91350d562b
commit cb6525e868
2 changed files with 22 additions and 5 deletions

View File

@ -370,4 +370,3 @@
^samba.tests.ntlmdisabled.python\(ktest\).python2.ntlmdisabled.NtlmDisabledTests.test_samr_change_password\(ktest\)
^samba.tests.ntlmdisabled.python\(ad_dc_no_ntlm\).python3.ntlmdisabled.NtlmDisabledTests.test_ntlm_connection\(ad_dc_no_ntlm\)
^samba.tests.ntlmdisabled.python\(ad_dc_no_ntlm\).python2.ntlmdisabled.NtlmDisabledTests.test_ntlm_connection\(ad_dc_no_ntlm\)
^samba3.blackbox.net.rpc.conf.test_conf_showshare_case\(nt4_dc\)

View File

@ -897,10 +897,28 @@ static sbcErr smbconf_reg_get_share(struct smbconf_ctx *ctx,
}
if (servicename != NULL) {
tmp_service->name = talloc_strdup(tmp_service, servicename);
if (tmp_service->name == NULL) {
err = SBC_ERR_NOMEM;
goto done;
WERROR werr;
uint32_t count = 0;
char *name = NULL;
/*
* Determine correct upper/lowercase.
*/
for (count = 0;
werr = reg_enumkey(tmp_ctx, rpd(ctx)->base_key, count,
&name, NULL),
W_ERROR_IS_OK(werr);
count++) {
if (!strequal(name, servicename)) {
continue;
}
tmp_service->name = talloc_strdup(tmp_service, name);
if (tmp_service->name == NULL) {
err = SBC_ERR_NOMEM;
goto done;
}
break;
}
}