mirror of
https://github.com/samba-team/samba.git
synced 2025-01-21 18:04:06 +03:00
s3:rpc_server: Use lpcfg_dns_hostname() in srv_witness_nt.c
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
c00571a8b2
commit
f3f8aa4964
@ -313,10 +313,7 @@ static NTSTATUS swn_service_init_globals(struct dcesrv_context *dce_ctx)
|
|||||||
{
|
{
|
||||||
struct swn_service_globals *swn = NULL;
|
struct swn_service_globals *swn = NULL;
|
||||||
char *global_path = NULL;
|
char *global_path = NULL;
|
||||||
const char *realm = NULL;
|
|
||||||
const char *nbname = NULL;
|
|
||||||
int ret;
|
int ret;
|
||||||
bool ok;
|
|
||||||
|
|
||||||
if (swn_globals != NULL) {
|
if (swn_globals != NULL) {
|
||||||
SMB_ASSERT(swn_globals->dce_ctx == dce_ctx);
|
SMB_ASSERT(swn_globals->dce_ctx == dce_ctx);
|
||||||
@ -362,30 +359,11 @@ static NTSTATUS swn_service_init_globals(struct dcesrv_context *dce_ctx)
|
|||||||
}
|
}
|
||||||
TALLOC_FREE(global_path);
|
TALLOC_FREE(global_path);
|
||||||
|
|
||||||
nbname = lpcfg_netbios_name(dce_ctx->lp_ctx);
|
swn->server_global_name = lpcfg_dns_hostname(dce_ctx->lp_ctx);
|
||||||
realm = lpcfg_realm(dce_ctx->lp_ctx);
|
|
||||||
if (realm != NULL && realm[0] != '\0') {
|
|
||||||
char *name = NULL;
|
|
||||||
|
|
||||||
name = talloc_asprintf(swn, "%s.%s", nbname, realm);
|
|
||||||
if (name == NULL) {
|
|
||||||
TALLOC_FREE(swn);
|
|
||||||
return NT_STATUS_NO_MEMORY;
|
|
||||||
}
|
|
||||||
ok = strlower_m(name);
|
|
||||||
if (!ok) {
|
|
||||||
TALLOC_FREE(swn);
|
|
||||||
return NT_STATUS_INTERNAL_ERROR;
|
|
||||||
}
|
|
||||||
swn->server_global_name = name;
|
|
||||||
} else {
|
|
||||||
swn->server_global_name = talloc_strdup(swn, nbname);
|
|
||||||
if (swn->server_global_name == NULL) {
|
if (swn->server_global_name == NULL) {
|
||||||
TALLOC_FREE(swn);
|
TALLOC_FREE(swn);
|
||||||
return NT_STATUS_NO_MEMORY;
|
return NT_STATUS_NO_MEMORY;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
swn->local_vnn = get_my_vnn();
|
swn->local_vnn = get_my_vnn();
|
||||||
|
|
||||||
ret = register_with_ctdbd(messaging_ctdb_connection(),
|
ret = register_with_ctdbd(messaging_ctdb_connection(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user