DsCrackNameOneName directly fails for DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT
if the name passed in does not contain a \. The only caller of
map_user_info_cracknames (auth_check_password_send) passes in
lpcfg_workgroup(), which does not contain a \. Add in the \ also for
the default_domain case.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
return NT_STATUS_NO_MEMORY;
}
} else {
- char *domain_name;
+ const char *domain_name = default_domain;
if (user_info->client.domain_name && *user_info->client.domain_name) {
- domain_name = talloc_asprintf(tmp_ctx, "%s\\", user_info->client.domain_name);
- } else {
- domain_name = talloc_strdup(tmp_ctx, default_domain);
+ domain_name = user_info->client.domain_name;
}
+ domain_name = talloc_asprintf(tmp_ctx, "%s\\", domain_name);
if (domain_name == NULL) {
talloc_free(tmp_ctx);
return NT_STATUS_NO_MEMORY;