s4/dcerpc_netlogon: Logging for dcesrv_netr_LogonGetDomainInfo
authorGary Lockyer <gary@catalyst.net.nz>
Tue, 20 Jun 2017 20:09:53 +0000 (08:09 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 22 Jun 2017 06:56:22 +0000 (08:56 +0200)
Log details of the remote machine when bad credentials received.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/rpc_server/netlogon/dcerpc_netlogon.c

index 0932eb0d36c64872dd6e5e4b7e2d91cee2ed6a08..3f70a3eccc4cbf287cbb723044ce2753416b4a98 100644 (file)
@@ -1975,7 +1975,19 @@ static NTSTATUS dcesrv_netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_cal
                                                     r->out.return_authenticator,
                                                     &creds);
        if (!NT_STATUS_IS_OK(status)) {
-               DEBUG(0,(__location__ " Bad credentials - error\n"));
+               char* local  = NULL;
+               char* remote = NULL;
+               TALLOC_CTX *frame = talloc_stackframe();
+               remote = tsocket_address_string(dce_call->conn->remote_address,
+                                               frame);
+               local  = tsocket_address_string(dce_call->conn->local_address,
+                                               frame);
+               DBG_ERR(("Bad credentials - "
+                        "computer[%s] remote[%s] local[%s]\n"),
+                        r->in.computer_name,
+                        remote,
+                        local);
+               talloc_free(frame);
        }
        NT_STATUS_NOT_OK_RETURN(status);