[SCM] Samba Shared Repository - branch master updated

Kamen Mazdrashki kamenim at samba.org
Thu Jun 10 16:21:54 MDT 2010


The branch, master has been updated
       via  1ceb0dd... s4/test: use test_libnet_context_init() function to create libnet_context
       via  d6d8ec8... s4/test: fix SEGFAULT in test_group_create when rid is NULL
       via  eda4926... s4/test-libnet: Helper func to initialize libnet_context
       via  85d7863... s4/test: Call test_user_cleanup with original RDN for the user
       via  61e5ac4... s4/test: Fix incorrect NTSTATUS comparison
       via  64a71d3... s4/test: remove create/delete group implementation in API-CREATEGROUP test
       via  d02c395... s4/test: Remove duplicated test_opendomain() functionality
       via  7135abc... s4/test: libnet_user tests should use common test_user_cleanup
       via  d1bcc23... s4/test: Refactor test_user_cleanup to be more robust
       via  1b8a8dd... s4/test: remove duplicated comment
      from  0962763... s3:misc make use of server_[event/messaging]_context directly

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


- Log -----------------------------------------------------------------
commit 1ceb0dd92f1c1795264832eee0711612cc58d9a8
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Thu Jun 10 18:23:06 2010 +0300

    s4/test: use test_libnet_context_init() function to create libnet_context
    
    This way we ensure that LIBNET call will be issued against
    the DC we are testing against

commit d6d8ec80f9fc713924df1c9b72ab0491bdf95bde
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Thu Jun 10 18:21:44 2010 +0300

    s4/test: fix SEGFAULT in test_group_create when rid is NULL
    
    Caller of this function may not need group RID and
    in such case it passes NULL for rid parameter

commit eda49261205471a1e0c96ae4e1eda037edb11eba
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Thu Jun 10 13:12:08 2010 +0300

    s4/test-libnet: Helper func to initialize libnet_context
    
    and create rpc connections to SAMR and LSA pipes.
    This function should be used in cases where we need
    'deterministic' connection to the DC we are testing against.
    
    The problem is that most of the test follow the pattern:
    1. Connect to server supplied on command line
    2. Create user/group through connection in 1.
    3. Use 'fresh' libnet_context to query/alter the object in
       step 2.
    
    In singe-DC environment this work well. But in multiple-DC
    environment libnet may connect to another DC (step 3), not
    the one we use in step 1 and 2. This leads to false error -
    object created in step 2 is not found on DC we are querying
    in step 3.

commit 85d7863b2c2420bd652d73ab4ec230f709acae73
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Thu Jun 10 02:02:06 2010 +0300

    s4/test: Call test_user_cleanup with original RDN for the user
    
    'name' var is changed during the test execution and should
    contain samAccountName for the user, while test_user_cleanup()
    expects account RDN to be passed

commit 61e5ac4a5a1d4a2bb59297cd28288ef1460d1ea4
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Thu Jun 10 01:59:51 2010 +0300

    s4/test: Fix incorrect NTSTATUS comparison
    
    In case group already exists, we should get NT_STATUS_GROUP_EXISTS.

commit 64a71d380cb88b19ecb8673dab07210514fc6a52
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Tue Jun 8 18:03:00 2010 +0300

    s4/test: remove create/delete group implementation in API-CREATEGROUP test
    
    We already have common implementation for create/delete
    group in libnet/utils.c

commit d02c395abdee28a7eef2cbbbf2e183da8f707004
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Tue Jun 8 15:44:00 2010 +0300

    s4/test: Remove duplicated test_opendomain() functionality
    
    We already have a nice common test_domain_open()
    function in libnet/util.c

commit 7135abcd8d979b9f7149e74f80edf118dc98de51
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Mon Jun 7 18:44:14 2010 +0300

    s4/test: libnet_user tests should use common test_user_cleanup
    
    implementation instead of not-so-informative test_cleanup()

commit d1bcc23b2c4df54e42597647395ccd948e338195
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Mon Jun 7 18:33:35 2010 +0300

    s4/test: Refactor test_user_cleanup to be more robust
    
    We always call this function with user's account RDN
    while samr_LookupNames() searches for samAccountName.

