summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJulien Kerihuel <j.kerihuel@openchange.org>2015-04-06 11:26:58 +0200
committerKarolin Seeger <kseeger@samba.org>2015-04-28 04:30:13 +0200
commitf8ef49837f4ee62275d66047548ada7cb625347c (patch)
tree06817c22c9cd3771f84c4ab3b7df006cd1fd84b5 /source4
parent8b78cc3b51505cff5a8876b338d509678f4d0a50 (diff)
downloadsamba-f8ef49837f4ee62275d66047548ada7cb625347c.tar.gz
Add DCERPC flag to call unbind hooks without destroying the connection itself upon termination of a connection with outstanding pending calls.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11226 Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Apr 14 20:39:34 CEST 2015 on sn-devel-104 (cherry picked from commit fd90d270c7e97a639f42a96b674a674d1b51aa0d) Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-1-test): Tue Apr 28 04:30:13 CEST 2015 on sn-devel-104
Diffstat (limited to 'source4')
-rw-r--r--source4/rpc_server/dcerpc_server.c21
-rw-r--r--source4/rpc_server/dcerpc_server.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c
index 39de1b2b87c..8c0a1015fa2 100644
--- a/source4/rpc_server/dcerpc_server.c
+++ b/source4/rpc_server/dcerpc_server.c
@@ -500,6 +500,7 @@ static int dcesrv_connection_context_destructor(struct dcesrv_connection_context
if (c->iface && c->iface->unbind) {
c->iface->unbind(c, c->iface);
+ c->iface = NULL;
}
return 0;
@@ -622,6 +623,10 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call)
extra_flags |= DCERPC_PFC_FLAG_CONC_MPX;
}
+ if (call->state_flags & DCESRV_CALL_STATE_FLAG_PROCESS_PENDING_CALL) {
+ call->context->conn->state_flags |= DCESRV_CALL_STATE_FLAG_PROCESS_PENDING_CALL;
+ }
+
/* handle any authentication that is being requested */
if (!dcesrv_auth_bind(call)) {
talloc_free(call->context);
@@ -841,6 +846,10 @@ static NTSTATUS dcesrv_alter(struct dcesrv_call_state *call)
}
}
+ if (call->state_flags & DCESRV_CALL_STATE_FLAG_PROCESS_PENDING_CALL) {
+ call->context->conn->state_flags |= DCESRV_CALL_STATE_FLAG_PROCESS_PENDING_CALL;
+ }
+
/* setup a alter_resp */
dcesrv_init_hdr(&pkt, lpcfg_rpc_big_endian(call->conn->dce_ctx->lp_ctx));
pkt.auth_length = 0;
@@ -1320,6 +1329,18 @@ static void dcesrv_cleanup_broken_connections(struct dcesrv_context *dce_ctx)
cur = next;
next = cur->next;
+ if (cur->state_flags & DCESRV_CALL_STATE_FLAG_PROCESS_PENDING_CALL) {
+ struct dcesrv_connection_context *context_cur, *context_next;
+
+ context_next = cur->contexts;
+ while (context_next != NULL) {
+ context_cur = context_next;
+ context_next = context_cur->next;
+
+ dcesrv_connection_context_destructor(context_cur);
+ }
+ }
+
dcesrv_terminate_connection(cur, cur->terminate);
}
}
diff --git a/source4/rpc_server/dcerpc_server.h b/source4/rpc_server/dcerpc_server.h
index e2c98989094..bf8799a3592 100644
--- a/source4/rpc_server/dcerpc_server.h
+++ b/source4/rpc_server/dcerpc_server.h
@@ -103,6 +103,7 @@ struct dcesrv_call_state {
#define DCESRV_CALL_STATE_FLAG_MAY_ASYNC (1<<1)
#define DCESRV_CALL_STATE_FLAG_HEADER_SIGNING (1<<2)
#define DCESRV_CALL_STATE_FLAG_MULTIPLEXED (1<<3)
+#define DCESRV_CALL_STATE_FLAG_PROCESS_PENDING_CALL (1<<4)
uint32_t state_flags;
/* the time the request arrived in the server */