Revert "smbd: add an effective connection_struct->user_ev_ctx that holds the event...
authorRalph Boehme <slow@samba.org>
Thu, 27 Dec 2018 14:19:20 +0000 (15:19 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 11 Jan 2019 22:11:16 +0000 (23:11 +0100)
This reverts commit f2df8be16be9dccd3d10ec060f1efbe5007a28c6.

See the discussion in

https://lists.samba.org/archive/samba-technical/2018-December/131731.html

for the reasoning behind this revert.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/include/vfs.h
source3/modules/vfs_aio_pthread.c
source3/modules/vfs_default.c
source3/modules/vfs_readonly.c
source3/smbd/conn.c
source3/smbd/msdfs.c
source3/smbd/uid.c

index 1a05283fe6cce364938f0d282d46ad7fef145e4f..8c35fa5ecc7aa8cb0d3a22d54f5121208d0eddc1 100644 (file)
@@ -402,7 +402,6 @@ typedef struct files_struct {
 
 struct vuid_cache_entry {
        struct auth_session_info *session_info;
-       struct tevent_context *user_ev_ctx;
        uint64_t vuid; /* SMB2 compat */
        bool read_only;
        uint32_t share_access;
@@ -450,7 +449,6 @@ typedef struct connection_struct {
         * on the vuid using this tid, this might change per SMB request.
         */
        struct auth_session_info *session_info;
-       struct tevent_context *user_ev_ctx;
 
        /*
         * If the "force group" parameter is set, this is the primary gid that
index c1d1a7d518a6bb3f44279d6f9ae531abac1c9096..cb90b12d4b29b6ca159f86238e8a86d1e1703a90 100644 (file)
@@ -276,7 +276,7 @@ static int open_async(const files_struct *fsp,
        }
 
        subreq = pthreadpool_tevent_job_send(opd,
-                                            fsp->conn->user_ev_ctx,
+                                            fsp->conn->sconn->ev_ctx,
                                             fsp->conn->sconn->pool,
                                             aio_open_worker, opd);
        if (subreq == NULL) {
index 1734361fca9513814191078fa36a1f4e3448a978..256f173aec5fd38e940867f4a66eb122136f0419 100644 (file)
@@ -1844,7 +1844,7 @@ static struct tevent_req *vfswrap_offload_write_send(
                return tevent_req_post(req, ev);
        }
 
-       state->src_ev = src_fsp->conn->user_ev_ctx;
+       state->src_ev = src_fsp->conn->sconn->ev_ctx;
        state->src_fsp = src_fsp;
 
        state->buf = talloc_array(state, uint8_t, num);
index 570eb7c4d15a24b42f9cffe33a61025819f885fb..cde8ef973ca158075b227dd5ae07984fc8b52e69 100644 (file)
@@ -84,7 +84,6 @@ static int readonly_connect(vfs_handle_struct *handle,
       for (i=0; i< VUID_CACHE_SIZE; i++) {
         struct vuid_cache_entry *ent = &conn->vuid_cache->array[i];
         ent->vuid = UID_FIELD_INVALID;
-        ent->user_ev_ctx = NULL;
         TALLOC_FREE(ent->session_info);
         ent->read_only = false;
         ent->share_access = 0;
index 3b9aaac7834bedd53ddc3545dd71f4aa243b51ea..8f472c0d2458f742edccf441a90840f2900a442a 100644 (file)
@@ -94,12 +94,6 @@ static void conn_clear_vuid_cache(connection_struct *conn, uint64_t vuid)
 
                if (ent->vuid == vuid) {
                        ent->vuid = UID_FIELD_INVALID;
-
-                       if (conn->user_ev_ctx == ent->user_ev_ctx) {
-                               conn->user_ev_ctx = NULL;
-                       }
-                       ent->user_ev_ctx = NULL;
-
                        /*
                         * We need to keep conn->session_info around
                         * if it's equal to ent->session_info as a SMBulogoff
@@ -123,7 +117,6 @@ static void conn_clear_vuid_cache(connection_struct *conn, uint64_t vuid)
                        } else {
                                TALLOC_FREE(ent->session_info);
                        }
-
                        ent->read_only = False;
                        ent->share_access = 0;
                }
index c523abb3158c81173ace34014fc8cee3473b49d1..65e95128aa20ba675784f9b86cd778c8c6513734 100644 (file)
@@ -320,8 +320,6 @@ static NTSTATUS create_conn_struct_as_root(TALLOC_CTX *ctx,
                vfs_user = get_current_username();
        }
 
-       conn->user_ev_ctx = sconn->raw_ev_ctx;
-
        set_conn_connectpath(conn, connpath);
 
        /*
index f902f2aeae38aea503f597e95e33f13345e599e7..7aecea5f857ae0a3151010decd56d150fd3a5d5b 100644 (file)
@@ -78,7 +78,6 @@ static void free_conn_session_info_if_unused(connection_struct *conn)
                }
        }
        /* Not used, safe to free. */
-       conn->user_ev_ctx = NULL;
        TALLOC_FREE(conn->session_info);
 }
 
@@ -204,7 +203,6 @@ static bool check_user_ok(connection_struct *conn,
                        }
                        free_conn_session_info_if_unused(conn);
                        conn->session_info = ent->session_info;
-                       conn->user_ev_ctx = ent->user_ev_ctx;
                        conn->read_only = ent->read_only;
                        conn->share_access = ent->share_access;
                        conn->vuid = ent->vuid;
@@ -253,8 +251,6 @@ static bool check_user_ok(connection_struct *conn,
                ent->session_info->unix_token->uid = sec_initial_uid();
        }
 
-       ent->user_ev_ctx = conn->sconn->raw_ev_ctx;
-
        /*
         * It's actually OK to call check_user_ok() with
         * vuid == UID_FIELD_INVALID as called from change_to_user_by_session().
@@ -267,7 +263,6 @@ static bool check_user_ok(connection_struct *conn,
        free_conn_session_info_if_unused(conn);
        conn->session_info = ent->session_info;
        conn->vuid = ent->vuid;
-       conn->user_ev_ctx = ent->user_ev_ctx;
        if (vuid == UID_FIELD_INVALID) {
                /*
                 * Not strictly needed, just make it really
@@ -276,7 +271,6 @@ static bool check_user_ok(connection_struct *conn,
                ent->read_only = false;
                ent->share_access = 0;
                ent->session_info = NULL;
-               ent->user_ev_ctx = NULL;
        }
 
        conn->read_only = readonly_share;