commit 1b8a8ddfe08bc4c083510ccf60e96079af952b74
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Mon Jun 7 17:51:26 2010 +0300

    s4/test: remove duplicated comment

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

Summary of changes:
 source4/torture/libnet/libnet_group.c |  180 ++-------------------------------
 source4/torture/libnet/libnet_user.c  |  169 ++++---------------------------
 source4/torture/libnet/userman.c      |    2 +-
 source4/torture/libnet/utils.c        |  162 ++++++++++++++++++++++++++----
 4 files changed, 177 insertions(+), 336 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/libnet/libnet_group.c b/source4/torture/libnet/libnet_group.c
index f26f988..0d8249f 100644
--- a/source4/torture/libnet/libnet_group.c
+++ b/source4/torture/libnet/libnet_group.c
@@ -32,166 +32,6 @@
 #define TEST_GROUPNAME  "libnetgrouptest"
 
 
-static bool test_cleanup(struct torture_context *tctx,
-			 struct dcerpc_binding_handle *b, TALLOC_CTX *mem_ctx,
-			 struct policy_handle *domain_handle, const char *groupname)
-{
-	struct samr_LookupNames r1;
-	struct samr_OpenGroup r2;
-	struct samr_DeleteDomainGroup r3;
-	struct lsa_String names[2];
-	uint32_t rid;
-	struct policy_handle group_handle;
-	struct samr_Ids rids, types;
-
-	names[0].string = groupname;
-
-	r1.in.domain_handle  = domain_handle;
-	r1.in.num_names      = 1;
-	r1.in.names          = names;
-	r1.out.rids          = &rids;
-	r1.out.types         = &types;
-
-	torture_comment(tctx, "group account lookup '%s'\n", groupname);
-
-	torture_assert_ntstatus_ok(tctx,
-		dcerpc_samr_LookupNames_r(b, mem_ctx, &r1),
-		"LookupNames failed");
-	torture_assert_ntstatus_ok(tctx, r1.out.result,
-		"LookupNames failed");
-
-	rid = r1.out.rids->ids[0];
-
-	r2.in.domain_handle  = domain_handle;
-	r2.in.access_mask    = SEC_FLAG_MAXIMUM_ALLOWED;
-	r2.in.rid            = rid;
-	r2.out.group_handle  = &group_handle;
-
-	torture_comment(tctx, "opening group account\n");
-
-	torture_assert_ntstatus_ok(tctx,
-		dcerpc_samr_OpenGroup_r(b, mem_ctx, &r2),
-		"OpenGroup failed");
-	torture_assert_ntstatus_ok(tctx, r2.out.result,
-		"OpenGroup failed");
-
-	r3.in.group_handle  = &group_handle;
-	r3.out.group_handle = &group_handle;
-
-	torture_comment(tctx, "deleting group account\n");
-
-	torture_assert_ntstatus_ok(tctx,
-		dcerpc_samr_DeleteDomainGroup_r(b, mem_ctx, &r3),
-		"DeleteGroup failed");
-	torture_assert_ntstatus_ok(tctx, r3.out.result,
-		"DeleteGroup failed");
-
-	return true;
-}
-
-
-static bool test_creategroup(struct torture_context *tctx,
-			     struct dcerpc_binding_handle *b, TALLOC_CTX *mem_ctx,
-			     struct policy_handle *handle, const char *name)
-{
-	struct lsa_String groupname;
-	struct samr_CreateDomainGroup r;
-	struct policy_handle group_handle;
-	uint32_t group_rid;
-
-	groupname.string = name;
-
-	r.in.domain_handle  = handle;
-	r.in.name           = &groupname;
-	r.in.access_mask    = SEC_FLAG_MAXIMUM_ALLOWED;
-	r.out.group_handle  = &group_handle;
-	r.out.rid           = &group_rid;
-
-	torture_comment(tctx, "creating group account %s\n", name);
-
-	torture_assert_ntstatus_ok(tctx,
-		dcerpc_samr_CreateDomainGroup_r(b, mem_ctx, &r),
-		"CreateGroup failed");
-
-	if (!NT_STATUS_IS_OK(r.out.result)) {
-		torture_comment(tctx, "CreateGroup failed - %s\n", nt_errstr(r.out.result));
-
-		if (NT_STATUS_EQUAL(r.out.result, NT_STATUS_GROUP_EXISTS)) {
-			torture_comment(tctx, "Group (%s) already exists - attempting to delete and recreate group again\n", name);
-			if (!test_cleanup(tctx, b, mem_ctx, handle, TEST_GROUPNAME)) {
-				return false;
-			}
-
-			torture_comment(tctx, "creating group account\n");
-
-			torture_assert_ntstatus_ok(tctx,
-				dcerpc_samr_CreateDomainGroup_r(b, mem_ctx, &r),
-				"CreateGroup failed");
-			torture_assert_ntstatus_ok(tctx, r.out.result,
-				"CreateGroup failed");
-
-			return true;
-		}
-		return false;
-	}
-
-	return true;
-}
-
-
-static bool test_opendomain(struct torture_context *tctx,
-			    struct dcerpc_binding_handle *b, TALLOC_CTX *mem_ctx,
-			    struct policy_handle *handle, struct lsa_String *domname)
-{
-	struct policy_handle h, domain_handle;
-	struct samr_Connect r1;
-	struct samr_LookupDomain r2;
-	struct dom_sid2 *sid = NULL;
-	struct samr_OpenDomain r3;
-
-	torture_comment(tctx, "connecting\n");
-
-	r1.in.system_name = 0;
-	r1.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
-	r1.out.connect_handle = &h;
-
-	torture_assert_ntstatus_ok(tctx,
-		dcerpc_samr_Connect_r(b, mem_ctx, &r1),
-		"Connect failed");
-	torture_assert_ntstatus_ok(tctx, r1.out.result,
-		"Connect failed");
-
-	r2.in.connect_handle = &h;
-	r2.in.domain_name = domname;
-	r2.out.sid = &sid;
-
-	torture_comment(tctx, "domain lookup on %s\n", domname->string);
-
-	torture_assert_ntstatus_ok(tctx,
-		dcerpc_samr_LookupDomain_r(b, mem_ctx, &r2),
-		"LookupDomain failed");
-	torture_assert_ntstatus_ok(tctx, r2.out.result,
-		"LookupDomain failed");
-
-	r3.in.connect_handle = &h;
-	r3.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
-	r3.in.sid = *r2.out.sid;
-	r3.out.domain_handle = &domain_handle;
-
-	torture_comment(tctx, "opening domain\n");
-
-	torture_assert_ntstatus_ok(tctx,
-		dcerpc_samr_OpenDomain_r(b, mem_ctx, &r3),
-		"OpenDomain failed");
-	torture_assert_ntstatus_ok(tctx, r3.out.result,
-		"OpenDomain failed");
-
-	*handle = domain_handle;
-
-	return true;
-}
-
-
 static bool test_lsa_close(struct torture_context *tctx,
 			   struct dcerpc_binding_handle *b, TALLOC_CTX *mem_ctx,
 			   struct policy_handle *domain_handle)
