[PATCH] Fix terminate connection behavior for asynchronous endpoint with PUSH notification flavors

Stefan (metze) Metzmacher metze at samba.org
Mon Mar 30 00:05:14 MDT 2015

Hi Julien,

> Good morning all,
> Attached is a patch to fix how the dcerpc server handles termination of
> connection for dcerpc endpoints with PUSH notification like behaviors.
> The patch adds a DCERPC_CALL_STATE_FLAG_SKIP_PENDING_CALL and set it to
> call->context->conn->state_flags during dcesrv_bind() and dcesrv_alter()
> calls if it was available in dce_call->state_flags. This flag later used
> within dcesrv_terminate_connection() to force behaving as if there was
> no pending calls on the connection and unbind ops on the interface to be
> called.
> Context: When implementing an asynchronous dcerpc endpoint that behaves
> as a PUSH notification service, the client sends a request for which the
> server does not send the reply unless there is either pending
> notifications to return or a timeout was reached.
> If the client closes the connection before the server returns, the
> connection is handled as a broken connection with pending calls on the
> dcerpc server and the destructor dcesrv_connection_context_destructor is
> never called. It also means that the unbind method on the interface is
> never called. A sample output is available below:
> ndr_pull_error(11): Pull bytes 4 (../librpc/ndr/ndr_basic.c:148)
> dcesrv: terminating connection due to 'NT_STATUS_BUFFER_TOO_SMALL' defered due to pending calls
> ndr_pull_error(11): Pull bytes 4 (../librpc/ndr/ndr_basic.c:148)
> dcesrv: terminating connection due to 'NT_STATUS_BUFFER_TOO_SMALL' defered due to pending calls
> With this patch applied, the unbind method of the interface is called:
> ndr_pull_error(11): Pull bytes 4 (../librpc/ndr/ndr_basic.c:148)
> Terminating connection - 'dcesrv: NT_STATUS_BUFFER_TOO_SMALL'
> imessaging: cleaning up /var/lib/samba/private/smbd.tmp/msg/msg.12698.43
> single_terminate: reason[dcesrv: NT_STATUS_BUFFER_TOO_SMALL]
> mapiproxy/servers/default/asyncemsmdb/dcesrv_asyncemsmdb.c:339(dcerpc_server_asyncemsmdb_unbind): DISCONNECTION FROM CLIENT

Can you explain how dcerpc_server_asyncemsmdb_unbind() is triggered,
I can't see it just looking at the capture.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150330/5e095751/attachment.pgp>

More information about the samba-technical mailing list