struct tevent_req *subreq;
struct auth_session_info *session_info =
dcesrv_call_session_info(dce_call);
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(dce_call->conn);
st = talloc(mem_ctx, struct dcesrv_forward_state);
if (st == NULL) {
return;
}
- binding_handle = irpc_binding_handle_by_name(st, dce_call->msg_ctx,
- dest_task, ndr_table);
+ binding_handle = irpc_binding_handle_by_name(st,
+ imsg_ctx,
+ dest_task,
+ ndr_table);
if (binding_handle == NULL) {
DEBUG(0,("%s: Failed to forward request to %s task\n",
opname, dest_task));
const struct dcesrv_endpoint *ep,
struct auth_session_info *session_info,
struct tevent_context *event_ctx,
- struct imessaging_context *msg_ctx,
struct server_id server_id,
uint32_t state_flags,
struct dcesrv_connection **_p)
p->endpoint = ep;
p->packet_log_dir = lpcfg_lock_directory(dce_ctx->lp_ctx);
p->event_ctx = event_ctx;
- p->msg_ctx = msg_ctx;
p->server_id = server_id;
p->state_flags = state_flags;
p->allow_bind = true;
}
call->conn = dce_conn;
call->event_ctx = dce_conn->event_ctx;
- call->msg_ctx = dce_conn->msg_ctx;
call->state_flags = call->conn->state_flags;
call->time = timeval_current();
call->list = DCESRV_LIST_NONE;
dcesrv_sock->endpoint,
srv_conn->session_info,
srv_conn->event.ctx,
- srv_conn->msg_ctx,
srv_conn->server_id,
DCESRV_CALL_STATE_FLAG_MAY_ASYNC,
&dcesrv_conn);
*auth_level = auth->auth_level;
}
}
+
+_PUBLIC_ struct imessaging_context *dcesrv_imessaging_context(
+ struct dcesrv_connection *conn)
+{
+ struct stream_connection *srv_conn =
+ talloc_get_type_abort(conn->transport.private_data,
+ struct stream_connection);
+ return srv_conn->msg_ctx;
+}
/* the backend can use this event context for async replies */
struct tevent_context *event_ctx;
- /* the message_context that will be used for async replies */
- struct imessaging_context *msg_ctx;
-
/* this is the pointer to the allocated function struct */
void *r;
/* the event_context that will be used for this connection */
struct tevent_context *event_ctx;
- /* the message_context that will be used for this connection */
- struct imessaging_context *msg_ctx;
-
/* the server_id that will be used for this connection */
struct server_id server_id;
_dcesrv_iface_state_find_conn((call), (magic)), \
_type)
+_PUBLIC_ struct imessaging_context *dcesrv_imessaging_context(
+ struct dcesrv_connection *conn);
+
#endif /* SAMBA_DCERPC_SERVER_H */
struct cli_credentials *server_credentials = NULL;
struct dcesrv_connection *dce_conn = call->conn;
struct dcesrv_auth *auth = call->auth_state;
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(call->conn);
NTSTATUS status;
if (auth->auth_started) {
status = samba_server_gensec_start(auth,
call->event_ctx,
- call->msg_ctx,
+ imsg_ctx,
call->conn->dce_ctx->lp_ctx,
server_credentials,
NULL,
struct dcesrv_auth *auth = call->auth_state;
enum dcerpc_transport_t transport =
dcerpc_binding_get_transport(call->conn->endpoint->ep_description);
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(call->conn);
const char *auth_type = derpc_transport_string_by_transport(transport);
const char *transport_protection = AUTHZ_TRANSPORT_PROTECTION_NONE;
* covered ncacn_np pass-through auth, and anonymous
* DCE/RPC (eg epmapper, netlogon etc)
*/
- log_successful_authz_event(call->conn->msg_ctx,
+ log_successful_authz_event(imsg_ctx,
call->conn->dce_ctx->lp_ctx,
call->conn->remote_address,
call->conn->local_address,
{
struct auth_session_info *session_info =
dcesrv_call_session_info(dce_call);
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(dce_call->conn);
struct drsuapi_DsReplicaObjectIdentifier *ncRoot;
int ret;
uint32_t i, k;
to send notifies using the GC SPN */
ureq.options |= (req10->replica_flags & DRSUAPI_DRS_REF_GCSPN);
- werr = drsuapi_UpdateRefs(dce_call->msg_ctx,
- dce_call->event_ctx, b_state,
- mem_ctx, &ureq);
+ werr = drsuapi_UpdateRefs(imsg_ctx,
+ dce_call->event_ctx,
+ b_state,
+ mem_ctx,
+ &ureq);
if (!W_ERROR_IS_OK(werr)) {
DEBUG(0,(__location__ ": Failed UpdateRefs on %s for %s in DsGetNCChanges - %s\n",
drs_ObjectIdentifier_to_string(mem_ctx, ncRoot), ureq.dest_dsa_dns_name,
{
struct auth_session_info *session_info =
dcesrv_call_session_info(dce_call);
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(dce_call->conn);
struct dcesrv_handle *h;
struct drsuapi_bind_state *b_state;
struct drsuapi_DsReplicaUpdateRefsRequest1 *req;
}
}
- werr = drsuapi_UpdateRefs(dce_call->msg_ctx, dce_call->event_ctx,
- b_state, mem_ctx, req);
+ werr = drsuapi_UpdateRefs(imsg_ctx,
+ dce_call->event_ctx,
+ b_state,
+ mem_ctx,
+ req);
#if 0
NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsReplicaUpdateRefs, NDR_BOTH, r);
char *dns_encoded = NULL;
char *netbios_encoded = NULL;
char *sid_encoded = NULL;
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(dce_call->conn);
DCESRV_PULL_HANDLE(policy_handle, r->in.policy_handle, LSA_HANDLE_POLICY);
ZERO_STRUCTP(r->out.trustdom_handle);
/*
* Notify winbindd that we have a new trust
*/
- status = irpc_servers_byname(dce_call->msg_ctx,
+ status = irpc_servers_byname(imsg_ctx,
mem_ctx,
"winbind_server",
- &num_server_ids, &server_ids);
+ &num_server_ids,
+ &server_ids);
if (NT_STATUS_IS_OK(status) && num_server_ids >= 1) {
- imessaging_send(dce_call->msg_ctx, server_ids[0],
- MSG_WINBIND_RELOAD_TRUSTED_DOMAINS, NULL);
+ imessaging_send(imsg_ctx,
+ server_ids[0],
+ MSG_WINBIND_RELOAD_TRUSTED_DOMAINS,
+ NULL);
}
TALLOC_FREE(server_ids);
enum ndr_err_code ndr_err;
int ret;
bool in_transaction = false;
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(dce_call->conn);
DCESRV_PULL_HANDLE(h, r->in.handle, LSA_HANDLE_POLICY);
/*
* Notify winbindd that we have a acquired forest trust info
*/
- status = irpc_servers_byname(dce_call->msg_ctx,
+ status = irpc_servers_byname(imsg_ctx,
mem_ctx,
"winbind_server",
- &num_server_ids, &server_ids);
+ &num_server_ids,
+ &server_ids);
if (!NT_STATUS_IS_OK(status)) {
DBG_ERR("irpc_servers_byname failed\n");
goto done;
}
- imessaging_send(dce_call->msg_ctx, server_ids[0],
- MSG_WINBIND_RELOAD_TRUSTED_DOMAINS, NULL);
+ imessaging_send(imsg_ctx,
+ server_ids[0],
+ MSG_WINBIND_RELOAD_TRUSTED_DOMAINS,
+ NULL);
status = NT_STATUS_OK;
NTSTATUS status;
const char *check_domain_name = NULL;
bool expect_domain = false;
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(state->dce_call->conn);
if (item->name == NULL) {
/*
}
state->wb.irpc_handle = irpc_binding_handle_by_name(state,
- state->dce_call->msg_ctx,
- "winbind_server",
- &ndr_table_lsarpc);
+ imsg_ctx,
+ "winbind_server",
+ &ndr_table_lsarpc);
if (state->wb.irpc_handle == NULL) {
DEBUG(0,("Failed to get binding_handle for winbind_server task\n"));
state->dce_call->fault_code = DCERPC_FAULT_CANT_PERFORM;
struct dom_sid domain_sid = {0,};
NTSTATUS status;
bool match;
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(state->dce_call->conn);
/*
* Verify the sid is not INVALID.
}
state->wb.irpc_handle = irpc_binding_handle_by_name(state,
- state->dce_call->msg_ctx,
- "winbind_server",
- &ndr_table_lsarpc);
+ imsg_ctx,
+ "winbind_server",
+ &ndr_table_lsarpc);
if (state->wb.irpc_handle == NULL) {
DEBUG(0,("Failed to get binding_handle for winbind_server task\n"));
state->dce_call->fault_code = DCERPC_FAULT_CANT_PERFORM;
struct dom_sid *sid = NULL;
const char *trust_account_for_search = NULL;
const char *trust_account_in_db = NULL;
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(dce_call->conn);
struct auth_usersupplied_info ui = {
.local_host = dce_call->conn->local_address,
.remote_host = dce_call->conn->remote_address,
ui.netlogon_trust_account.account_name = trust_account_in_db;
ui.mapped.account_name = trust_account_for_search;
log_authentication_event(
- dce_call->conn->msg_ctx,
+ imsg_ctx,
dce_call->conn->dce_ctx->lp_ctx,
NULL,
&ui,
static NTSTATUS dcesrv_netr_LogonSamLogon_base_call(struct dcesrv_netr_LogonSamLogon_base_state *state)
{
struct dcesrv_call_state *dce_call = state->dce_call;
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(dce_call->conn);
TALLOC_CTX *mem_ctx = state->mem_ctx;
struct netr_LogonSamLogonEx *r = &state->r;
struct netlogon_creds_CredentialState *creds = state->creds;
case NetlogonNetworkTransitiveInformation:
nt_status = auth_context_create_for_netlogon(mem_ctx,
- dce_call->event_ctx, dce_call->msg_ctx,
+ dce_call->event_ctx,
+ imsg_ctx,
dce_call->conn->dce_ctx->lp_ctx,
&auth_context);
NT_STATUS_NOT_OK_RETURN(nt_status);
= r->in.logon->generic->identity_info.logon_id;
irpc_handle = irpc_binding_handle_by_name(mem_ctx,
- dce_call->msg_ctx,
+ imsg_ctx,
"kdc_server",
&ndr_table_irpc);
if (irpc_handle == NULL) {
struct loadparm_context *lp_ctx = state->dce_call->conn->dce_ctx->lp_ctx;
struct auth_session_info *session_info =
dcesrv_call_session_info(state->dce_call);
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(state->dce_call->conn);
enum security_user_level security_level;
struct dcerpc_binding_handle *irpc_handle;
struct tevent_req *subreq;
}
irpc_handle = irpc_binding_handle_by_name(state,
- state->dce_call->msg_ctx,
+ imsg_ctx,
"winbind_server",
&ndr_table_winbind);
if (irpc_handle == NULL) {
struct dcesrv_call_state *dce_call = state->dce_call;
struct auth_session_info *session_info =
dcesrv_call_session_info(dce_call);
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(dce_call->conn);
TALLOC_CTX *mem_ctx = state->mem_ctx;
struct netr_DsRGetDCNameEx2 *r = &state->r;
struct ldb_context *sam_ctx;
false);
irpc_handle = irpc_binding_handle_by_name(state,
- dce_call->msg_ctx,
+ imsg_ctx,
"winbind_server",
&ndr_table_winbind);
if (irpc_handle == NULL) {
struct loadparm_context *lp_ctx = dce_call->conn->dce_ctx->lp_ctx;
struct auth_session_info *session_info =
dcesrv_call_session_info(dce_call);
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(dce_call->conn);
enum security_user_level security_level;
struct ldb_context *sam_ctx = NULL;
struct dcesrv_netr_DsRGetForestTrustInformation_state *state = NULL;
state->r = r;
irpc_handle = irpc_binding_handle_by_name(state,
- state->dce_call->msg_ctx,
+ imsg_ctx,
"winbind_server",
&ndr_table_winbind);
if (irpc_handle == NULL) {
struct dcerpc_binding_handle *binding_handle;
struct netr_dnsupdate_RODC_state *st;
struct tevent_req *subreq;
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(dce_call->conn);
nt_status = dcesrv_netr_creds_server_step_check(dce_call,
mem_ctx,
st->r2->in.dns_names = r->in.dns_names;
st->r2->out.dns_names = r->out.dns_names;
- binding_handle = irpc_binding_handle_by_name(st, dce_call->msg_ctx,
- "dnsupdate", &ndr_table_irpc);
+ binding_handle = irpc_binding_handle_by_name(st,
+ imsg_ctx,
+ "dnsupdate",
+ &ndr_table_irpc);
if (binding_handle == NULL) {
DEBUG(0,("Failed to get binding_handle for dnsupdate task\n"));
dce_call->fault_code = DCERPC_FAULT_CANT_PERFORM;
{
struct auth_session_info *session_info =
dcesrv_call_session_info(dce_call);
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(dce_call->conn);
NTSTATUS status = NT_STATUS_WRONG_PASSWORD;
DATA_BLOB new_password, new_unicode_password;
char *new_pass;
failed:
- log_password_change_event(dce_call->conn->msg_ctx,
+ log_password_change_event(imsg_ctx,
dce_call->conn->dce_ctx->lp_ctx,
dce_call->conn->remote_address,
dce_call->conn->local_address,
{
struct auth_session_info *session_info =
dcesrv_call_session_info(dce_call);
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(dce_call->conn);
NTSTATUS status = NT_STATUS_WRONG_PASSWORD;
DATA_BLOB new_password;
struct ldb_context *sam_ctx = NULL;
failed:
- log_password_change_event(dce_call->conn->msg_ctx,
+ log_password_change_event(imsg_ctx,
dce_call->conn->dce_ctx->lp_ctx,
dce_call->conn->remote_address,
dce_call->conn->local_address,
{
struct auth_session_info *session_info =
dcesrv_call_session_info(dce_call);
+ struct imessaging_context *imsg_ctx =
+ dcesrv_imessaging_context(dce_call->conn);
NTSTATUS status;
struct srvsvc_ntvfs_ctx *c;
struct ntvfs_request *ntvfs_req;
PROTOCOL_NT1,
0,/* ntvfs_client_caps */
dce_call->event_ctx,
- dce_call->conn->msg_ctx,
+ imsg_ctx,
dce_call->conn->dce_ctx->lp_ctx,
dce_call->conn->server_id,
&c->ntvfs);