locking_end();
printing_end();
+ /*
+ * we need to force the order of freeing the following,
+ * because smbd_msg_ctx is not a talloc child of smbd_server_conn.
+ */
+ sconn = NULL;
+ TALLOC_FREE(smbd_server_conn);
+ TALLOC_FREE(smbd_msg_ctx);
+ TALLOC_FREE(smbd_event_ctx);
+
if (how != SERVER_EXIT_NORMAL) {
int oldlevel = DEBUGLEVEL;
if (session->tcons.idtree == NULL) {
return NT_STATUS_NO_MEMORY;
}
- session->tcons.limit = 0x00FFFFFF;
+ session->tcons.limit = 0x0000FFFE;
session->tcons.list = NULL;
DLIST_ADD_END(req->conn->smb2.sessions.list, session,
idr_remove(tcon->session->tcons.idtree, tcon->tid);
DLIST_REMOVE(tcon->session->tcons.list, tcon);
+ conn_free(tcon->session->conn, tcon->compat_conn);
+
+ tcon->compat_conn = NULL;
tcon->tid = 0;
tcon->session = NULL;
int snum = -1;
struct smbd_smb2_tcon *tcon;
int id;
+ NTSTATUS status;
if (strncmp(share, "\\\\", 2) == 0) {
const char *p = strchr(share+2, '\\');
tcon,
req->session->tcons.limit);
if (id == -1) {
+ TALLOC_FREE(tcon);
return NT_STATUS_INSUFFICIENT_RESOURCES;
}
tcon->tid = id;
tcon->session = req->session;
talloc_set_destructor(tcon, smbd_smb2_tcon_destructor);
+ tcon->compat_conn = make_connection_snum(req->conn,
+ snum, req->session->compat_vuser,
+ data_blob_null, "???",
+ &status);
+ if (tcon->compat_conn == NULL) {
+ TALLOC_FREE(tcon);
+ return status;
+ }
+ tcon->compat_conn->cnum = tcon->tid;
+
*out_tree_id = tcon->tid;
return NT_STATUS_OK;
}
}
tcon = talloc_get_type_abort(p, struct smbd_smb2_tcon);
+ if (!change_to_user(tcon->compat_conn,req->session->vuid)) {
+ return NT_STATUS_ACCESS_DENIED;
+ }
+
req->tcon = tcon;
return NT_STATUS_OK;
}