1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

smbd: pass tevent context to create_conn_struct_as_root()

The next commit will add another caller of create_conn_struct_as_root() that is
going to pass a long-lived tevent context.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14740

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Ralph Boehme 2021-06-15 11:17:57 +02:00
parent 1ef2828e10
commit 16c39b81d6

View File

@ -242,6 +242,7 @@ static NTSTATUS parse_dfs_path(connection_struct *conn,
*********************************************************/
static NTSTATUS create_conn_struct_as_root(TALLOC_CTX *ctx,
struct tevent_context *ev,
struct messaging_context *msg,
connection_struct **pconn,
int snum,
@ -260,12 +261,7 @@ static NTSTATUS create_conn_struct_as_root(TALLOC_CTX *ctx,
return NT_STATUS_NO_MEMORY;
}
sconn->ev_ctx = samba_tevent_context_init(sconn);
if (sconn->ev_ctx == NULL) {
TALLOC_FREE(sconn);
return NT_STATUS_NO_MEMORY;
}
sconn->ev_ctx = ev;
sconn->msg_ctx = msg;
conn = conn_new(sconn);
@ -401,6 +397,7 @@ NTSTATUS create_conn_struct_tos(struct messaging_context *msg,
struct conn_struct_tos **_c)
{
struct conn_struct_tos *c = NULL;
struct tevent_context *ev = NULL;
NTSTATUS status;
*_c = NULL;
@ -410,8 +407,15 @@ NTSTATUS create_conn_struct_tos(struct messaging_context *msg,
return NT_STATUS_NO_MEMORY;
}
ev = samba_tevent_context_init(c);
if (ev == NULL) {
TALLOC_FREE(c);
return NT_STATUS_NO_MEMORY;
}
become_root();
status = create_conn_struct_as_root(c,
ev,
msg,
&c->conn,
snum,