From: Stefan Metzmacher Date: Thu, 22 Mar 2018 09:54:41 +0000 (+0100) Subject: smbd: rename smbXsrv_client->ev_ctx into smbXsrv_client->raw_ev_ctx X-Git-Tag: tevent-0.9.37~290 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=19119a55490bcfacbc7d4be340f650e9eaf212f2;p=thirdparty%2Fsamba.git smbd: rename smbXsrv_client->ev_ctx into smbXsrv_client->raw_ev_ctx That makes it clearer that no tevent_context wrapper is used here and the related code should really run without any (active) impersonation as before. Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- diff --git a/source3/librpc/idl/smbXsrv.idl b/source3/librpc/idl/smbXsrv.idl index 26758113af4..935c4084252 100644 --- a/source3/librpc/idl/smbXsrv.idl +++ b/source3/librpc/idl/smbXsrv.idl @@ -107,7 +107,7 @@ interface smbXsrv typedef [public] struct { [ignore] smbXsrv_client_table *table; - [ignore] struct tevent_context *ev_ctx; + [ignore] struct tevent_context *raw_ev_ctx; [ignore] struct messaging_context *msg_ctx; [ref] smbXsrv_client_global0 *global; diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 54f7753e736..581fd605e72 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -3697,7 +3697,7 @@ NTSTATUS smbd_add_connection(struct smbXsrv_client *client, int sock_fd, } talloc_steal(frame, xconn); - xconn->ev_ctx = client->ev_ctx; + xconn->ev_ctx = client->raw_ev_ctx; xconn->msg_ctx = client->msg_ctx; xconn->transport.sock = sock_fd; smbd_echo_init(xconn); @@ -3848,7 +3848,7 @@ NTSTATUS smbd_add_connection(struct smbXsrv_client *client, int sock_fd, xconn->smb1.sessions.done_sesssetup = false; xconn->smb1.sessions.max_send = SMB_BUFFER_SIZE_MAX; - xconn->transport.fde = tevent_add_fd(client->ev_ctx, + xconn->transport.fde = tevent_add_fd(client->raw_ev_ctx, xconn, sock_fd, TEVENT_FD_READ, diff --git a/source3/smbd/smbXsrv_client.c b/source3/smbd/smbXsrv_client.c index 30cf25276be..3e0a1d51e5a 100644 --- a/source3/smbd/smbXsrv_client.c +++ b/source3/smbd/smbXsrv_client.c @@ -507,7 +507,7 @@ NTSTATUS smbXsrv_client_create(TALLOC_CTX *mem_ctx, TALLOC_FREE(table); return NT_STATUS_NO_MEMORY; } - client->ev_ctx = ev_ctx; + client->raw_ev_ctx = ev_ctx; client->msg_ctx = msg_ctx; client->server_multi_channel_enabled = lp_server_multi_channel_support(); @@ -543,9 +543,11 @@ NTSTATUS smbXsrv_client_create(TALLOC_CTX *mem_ctx, NDR_PRINT_DEBUG(smbXsrv_clientB, &client_blob); } - subreq = messaging_filtered_read_send(client, client->ev_ctx, client->msg_ctx, - smbXsrv_client_connection_pass_filter, - client); + subreq = messaging_filtered_read_send(client, + client->raw_ev_ctx, + client->msg_ctx, + smbXsrv_client_connection_pass_filter, + client); if (subreq == NULL) { TALLOC_FREE(client); return NT_STATUS_NO_MEMORY; @@ -678,9 +680,11 @@ static void smbXsrv_client_connection_pass_loop(struct tevent_req *subreq) next: TALLOC_FREE(rec); - subreq = messaging_filtered_read_send(client, client->ev_ctx, client->msg_ctx, - smbXsrv_client_connection_pass_filter, - client); + subreq = messaging_filtered_read_send(client, + client->raw_ev_ctx, + client->msg_ctx, + smbXsrv_client_connection_pass_filter, + client); if (subreq == NULL) { const char *r; r = "messaging_read_send(MSG_SMBXSRV_CONNECTION_PASS failed"; diff --git a/source3/smbd/smbXsrv_session.c b/source3/smbd/smbXsrv_session.c index 121ff264a9c..2c5b2ffe2fc 100644 --- a/source3/smbd/smbXsrv_session.c +++ b/source3/smbd/smbXsrv_session.c @@ -258,7 +258,9 @@ static NTSTATUS smbXsrv_session_table_init(struct smbXsrv_connection *conn, table->global.db_ctx = smbXsrv_session_global_db_ctx; - subreq = messaging_read_send(table, client->ev_ctx, client->msg_ctx, + subreq = messaging_read_send(table, + client->raw_ev_ctx, + client->msg_ctx, MSG_SMBXSRV_SESSION_CLOSE); if (subreq == NULL) { TALLOC_FREE(table); @@ -376,7 +378,7 @@ static void smbXsrv_session_close_loop(struct tevent_req *subreq) goto next; } - subreq = smb2srv_session_shutdown_send(session, client->ev_ctx, + subreq = smb2srv_session_shutdown_send(session, client->raw_ev_ctx, session, NULL); if (subreq == NULL) { status = NT_STATUS_NO_MEMORY; @@ -396,7 +398,9 @@ static void smbXsrv_session_close_loop(struct tevent_req *subreq) next: TALLOC_FREE(rec); - subreq = messaging_read_send(table, client->ev_ctx, client->msg_ctx, + subreq = messaging_read_send(table, + client->raw_ev_ctx, + client->msg_ctx, MSG_SMBXSRV_SESSION_CLOSE); if (subreq == NULL) { const char *r;