*********************************************************/
static NTSTATUS create_conn_struct_as_root(TALLOC_CTX *ctx,
+ struct tevent_context *ev,
struct messaging_context *msg,
connection_struct **pconn,
int snum,
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);
struct conn_struct_tos **_c)
{
struct conn_struct_tos *c = NULL;
+ struct tevent_context *ev = NULL;
NTSTATUS status;
*_c = NULL;
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,