1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

auth:ntlmssp: Use lpcfg_dns_hostname()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Andreas Schneider 2024-04-12 07:41:06 +02:00 committed by Andrew Bartlett
parent 78c2427d9b
commit f64e728444

View File

@ -201,22 +201,7 @@ NTSTATUS gensec_ntlmssp_server_start(struct gensec_security *gensec_security)
if (gensec_security->settings->server_dns_name) { if (gensec_security->settings->server_dns_name) {
dns_name = gensec_security->settings->server_dns_name; dns_name = gensec_security->settings->server_dns_name;
} else { } else {
const char *dnsdomain = lpcfg_dnsdomain(gensec_security->settings->lp_ctx); dns_name = lpcfg_dns_hostname(gensec_security->settings->lp_ctx);
char *lower_netbiosname;
lower_netbiosname = strlower_talloc(ntlmssp_state, netbios_name);
NT_STATUS_HAVE_NO_MEMORY(lower_netbiosname);
/* Find out the DNS host name */
if (dnsdomain && dnsdomain[0] != '\0') {
dns_name = talloc_asprintf(ntlmssp_state, "%s.%s",
lower_netbiosname,
dnsdomain);
talloc_free(lower_netbiosname);
NT_STATUS_HAVE_NO_MEMORY(dns_name);
} else {
dns_name = lower_netbiosname;
}
} }
if (gensec_security->settings->server_dns_domain) { if (gensec_security->settings->server_dns_domain) {