A more-commented version of rpc_server crash fix, matching closer the
authorAndrew Bartlett <abartlet@samba.org>
Tue, 16 Dec 2008 00:25:29 +0000 (11:25 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 16 Dec 2008 00:25:29 +0000 (11:25 +1100)
previous behaviour for the 'bad bind' case.

(It is only close, not matching - Windows 2008 sends a different,
non-zero, assoc_group_id each time)

Andrew Bartlett

source4/rpc_server/dcerpc_server.c

index 5f055ae342bde7187440fcf9509f738651e9e114..d27a8b90de7069daf1ab5dcf87d1a227b8b64837 100644 (file)
@@ -648,7 +648,20 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call)
        pkt.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST | extra_flags;
        pkt.u.bind_ack.max_xmit_frag = 0x2000;
        pkt.u.bind_ack.max_recv_frag = 0x2000;
-       pkt.u.bind_ack.assoc_group_id = iface?call->context->assoc_group_id:0;
+
+       /*
+         make it possible for iface->bind() to specify the assoc_group_id
+         This helps the openchange mapiproxy plugin to work correctly.
+         
+         metze
+       */
+       if (call->context) {
+               pkt.u.bind_ack.assoc_group_id = call->context->assoc_group_id;
+       } else {
+               /* we better pick something - this chosen so as to send a non zero assoc_group_id (matching windows), it also matches samba3 */
+               pkt.u.bind_ack.assoc_group_id = SAMBA_ASSOC_GROUP;
+       }
+
        if (iface) {
                /* FIXME: Use pipe name as specified by endpoint instead of interface name */
                pkt.u.bind_ack.secondary_address = talloc_asprintf(call, "\\PIPE\\%s", iface->name);