commit 0c2036ad49de75161e22d097759e84983b44fbbf
Author: Jakub Bogusz <[email protected]>
Date:   Fri May 22 22:29:36 2015 +0200

    - added one more dcerpc patch from 4.2.next (pending call support)

 samba-dcerpc-pending-call.patch            | 87 ++++++++++++++++++++++++++++++
 samba-refactor-dcesrv_alter-function.patch | 10 +++-
 samba.spec                                 |  6 ++-
 3 files changed, 100 insertions(+), 3 deletions(-)
---
diff --git a/samba.spec b/samba.spec
index 8739224..b1ff6fd 100644
--- a/samba.spec
+++ b/samba.spec
@@ -23,7 +23,7 @@ Summary:      Samba Active Directory and SMB server
 Summary(pl.UTF-8):     Serwer Samba Active Directory i SMB
 Name:          samba
 Version:       4.2.1
-Release:       0.1
+Release:       0.2
 Epoch:         1
 License:       GPL v3
 Group:         Networking/Daemons
@@ -49,7 +49,8 @@ Patch6:               server-role.patch
 Patch7:                %{name}-bug-9816.patch
 Patch8:                %{name}-lib-tls-fix-build-with-gnutls-3.4.patch
 Patch9:                %{name}-dcerpc-multiplexed.patch
-Patch10:       %{name}-refactor-dcesrv_alter-function.patch
+Patch10:       %{name}-dcerpc-pending-call.patch
+Patch11:       %{name}-refactor-dcesrv_alter-function.patch
 URL:           http://www.samba.org/
 BuildRequires: acl-devel
 %{?with_avahi:BuildRequires:   avahi-devel}
@@ -514,6 +515,7 @@ Ten pakiet zawiera schemat Samby (samba.schema) dla 
OpenLDAP-a.
 %patch8 -p1
 %patch9 -p1
 %patch10 -p1
+%patch11 -p1
 
 %{__sed} -i -e 's|#!/usr/bin/env python|#!/usr/bin/python|' 
source4/scripting/bin/samba*
 %{__sed} -i -e 's|#!/usr/bin/env perl|#!/usr/bin/perl|' pidl/pidl
diff --git a/samba-dcerpc-pending-call.patch b/samba-dcerpc-pending-call.patch
new file mode 100644
index 0000000..19c8479
--- /dev/null
+++ b/samba-dcerpc-pending-call.patch
@@ -0,0 +1,87 @@
+From c35e4be4f481312e3b0d639ae8bb980786749321 Mon Sep 17 00:00:00 2001
+From: Julien Kerihuel <[email protected]>
+Date: Mon, 6 Apr 2015 11:26:58 +0200
+Subject: [PATCH] Add DCERPC flag to call unbind hooks without destroying the
+ connection itself upon termination of a connection with outstanding pending
+ calls.
+
+Reviewed-by: Stefan Metzmacher <[email protected]>
+Reviewed-by: Jelmer Vernooij <[email protected]>
+
+Autobuild-User(master): Jeremy Allison <[email protected]>
+Autobuild-Date(master): Tue Apr 14 20:39:34 CEST 2015 on sn-devel-104
+
+(cherry picked from commit fd90d270c7e97a639f42a96b674a674d1b51aa0d)
+---
+ source4/rpc_server/dcerpc_server.c | 21 +++++++++++++++++++++
+ source4/rpc_server/dcerpc_server.h |  1 +
+ 2 files changed, 22 insertions(+)
+
+diff --git a/source4/rpc_server/dcerpc_server.c 
b/source4/rpc_server/dcerpc_server.c
+index 4681e17..f25aa68 100644
+--- a/source4/rpc_server/dcerpc_server.c
++++ b/source4/rpc_server/dcerpc_server.c
+@@ -504,6 +504,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;
+@@ -620,6 +621,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);
+@@ -839,6 +844,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;
+@@ -1377,6 +1386,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 2346876..8786cd8 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_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 */
+-- 
+1.9.1
+
diff --git a/samba-refactor-dcesrv_alter-function.patch 
b/samba-refactor-dcesrv_alter-function.patch
index c6ec03f..8f02c76 100644
--- a/samba-refactor-dcesrv_alter-function.patch
+++ b/samba-refactor-dcesrv_alter-function.patch
@@ -25,7 +25,7 @@ diff --git a/source4/rpc_server/dcerpc_server.c 
b/source4/rpc_server/dcerpc_serv
 index f25aa68..b1c763b 100644
 --- a/source4/rpc_server/dcerpc_server.c
 +++ b/source4/rpc_server/dcerpc_server.c
-@@ -793,62 +793,27 @@ static NTSTATUS dcesrv_alter_new_context(struct 
dcesrv_call_state *call, uint32_
+@@ -793,66 +793,31 @@ static NTSTATUS dcesrv_alter_new_context(struct 
dcesrv_call_state *call, uint32_
        return NT_STATUS_OK;
  }
  
@@ -86,6 +86,10 @@ index f25aa68..b1c763b 100644
 -              }
 -      }
 -
+-      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;
@@ -97,6 +101,10 @@ index f25aa68..b1c763b 100644
 +                                      DCESRV_CALL_STATE_FLAG_MULTIPLEXED) {
 +                      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;
++              }
 +      }
        pkt.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST | 
extra_flags;
        pkt.u.alter_resp.max_xmit_frag = 0x2000;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/samba.git/commitdiff/0c2036ad49de75161e22d097759e84983b44fbbf

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to