summaryrefslogtreecommitdiff
path: root/source3/smbd/smb2_tcon.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2015-05-01 16:50:55 +0200
committerJeremy Allison <jra@samba.org>2015-05-06 22:33:19 +0200
commitf71941491bbba20f394bd2f44425d7c21e90ba92 (patch)
tree68a8fcd3e5a8a958dfd78c9329a9d50864e45e43 /source3/smbd/smb2_tcon.c
parent5871d3da871349cba058bb91218ae58107cf05c8 (diff)
downloadsamba-f71941491bbba20f394bd2f44425d7c21e90ba92.tar.gz
s3:smb2_tcon: cancel pending requests on all connections on tdis
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11182 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/smbd/smb2_tcon.c')
-rw-r--r--source3/smbd/smb2_tcon.c66
1 files changed, 35 insertions, 31 deletions
diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c
index cf085a52587..3750bc13d57 100644
--- a/source3/smbd/smb2_tcon.c
+++ b/source3/smbd/smb2_tcon.c
@@ -502,8 +502,7 @@ static struct tevent_req *smbd_smb2_tdis_send(TALLOC_CTX *mem_ctx,
struct tevent_req *req;
struct smbd_smb2_tdis_state *state;
struct tevent_req *subreq;
- struct smbd_smb2_request *preq;
- struct smbXsrv_connection *xconn = smb2req->xconn;
+ struct smbXsrv_connection *xconn = NULL;
req = tevent_req_create(mem_ctx, &state,
struct smbd_smb2_tdis_state);
@@ -522,35 +521,40 @@ static struct tevent_req *smbd_smb2_tdis_send(TALLOC_CTX *mem_ctx,
*/
smb2req->tcon->status = NT_STATUS_NETWORK_NAME_DELETED;
- for (preq = xconn->smb2.requests; preq != NULL; preq = preq->next) {
- if (preq == smb2req) {
- /* Can't cancel current request. */
- continue;
- }
- if (preq->tcon != smb2req->tcon) {
- /* Request on different tcon. */
- continue;
- }
-
- /*
- * Never cancel anything in a compound
- * request. Way too hard to deal with
- * the result.
- */
- if (!preq->compound_related && preq->subreq != NULL) {
- tevent_req_cancel(preq->subreq);
- }
-
- /*
- * Now wait until the request is finished.
- *
- * We don't set a callback, as we just want to block the
- * wait queue and the talloc_free() of the request will
- * remove the item from the wait queue.
- */
- subreq = tevent_queue_wait_send(preq, ev, state->wait_queue);
- if (tevent_req_nomem(subreq, req)) {
- return tevent_req_post(req, ev);
+ xconn = smb2req->xconn->client->connections;
+ for (; xconn != NULL; xconn = xconn->next) {
+ struct smbd_smb2_request *preq;
+
+ for (preq = xconn->smb2.requests; preq != NULL; preq = preq->next) {
+ if (preq == smb2req) {
+ /* Can't cancel current request. */
+ continue;
+ }
+ if (preq->tcon != smb2req->tcon) {
+ /* Request on different tcon. */
+ continue;
+ }
+
+ /*
+ * Never cancel anything in a compound
+ * request. Way too hard to deal with
+ * the result.
+ */
+ if (!preq->compound_related && preq->subreq != NULL) {
+ tevent_req_cancel(preq->subreq);
+ }
+
+ /*
+ * Now wait until the request is finished.
+ *
+ * We don't set a callback, as we just want to block the
+ * wait queue and the talloc_free() of the request will
+ * remove the item from the wait queue.
+ */
+ subreq = tevent_queue_wait_send(preq, ev, state->wait_queue);
+ if (tevent_req_nomem(subreq, req)) {
+ return tevent_req_post(req, ev);
+ }
}
}