From 8e1e6b0112c06b8587c0823a62d2103c047f8310 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Mon, 24 May 2010 12:42:32 +0200 Subject: s4:LogonGetDomainInfo - allow to set DNS hostname for the first time Otherwise it obviously can never be set. --- source4/rpc_server/netlogon/dcerpc_netlogon.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index 011341641a..c57f4145c6 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -1258,17 +1258,6 @@ static NTSTATUS dcesrv_netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_cal return NT_STATUS_INVALID_PARAMETER; } - /* - * Updates the DNS hostname when the client wishes that the - * server should handle this for him - * ("NETR_WS_FLAG_HANDLES_SPN_UPDATE" not set). - * See MS-NRPC section 3.5.4.3.9 - */ - if ((r->in.query->workstation_info->workstation_flags - & NETR_WS_FLAG_HANDLES_SPN_UPDATE) != 0) { - update_dns_hostname = false; - } - /* * Checks that the computer name parameter without possible "$" * matches as prefix with the DNS hostname in the workstation @@ -1302,6 +1291,20 @@ static NTSTATUS dcesrv_netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_cal old_dns_hostname = samdb_result_string(res1[0], "dNSHostName", NULL); + /* + * Updates the DNS hostname when the client wishes that the + * server should handle this for him + * ("NETR_WS_FLAG_HANDLES_SPN_UPDATE" not set). And this is + * obviously only checked when we do already have a + * "dNSHostName". + * See MS-NRPC section 3.5.4.3.9 + */ + if ((old_dns_hostname != NULL) && + (r->in.query->workstation_info->workstation_flags + & NETR_WS_FLAG_HANDLES_SPN_UPDATE) != 0) { + update_dns_hostname = false; + } + /* Gets host informations and put them in our directory */ new_msg = ldb_msg_new(mem_ctx); NT_STATUS_HAVE_NO_MEMORY(new_msg); -- cgit