@@ -217,7 +57,7 @@ bool torture_groupinfo_api(struct torture_context *torture)
 	bool ret = true;
 	NTSTATUS status;
 	TALLOC_CTX *mem_ctx = NULL, *prep_mem_ctx;
-	struct libnet_context *ctx;
+	struct libnet_context *ctx = NULL;
 	struct dcerpc_pipe *p;
 	struct policy_handle h;
 	struct lsa_String domain_name;
@@ -225,9 +65,6 @@ bool torture_groupinfo_api(struct torture_context *torture)
 
 	prep_mem_ctx = talloc_init("prepare torture group info");
 
-	ctx = libnet_context_init(torture->ev, torture->lp_ctx);
-	ctx->cred = cmdline_credentials;
-
 	status = torture_rpc_connection(torture,
 					&p,
 					&ndr_table_samr);
@@ -236,18 +73,22 @@ bool torture_groupinfo_api(struct torture_context *torture)
 	}
 
 	domain_name.string = lp_workgroup(torture->lp_ctx);
-	if (!test_opendomain(torture, p->binding_handle, prep_mem_ctx, &h, &domain_name)) {
+	if (!test_domain_open(torture, p->binding_handle, &domain_name, prep_mem_ctx, &h, NULL)) {
 		ret = false;
 		goto done;
 	}
 
-	if (!test_creategroup(torture, p->binding_handle, prep_mem_ctx, &h, name)) {
+	if (!test_group_create(torture, p->binding_handle, prep_mem_ctx, &h, name, NULL)) {
 		ret = false;
 		goto done;
 	}
 
 	mem_ctx = talloc_init("torture group info");
 
+	if (!test_libnet_context_init(torture, true, &ctx)) {
+		return false;
+	}
+
 	ZERO_STRUCT(req);
 
 	req.in.domain_name = domain_name.string;
@@ -261,7 +102,7 @@ bool torture_groupinfo_api(struct torture_context *torture)
 		goto done;
 	}
 
-	if (!test_cleanup(torture, ctx->samr.pipe->binding_handle, mem_ctx, &ctx->samr.handle, TEST_GROUPNAME)) {
+	if (!test_group_cleanup(torture, ctx->samr.pipe->binding_handle, mem_ctx, &ctx->samr.handle, TEST_GROUPNAME)) {
 		torture_comment(torture, "cleanup failed\n");
 		ret = false;
 		goto done;
@@ -273,9 +114,8 @@ bool torture_groupinfo_api(struct torture_context *torture)
 		ret = false;
 	}
 
-	talloc_free(ctx);
-
 done:
+	talloc_free(ctx);
 	talloc_free(mem_ctx);
 	return ret;
 }
@@ -367,7 +207,7 @@ bool torture_creategroup(struct torture_context *torture)
 		goto done;
 	}
 
