[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Mon Aug 2 09:43:30 MDT 2010


The branch, master has been updated
       via  31782e5... s4:librpc/rpc: avoid using DCERPC_NDR_REF_ALLOC for epm_Map()
       via  b1a584f... s4:torture/libnet: avoid dereferencing dcerpc_binding_handle internals
      from  d3fff45... s3-spoolss: Fixed a segfault if a value has no data.

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


- Log -----------------------------------------------------------------
commit 31782e52955f4f9301611a1e94b52b880f2ae302
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Aug 2 10:21:36 2010 +0200

    s4:librpc/rpc: avoid using DCERPC_NDR_REF_ALLOC for epm_Map()
    
    metze

commit b1a584f9dc67bee1ecde408620dd815be3533091
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Aug 2 09:53:27 2010 +0200

    s4:torture/libnet: avoid dereferencing dcerpc_binding_handle internals
    
    metze

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

Summary of changes:
 source4/librpc/rpc/dcerpc_util.c |    4 ++--
 source4/torture/libnet/utils.c   |    9 +++++----
 2 files changed, 7 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index 280115e..1210b58 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -118,6 +118,7 @@ struct epm_map_binding_state {
 	struct GUID guid;
 	struct epm_twr_t twr;
 	struct epm_twr_t *twr_r;
+	uint32_t num_towers;
 	struct epm_Map r;
 };
 
@@ -142,8 +143,6 @@ static void continue_epm_recv_binding(struct composite_context *ctx)
 	c->status = dcerpc_pipe_connect_b_recv(ctx, c, &s->pipe);
 	if (!composite_is_ok(c)) return;
 
-	s->pipe->conn->flags |= DCERPC_NDR_REF_ALLOC;
-
 	/* prepare requested binding parameters */
 	s->binding->object         = s->table->syntax_id;
 
@@ -156,6 +155,7 @@ static void continue_epm_recv_binding(struct composite_context *ctx)
 	s->r.in.entry_handle  = &s->handle;
 	s->r.in.max_towers    = 1;
 	s->r.out.entry_handle = &s->handle;
+	s->r.out.num_towers   = &s->num_towers;
 
 	/* send request for an endpoint mapping - a rpc request on connected pipe */
 	subreq = dcerpc_epm_Map_r_send(s, c->event_ctx,
diff --git a/source4/torture/libnet/utils.c b/source4/torture/libnet/utils.c
index 372482d..88cebf1 100644
--- a/source4/torture/libnet/utils.c
+++ b/source4/torture/libnet/utils.c
@@ -107,7 +107,6 @@ bool test_domain_open(struct torture_context *tctx,
  * when deleting users.
  */
 static bool _get_account_name_for_user_rdn(struct torture_context *tctx,
-					   struct dcerpc_binding_handle *b,
 					   const char *user_rdn,
 					   TALLOC_CTX *mem_ctx,
 					   const char **_account_name)
@@ -116,7 +115,7 @@ static bool _get_account_name_for_user_rdn(struct torture_context *tctx,
 	struct ldb_context *ldb;
 	TALLOC_CTX *tmp_ctx;
 	bool test_res = true;
-	struct dcerpc_pipe *p = talloc_get_type_abort(b->private_data, struct dcerpc_pipe);
+	const char *hostname = torture_setting_string(tctx, "host", NULL);
 	int ldb_ret;
 	struct ldb_result *ldb_res;
 	const char *account_name = NULL;
@@ -125,10 +124,12 @@ static bool _get_account_name_for_user_rdn(struct torture_context *tctx,
 		NULL
 	};
 
+	torture_assert(tctx, hostname != NULL, "Failed to get hostname");
+
 	tmp_ctx = talloc_new(tctx);
 	torture_assert(tctx, tmp_ctx != NULL, "Failed to create temporary mem context");
 
-	url = talloc_asprintf(tmp_ctx, "ldap://%s/", p->binding->target_hostname);
+	url = talloc_asprintf(tmp_ctx, "ldap://%s/", hostname);
 	torture_assert_goto(tctx, url != NULL, test_res, done, "Failed to allocate URL for ldb");
 
 	ldb = ldb_wrap_connect(tmp_ctx,
@@ -178,7 +179,7 @@ bool test_user_cleanup(struct torture_context *tctx,
 	struct samr_Ids rids, types;
 	const char *account_name;
 
-	if (!_get_account_name_for_user_rdn(tctx, b, user_rdn, mem_ctx, &account_name)) {
+	if (!_get_account_name_for_user_rdn(tctx, user_rdn, mem_ctx, &account_name)) {
 		torture_result(tctx, TORTURE_FAIL,
 		               __location__": Failed to find samAccountName for %s", user_rdn);
 		return false;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list