[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Mon Oct 28 03:21:03 MDT 2013


The branch, master has been updated
       via  30e5a5c rpc_server: Fix a memleak on error exit
       via  2180365 rpc_server: Remove rpc_ep_register_state->mem_ctx
       via  871e602 rpc_server: Fix some uses of tevent_req_nomem
       via  00132ab rpc_server: fix a typo
      from  9c1c3bb auth-kerberos: add the credentials.h so that enum credentials_obtained is defined

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 30e5a5c5bfd75303449956553b47b6cc82930291
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Oct 27 15:31:44 2013 +0100

    rpc_server: Fix a memleak on error exit
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Mon Oct 28 10:20:35 CET 2013 on sn-devel-104

commit 21803653bbc9dc2f23634315b92fce63e29a758c
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Oct 27 15:29:43 2013 +0100

    rpc_server: Remove rpc_ep_register_state->mem_ctx
    
    We can use the state directly as a parent
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 871e60297fd6823bc9f7479f2375f092091958c2
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Oct 27 15:27:45 2013 +0100

    rpc_server: Fix some uses of tevent_req_nomem
    
    tevent_req_nomem is to be used in a sequence of async actions where we
    have one main request. This is a completely independent loop without one
    central tevent_req. tevent_req_nomem is used as a simple way to signal
    an out of memory condition to the main request representing the async
    sequence. If we don't have such a tevent_req, we need to directly check
    for NULL.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 00132ab65c1b577d7dabf665f5e32ecf2620a2ab
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Oct 27 15:19:09 2013 +0100

    rpc_server: fix a typo
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source3/rpc_server/rpc_ep_register.c |   43 +++++++++++++--------------------
 1 files changed, 17 insertions(+), 26 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/rpc_server/rpc_ep_register.c b/source3/rpc_server/rpc_ep_register.c
index 96a3705..f576590 100644
--- a/source3/rpc_server/rpc_ep_register.c
+++ b/source3/rpc_server/rpc_ep_register.c
@@ -35,10 +35,9 @@ static NTSTATUS rpc_ep_try_register(TALLOC_CTX *mem_ctx,
 				    const struct dcerpc_binding_vector *v,
 				    struct dcerpc_binding_handle **pbh);
 
-struct rpc_ep_regsiter_state {
+struct rpc_ep_register_state {
 	struct dcerpc_binding_handle *h;
 
-	TALLOC_CTX *mem_ctx;
 	struct tevent_context *ev_ctx;
 	struct messaging_context *msg_ctx;
 
@@ -53,23 +52,14 @@ NTSTATUS rpc_ep_register(struct tevent_context *ev_ctx,
 			 const struct ndr_interface_table *iface,
 			 const struct dcerpc_binding_vector *v)
 {
-	struct rpc_ep_regsiter_state *state;
+	struct rpc_ep_register_state *state;
 	struct tevent_req *req;
 
-	state = talloc(ev_ctx, struct rpc_ep_regsiter_state);
+	state = talloc(ev_ctx, struct rpc_ep_register_state);
 	if (state == NULL) {
 		return NT_STATUS_NO_MEMORY;
 	}
 
-	state->mem_ctx = talloc_named(state,
-				      0,
-				      "ep %s %p",
-				      iface->name, state);
-	if (state->mem_ctx == NULL) {
-		talloc_free(state);
-		return NT_STATUS_NO_MEMORY;
-	}
-
 	state->wait_time = 1;
 	state->ev_ctx = ev_ctx;
 	state->msg_ctx = msg_ctx;
@@ -80,10 +70,10 @@ NTSTATUS rpc_ep_register(struct tevent_context *ev_ctx,
 		return NT_STATUS_NO_MEMORY;
 	}
 
-	req = tevent_wakeup_send(state->mem_ctx,
+	req = tevent_wakeup_send(state,
 				 state->ev_ctx,
 				 timeval_current_ofs(1, 0));
-	if (tevent_req_nomem(state->mem_ctx, req)) {
+	if (req == NULL) {
 		talloc_free(state);
 		return NT_STATUS_NO_MEMORY;
 	}
@@ -98,8 +88,8 @@ static void rpc_ep_monitor_loop(struct tevent_req *subreq);
 
 static void rpc_ep_register_loop(struct tevent_req *subreq)
 {
-	struct rpc_ep_regsiter_state *state =
-		tevent_req_callback_data(subreq, struct rpc_ep_regsiter_state);
+	struct rpc_ep_register_state *state =
+		tevent_req_callback_data(subreq, struct rpc_ep_register_state);
 	NTSTATUS status;
 	bool ok;
 
@@ -110,7 +100,7 @@ static void rpc_ep_register_loop(struct tevent_req *subreq)
 		return;
 	}
 
-	status = rpc_ep_try_register(state->mem_ctx,
+	status = rpc_ep_try_register(state,
 				     state->ev_ctx,
 				     state->msg_ctx,
 				     state->iface,
@@ -118,10 +108,10 @@ static void rpc_ep_register_loop(struct tevent_req *subreq)
 				     &state->h);
 	if (NT_STATUS_IS_OK(status)) {
 		/* endpoint registered, monitor the connnection. */
-		subreq = tevent_wakeup_send(state->mem_ctx,
+		subreq = tevent_wakeup_send(state,
 					    state->ev_ctx,
 					    timeval_current_ofs(MONITOR_WAIT_TIME, 0));
-		if (tevent_req_nomem(state->mem_ctx, subreq)) {
+		if (subreq == NULL) {
 			talloc_free(state);
 			return;
 		}
@@ -137,10 +127,10 @@ static void rpc_ep_register_loop(struct tevent_req *subreq)
 		state->wait_time = 16;
 	}
 
-	subreq = tevent_wakeup_send(state->mem_ctx,
+	subreq = tevent_wakeup_send(state,
 				    state->ev_ctx,
 				    timeval_current_ofs(state->wait_time, 0));
-	if (tevent_req_nomem(state->mem_ctx, subreq)) {
+	if (subreq == NULL) {
 		talloc_free(state);
 		return;
 	}
@@ -178,8 +168,8 @@ static NTSTATUS rpc_ep_try_register(TALLOC_CTX *mem_ctx,
  */
 static void rpc_ep_monitor_loop(struct tevent_req *subreq)
 {
-	struct rpc_ep_regsiter_state *state =
-		tevent_req_callback_data(subreq, struct rpc_ep_regsiter_state);
+	struct rpc_ep_register_state *state =
+		tevent_req_callback_data(subreq, struct rpc_ep_register_state);
 	struct policy_handle entry_handle;
 	struct dcerpc_binding map_binding;
 	struct epm_twr_p_t towers[10];
@@ -203,6 +193,7 @@ static void rpc_ep_monitor_loop(struct tevent_req *subreq)
 	ok = tevent_wakeup_recv(subreq);
 	TALLOC_FREE(subreq);
 	if (!ok) {
+		talloc_free(tmp_ctx);
 		talloc_free(state);
 		return;
 	}
@@ -255,10 +246,10 @@ static void rpc_ep_monitor_loop(struct tevent_req *subreq)
 				    &result);
 	talloc_free(tmp_ctx);
 
-	subreq = tevent_wakeup_send(state->mem_ctx,
+	subreq = tevent_wakeup_send(state,
 				    state->ev_ctx,
 				    timeval_current_ofs(MONITOR_WAIT_TIME, 0));
-	if (tevent_req_nomem(state->mem_ctx, subreq)) {
+	if (subreq == NULL) {
 		talloc_free(state);
 		return;
 	}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list