-	if (!test_cleanup(torture, ctx->samr.pipe->binding_handle, mem_ctx, &ctx->samr.handle, TEST_GROUPNAME)) {
+	if (!test_group_cleanup(torture, ctx->samr.pipe->binding_handle, mem_ctx, &ctx->samr.handle, TEST_GROUPNAME)) {
 		torture_comment(torture, "cleanup failed\n");
 		ret = false;
 		goto done;
diff --git a/source4/torture/libnet/libnet_user.c b/source4/torture/libnet/libnet_user.c
index 587676a..84a642a 100644
--- a/source4/torture/libnet/libnet_user.c
+++ b/source4/torture/libnet/libnet_user.c
@@ -28,133 +28,7 @@
 #include "torture/libnet/usertest.h"
 #include "torture/libnet/proto.h"
 #include "param/param.h"
-#include "lib/ldb_wrap.h"
-
-
-/**
- * Find out user's samAccountName for given
- * user RDN. We need samAccountName value
- * 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)
-{
-	const char *url;
-	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);
-	int ldb_ret;
-	struct ldb_result *ldb_res;
-	const char *account_name = NULL;
-	static const char *attrs[] = {
-		"samAccountName",
-		NULL
-	};
-
-	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);
-	torture_assert_goto(tctx, url != NULL, test_res, done, "Failed to allocate URL for ldb");
-
-	ldb = ldb_wrap_connect(tmp_ctx,
-	                       tctx->ev, tctx->lp_ctx,
-	                       url, NULL, cmdline_credentials, 0);
-	torture_assert_goto(tctx, ldb != NULL, test_res, done, "Failed to make LDB connection");
-
-	ldb_ret = ldb_search(ldb, tmp_ctx, &ldb_res,
-	                     ldb_get_default_basedn(ldb), LDB_SCOPE_SUBTREE,
-	                     attrs,
-	                     "(&(objectClass=user)(name=%s))", user_rdn);
-	if (LDB_SUCCESS == ldb_ret && 1 == ldb_res->count) {
-		account_name = ldb_msg_find_attr_as_string(ldb_res->msgs[0], "samAccountName", NULL);
-	}
-
-	/* return user_rdn by default */
-	if (!account_name) {
-		account_name = user_rdn;
-	}
-
-	/* duplicate memory in parent context */
-	*_account_name = talloc_strdup(mem_ctx, account_name);
-
-done:
-	talloc_free(tmp_ctx);
-	return test_res;
-}
-
-/**
- * Deletes a user account when given user RDN name
- *
- * @param username RDN for the user to be deleted
- */
-static bool test_cleanup(struct torture_context *tctx,
-			 struct dcerpc_binding_handle *b, TALLOC_CTX *mem_ctx,
-			 struct policy_handle *domain_handle, const char *username)
-{
-	struct samr_LookupNames r1;
-	struct samr_OpenUser r2;
-	struct samr_DeleteUser r3;
-	struct lsa_String names[2];
-	uint32_t rid;
-	struct policy_handle user_handle;
-	struct samr_Ids rids, types;
-	const char *account_name;
-
-	if (!_get_account_name_for_user_rdn(tctx, b, username, mem_ctx, &account_name)) {
-		torture_result(tctx, TORTURE_FAIL,
-		               __location__": Failed to find samAccountName for %s", username);
-		return false;
-	}
-
-	names[0].string = account_name;
-
-	r1.in.domain_handle  = domain_handle;
-	r1.in.num_names      = 1;
-	r1.in.names          = names;
-	r1.out.rids          = &rids;
-	r1.out.types         = &types;
 
-	torture_comment(tctx, "user account lookup '%s'\n", account_name);
-
-	torture_assert_ntstatus_ok(tctx,
-		dcerpc_samr_LookupNames_r(b, mem_ctx, &r1),
-		"LookupNames failed");
-	torture_assert_ntstatus_ok(tctx, r1.out.result,
-		"LookupNames failed");
-
-	rid = r1.out.rids->ids[0];
-
-	r2.in.domain_handle  = domain_handle;
-	r2.in.access_mask    = SEC_FLAG_MAXIMUM_ALLOWED;
-	r2.in.rid            = rid;
-	r2.out.user_handle   = &user_handle;
-
-	torture_comment(tctx, "opening user account\n");
-
-	torture_assert_ntstatus_ok(tctx,
-		dcerpc_samr_OpenUser_r(b, mem_ctx, &r2),
-		"OpenUser failed");
-	torture_assert_ntstatus_ok(tctx, r2.out.result,
-		"OpenUser failed");
-
-	r3.in.user_handle  = &user_handle;
-	r3.out.user_handle = &user_handle;
-
-	torture_comment(tctx, "deleting user account\n");
-
-	torture_assert_ntstatus_ok(tctx,
-		dcerpc_samr_DeleteUser_r(b, mem_ctx, &r3),
-		"DeleteUser failed");
-	torture_assert_ntstatus_ok(tctx, r3.out.result,
-		"DeleteUser failed");
-
-	return true;
-}
 
 
 static bool test_lsa_close(struct torture_context *tctx,
@@ -180,14 +54,15 @@ bool torture_createuser(struct torture_context *torture)
 {
 	NTSTATUS status;
 	TALLOC_CTX *mem_ctx;
-	struct libnet_context *ctx;
+	struct libnet_context *ctx = NULL;
 	struct libnet_CreateUser req;
 	bool ret = true;
 
 	mem_ctx = talloc_init("test_createuser");
 
-	ctx = libnet_context_init(torture->ev, torture->lp_ctx);
-	ctx->cred = cmdline_credentials;
+	if (!test_libnet_context_init(torture, true, &ctx)) {
+		return false;
+	}
 
 	req.in.user_name = TEST_USERNAME;
 	req.in.domain_name = lp_workgroup(torture->lp_ctx);
@@ -200,7 +75,8 @@ bool torture_createuser(struct torture_context *torture)
 		goto done;
 	}
 
-	if (!test_cleanup(torture, ctx->samr.pipe->binding_handle, mem_ctx, &ctx->samr.handle, TEST_USERNAME)) {
+	if (!test_user_cleanup(torture, ctx->samr.pipe->binding_handle,
+	                       mem_ctx, &ctx->samr.handle, TEST_USERNAME)) {
 		torture_comment(torture, "cleanup failed\n");
 		ret = false;
 		goto done;
@@ -227,15 +103,12 @@ bool torture_deleteuser(struct torture_context *torture)
 	struct policy_handle h;
 	struct lsa_String domain_name;
 	const char *name = TEST_USERNAME;
-	struct libnet_context *ctx;
+	struct libnet_context *ctx = NULL;
 	struct libnet_DeleteUser req;
 	bool ret = true;
 
 	prep_mem_ctx = talloc_init("prepare test_deleteuser");
 
-	ctx = libnet_context_init(torture->ev, torture->lp_ctx);
-	ctx->cred = cmdline_credentials;
-
 	req.in.user_name = TEST_USERNAME;
 	req.in.domain_name = lp_workgroup(torture->lp_ctx);
 
@@ -260,6 +133,10 @@ bool torture_deleteuser(struct torture_context *torture)
 
 	mem_ctx = talloc_init("test_deleteuser");
 
+	if (!test_libnet_context_init(torture, true, &ctx)) {
+		return false;
+	}
+
 	status = libnet_DeleteUser(ctx, mem_ctx, &req);
 	if (!NT_STATUS_IS_OK(status)) {
 		torture_comment(torture, "libnet_DeleteUser call failed: %s\n", nt_errstr(status));
@@ -445,7 +322,7 @@ bool torture_modifyuser(struct torture_context *torture)
 	struct policy_handle h;
 	struct lsa_String domain_name;
 	char *name;
-	struct libnet_context *ctx;
+	struct libnet_context *ctx = NULL;
 	struct libnet_ModifyUser req;
 	struct libnet_UserInfo user_req;
 	int fld;
@@ -454,9 +331,6 @@ bool torture_modifyuser(struct torture_context *torture)
 
 	prep_mem_ctx = talloc_init("prepare test_deleteuser");
 
-	ctx = libnet_context_init(torture->ev, torture->lp_ctx);
-	ctx->cred = cmdline_credentials;
-
 	status = torture_rpc_connection(torture,
 					&p,
 					&ndr_table_samr);
@@ -481,7 +355,7 @@ bool torture_modifyuser(struct torture_context *torture)
 
 	torture_comment(torture, "Testing change of all fields - each single one in turn\n");
 
-	if (!_libnet_context_init_pipes(torture, ctx)) {
+	if (!test_libnet_context_init(torture, true, &ctx)) {
 		return false;
 	}
 
@@ -538,7 +412,7 @@ bool torture_modifyuser(struct torture_context *torture)
 	}
 
 cleanup:
-	if (!test_cleanup(torture, ctx->samr.pipe->binding_handle,
+	if (!test_user_cleanup(torture, ctx->samr.pipe->binding_handle,
 	                  torture, &ctx->samr.handle, TEST_USERNAME)) {
 		torture_comment(torture, "cleanup failed\n");
 		ret = false;
@@ -564,7 +438,7 @@ bool torture_userinfo_api(struct torture_context *torture)
 	bool ret = true;
 	NTSTATUS status;
 	TALLOC_CTX *mem_ctx = NULL, *prep_mem_ctx;
-	struct libnet_context *ctx;
+	struct libnet_context *ctx = NULL;
 	struct dcerpc_pipe *p;
 	struct policy_handle h;
 	struct lsa_String domain_name;
@@ -573,9 +447,6 @@ bool torture_userinfo_api(struct torture_context *torture)
 
 	prep_mem_ctx = talloc_init("prepare torture user info");
 
-	ctx = libnet_context_init(torture->ev, torture->lp_ctx);
-	ctx->cred = cmdline_credentials;
-
 	status = torture_rpc_connection(torture,
 					&p,
 					&ndr_table_samr);
@@ -597,6 +468,10 @@ bool torture_userinfo_api(struct torture_context *torture)
 
 	mem_ctx = talloc_init("torture user info");
 
+	if (!test_libnet_context_init(torture, true, &ctx)) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list