diff options
author | Julien Kerihuel <j.kerihuel@openchange.org> | 2015-03-24 21:06:03 -0700 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2015-04-28 02:21:24 +0200 |
commit | 8b78cc3b51505cff5a8876b338d509678f4d0a50 (patch) | |
tree | 7f596c561b3eb1a220fdc91c74025c25d7fc1a85 | |
parent | 2e0df254611d2e310cdb563e70c21ddb7560a038 (diff) | |
download | samba-8b78cc3b51505cff5a8876b338d509678f4d0a50.tar.gz |
s4:rpc_server: Add multiplex state to dcerpc flags and control over multiplex PFC flag in bind_ack and and dcesrv_alter replies
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11225
Signed-off-by: Julien Kerihuel <j.kerihuel@openchange.org>
Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
(cherry picked from commit caaf89e899c2a3926fb9e54d1c86f1a9cd5d7618)
Conflicts:
source4/rpc_server/dcerpc_server.c
source4/rpc_server/dcerpc_server.h
-rw-r--r-- | source4/rpc_server/dcerpc_server.c | 15 | ||||
-rw-r--r-- | source4/rpc_server/dcerpc_server.h | 1 |
2 files changed, 15 insertions, 1 deletions
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c index ad53685be02..39de1b2b87c 100644 --- a/source4/rpc_server/dcerpc_server.c +++ b/source4/rpc_server/dcerpc_server.c @@ -616,6 +616,12 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call) extra_flags |= DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN; } + if ((call->pkt.pfc_flags & DCERPC_PFC_FLAG_CONC_MPX) && + (call->state_flags & DCESRV_CALL_STATE_FLAG_MULTIPLEXED)) { + call->context->conn->state_flags |= DCESRV_CALL_STATE_FLAG_MULTIPLEXED; + extra_flags |= DCERPC_PFC_FLAG_CONC_MPX; + } + /* handle any authentication that is being requested */ if (!dcesrv_auth_bind(call)) { talloc_free(call->context); @@ -795,6 +801,7 @@ static NTSTATUS dcesrv_alter(struct dcesrv_call_state *call) NTSTATUS status; uint32_t result=0, reason=0; uint32_t context_id; + uint32_t extra_flags = 0; /* handle any authentication that is being requested */ if (!dcesrv_auth_alter(call)) { @@ -828,12 +835,18 @@ static NTSTATUS dcesrv_alter(struct dcesrv_call_state *call) reason = DCERPC_BIND_REASON_ASYNTAX; } + if ((call->pkt.pfc_flags & DCERPC_PFC_FLAG_CONC_MPX)) { + if (call->context->conn->state_flags & DCESRV_CALL_STATE_FLAG_MULTIPLEXED) { + extra_flags |= DCERPC_PFC_FLAG_CONC_MPX; + } + } + /* setup a alter_resp */ dcesrv_init_hdr(&pkt, lpcfg_rpc_big_endian(call->conn->dce_ctx->lp_ctx)); pkt.auth_length = 0; pkt.call_id = call->pkt.call_id; pkt.ptype = DCERPC_PKT_ALTER_RESP; - pkt.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST; + pkt.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST | extra_flags; pkt.u.alter_resp.max_xmit_frag = 0x2000; pkt.u.alter_resp.max_recv_frag = 0x2000; if (result == 0) { diff --git a/source4/rpc_server/dcerpc_server.h b/source4/rpc_server/dcerpc_server.h index 66fe51e17fc..e2c98989094 100644 --- a/source4/rpc_server/dcerpc_server.h +++ b/source4/rpc_server/dcerpc_server.h @@ -102,6 +102,7 @@ struct dcesrv_call_state { #define DCESRV_CALL_STATE_FLAG_ASYNC (1<<0) #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) uint32_t state_flags; /* the time the request arrived in the server */ |