From faa8edccef556fb281d24b76b9739c994128f6ef Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 28 Mar 2012 16:14:09 +0200 Subject: s3:smbd: make use of smbXsrv_tcon for smb1 Pair-Programmed-With: Michael Adam metze --- source3/smbd/ipc.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'source3/smbd/ipc.c') diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c index 77b9249e6f..91d5047c4c 100644 --- a/source3/smbd/ipc.c +++ b/source3/smbd/ipc.c @@ -631,8 +631,30 @@ static void handle_trans(connection_struct *conn, struct smb_request *req, state->max_param_return); if (state->close_on_completion) { - close_cnum(conn,state->vuid); + struct smbXsrv_tcon *tcon; + NTSTATUS status; + + tcon = conn->tcon; req->conn = NULL; + conn = NULL; + + /* + * TODO: cancel all outstanding requests on the tcon + */ + status = smbXsrv_tcon_disconnect(tcon, state->vuid); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("handle_trans: " + "smbXsrv_tcon_disconnect() failed: %s\n", + nt_errstr(status))); + /* + * If we hit this case, there is something completely + * wrong, so we better disconnect the transport connection. + */ + exit_server(__location__ ": smbXsrv_tcon_disconnect failed"); + return; + } + + TALLOC_FREE(tcon); } return; -- cgit