smbd: rename smbXsrv_client->ev_ctx into smbXsrv_client->raw_ev_ctx
authorStefan Metzmacher <metze@samba.org>
Thu, 22 Mar 2018 09:54:41 +0000 (10:54 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 18 Jun 2018 06:59:18 +0000 (08:59 +0200)
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 <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/librpc/idl/smbXsrv.idl
source3/smbd/process.c
source3/smbd/smbXsrv_client.c
source3/smbd/smbXsrv_session.c

index 26758113af47db28656ea9a768a8806ceacda8d3..935c4084252311534f5b9b23f0d18c7d09884fa2 100644 (file)
@@ -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;
index 54f7753e736cfaaae22be12a3989793243baba90..581fd605e72e6c910bfa9154aa5fb6f597edbe29 100644 (file)
@@ -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,
index 30cf25276bed163d798249aaa580734b39a6d2c4..3e0a1d51e5aecca2ad744d400ab5e87f4df2b134 100644 (file)
@@ -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";
index 121ff264a9cc7f7a4242eb57b562ed90bec4e474..2c5b2ffe2fcde98b49bc49cd63d1836986f90365 100644 (file)
@@ -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;