mirror of
https://github.com/samba-team/samba.git
synced 2025-01-22 22:04:08 +03:00
s4:rpc_server: Use lpcfg_dns_hostname() in dnsutils.c
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
cb9ff7b4c5
commit
6bd56a2c19
@ -114,6 +114,7 @@ struct dnsserver_serverinfo *dnsserver_init_serverinfo(TALLOC_CTX *mem_ctx,
|
||||
struct dnsserver_serverinfo *serverinfo;
|
||||
struct dcerpc_server_info *dinfo;
|
||||
struct ldb_dn *domain_dn, *forest_dn;
|
||||
const char *dns_hostname = NULL;
|
||||
|
||||
serverinfo = talloc_zero(mem_ctx, struct dnsserver_serverinfo);
|
||||
if (serverinfo == NULL) {
|
||||
@ -135,9 +136,12 @@ struct dnsserver_serverinfo *dnsserver_init_serverinfo(TALLOC_CTX *mem_ctx,
|
||||
serverinfo->fAllowUpdate = 1;
|
||||
serverinfo->fDsAvailable = 1;
|
||||
|
||||
serverinfo->pszServerName = talloc_asprintf(mem_ctx, "%s.%s",
|
||||
lpcfg_netbios_name(lp_ctx),
|
||||
lpcfg_dnsdomain(lp_ctx));
|
||||
dns_hostname = lpcfg_dns_hostname(lp_ctx);
|
||||
if (dns_hostname == NULL) {
|
||||
TALLOC_FREE(serverinfo);
|
||||
return NULL;
|
||||
}
|
||||
serverinfo->pszServerName = discard_const_p(char, dns_hostname);
|
||||
|
||||
domain_dn = ldb_get_default_basedn(samdb);
|
||||
forest_dn = ldb_get_root_basedn(samdb);
|
||||
|
Loading…
x
Reference in New Issue
Block a user