summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-06-11 15:37:12 +0300
committerKamen Mazdrashki <kamenim@samba.org>2010-06-11 17:46:35 +0300
commit6eecb968cb0eeea7212477dcee8148f093d8c88f (patch)
tree9b166a4a64b57eba323c3b9c1ed1e90a8695a2f4 /source4/torture
parenta735c1ade2573fadc84a0aae03cdaa1bddd43f90 (diff)
downloadsamba-6eecb968cb0eeea7212477dcee8148f093d8c88f.tar.gz
samba-6eecb968cb0eeea7212477dcee8148f093d8c88f.tar.bz2
samba-6eecb968cb0eeea7212477dcee8148f093d8c88f.zip
s4/test-libnet: Refactor test_user_create() little bit to:
- fix a flaw that user RID is not returned in case user is recreated - close unused policy handle to created user - do not take into account the result from test_samr_close_handle - we don't case
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/libnet/utils.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/source4/torture/libnet/utils.c b/source4/torture/libnet/utils.c
index 58db297a99..b4b2374acf 100644
--- a/source4/torture/libnet/utils.c
+++ b/source4/torture/libnet/utils.c
@@ -253,7 +253,8 @@ bool test_user_create(struct torture_context *tctx,
r.in.account_name = &username;
r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
r.out.user_handle = &user_handle;
- r.out.rid = &user_rid;
+ /* return user's RID only if requested */
+ r.out.rid = rid ? rid : &user_rid;
torture_comment(tctx, "creating user '%s'\n", username.string);
@@ -280,21 +281,16 @@ bool test_user_create(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, r.out.result,
"CreateUser failed");
+ /* be nice and close opened handles */
+ test_samr_close_handle(tctx, b, mem_ctx, &user_handle);
+
return true;
}
return false;
}
- torture_comment(tctx, "closing user '%s'\n", username.string);
-
- if (!test_samr_close_handle(tctx, b, mem_ctx, &user_handle)) {
- return false;
- }
-
- /* return user RID only if requested */
- if (rid) {
- *rid = user_rid;
- }
+ /* be nice and close opened handles */
+ test_samr_close_handle(tctx, b, mem_ctx, &user_handle);
return true;
}