mirror of
https://github.com/samba-team/samba.git
synced 2025-02-23 09:57:40 +03:00
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 <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
88016bac86
commit
de10c61105
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
/*
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user