From: Ralph Boehme Date: Thu, 27 Dec 2018 14:19:20 +0000 (+0100) Subject: Revert "smbd: add an effective connection_struct->user_ev_ctx that holds the event... X-Git-Tag: talloc-2.1.15~161 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=de10c61105391940baecb9b4c6980e5e630550c1;p=samba.git Revert "smbd: add an effective connection_struct->user_ev_ctx that holds the event context used for the current user" 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 Reviewed-by: Volker Lendecke Reviewed-by: Stefan Metzmacher --- diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 1a05283fe6c..8c35fa5ecc7 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -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 diff --git a/source3/modules/vfs_aio_pthread.c b/source3/modules/vfs_aio_pthread.c index c1d1a7d518a..cb90b12d4b2 100644 --- a/source3/modules/vfs_aio_pthread.c +++ b/source3/modules/vfs_aio_pthread.c @@ -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) { diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 1734361fca9..256f173aec5 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -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); diff --git a/source3/modules/vfs_readonly.c b/source3/modules/vfs_readonly.c index 570eb7c4d15..cde8ef973ca 100644 --- a/source3/modules/vfs_readonly.c +++ b/source3/modules/vfs_readonly.c @@ -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; diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c index 3b9aaac7834..8f472c0d245 100644 --- a/source3/smbd/conn.c +++ b/source3/smbd/conn.c @@ -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; } diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index c523abb3158..65e95128aa2 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -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); /* diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index f902f2aeae3..7aecea5f857 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -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;