diff options
author | Ralph Boehme <slow@samba.org> | 2021-06-15 11:17:57 +0200 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2021-06-16 05:08:29 +0000 |
commit | 16c39b81d6f2c7d75cfe72bbbe2f6a5bde42c7b0 (patch) | |
tree | 019f85f312bc5843a9169763cb6868cbfd168bc1 /source3/smbd/msdfs.c | |
parent | 1ef2828e1025e4c89292df1dfa6161c4453b3afe (diff) | |
download | samba-16c39b81d6f2c7d75cfe72bbbe2f6a5bde42c7b0.tar.gz |
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>
Diffstat (limited to 'source3/smbd/msdfs.c')
-rw-r--r-- | source3/smbd/msdfs.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index 6f7707dbc9b..864cd102403 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -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, |