From: Andrew Bartlett Date: Mon, 13 Mar 2017 22:01:54 +0000 (+1300) Subject: s3-rpc_server: Provide hooks required for JSON message logging for the no-auth case X-Git-Tag: tdb-1.3.13~234 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=7cbe1c844ea359b6d5386b3986aa16152e975f3d;p=samba.git s3-rpc_server: Provide hooks required for JSON message logging for the no-auth case This is triggered in the ncacn_np pass-though case in particular Signed-off-by: Andrew Bartlett --- diff --git a/selftest/knownfail b/selftest/knownfail index 707f0e5bba5..e85a8a66907 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -329,7 +329,6 @@ ^samba.tests.auth_log.samba.tests.auth_log.AuthLogTests.test_rpc_ncacn_np_krb_dns_smb2 ^samba.tests.auth_log.samba.tests.auth_log.AuthLogTests.test_rpc_ncacn_np_krb_srv ^samba.tests.auth_log.samba.tests.auth_log.AuthLogTests.test_rpc_ncacn_np_krb_srv_sign -^samba.tests.auth_log.samba.tests.auth_log.AuthLogTests.test_rpc_ncacn_np_ntlm_srv\(ad_dc:local\) ^samba.tests.auth_log.samba.tests.auth_log.AuthLogTests.test_smb\( ^samba.tests.auth_log.samba.tests.auth_log.AuthLogTests.test_smb_bad_password ^samba.tests.auth_log.samba.tests.auth_log.AuthLogTests.test_smb_bad_user diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c index 95e2cebee8b..251f8991a60 100644 --- a/source3/rpc_server/srv_pipe.c +++ b/source3/rpc_server/srv_pipe.c @@ -822,6 +822,8 @@ static bool api_pipe_bind_req(struct pipes_struct *p, goto err_exit; } } else { + TALLOC_CTX *frame = talloc_stackframe(); + struct auth4_context *auth4_context; const char *transport_protection = AUTHZ_TRANSPORT_PROTECTION_NONE; if (p->transport == NCACN_NP) { transport_protection = AUTHZ_TRANSPORT_PROTECTION_SMB; @@ -831,18 +833,27 @@ static bool api_pipe_bind_req(struct pipes_struct *p, p->auth.auth_level = DCERPC_AUTH_LEVEL_NONE; p->auth.auth_context_id = 0; + status = make_auth4_context(frame, &auth4_context); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("Unable to make auth context for authz log.\n")); + TALLOC_FREE(frame); + goto err_exit; + } + /* * Log the authorization to this RPC interface. This * covered ncacn_np pass-through auth, and anonymous * DCE/RPC (eg epmapper, netlogon etc) */ - log_successful_authz_event(NULL, NULL, + log_successful_authz_event(auth4_context->msg_ctx, + auth4_context->lp_ctx, p->remote_address, p->local_address, table->name, derpc_transport_string_by_transport(p->transport), transport_protection, p->session_info); + TALLOC_FREE(frame); } ZERO_STRUCT(u.bind_ack);