summaryrefslogtreecommitdiff
path: root/source4/torture/libnet
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture/libnet')
-rw-r--r--source4/torture/libnet/userman.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/source4/torture/libnet/userman.c b/source4/torture/libnet/userman.c
index 75b05153d4..947d671ae0 100644
--- a/source4/torture/libnet/userman.c
+++ b/source4/torture/libnet/userman.c
@@ -159,25 +159,37 @@ static BOOL test_createuser(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
NTSTATUS status;
struct policy_handle h, domain_handle, user_handle;
struct samr_String username;
- struct samr_CreateUser r4;
+ struct samr_CreateUser r1;
+ struct samr_Close r2;
uint32_t user_rid;
username.string = user;
- r4.in.domain_handle = handle;
- r4.in.account_name = &username;
- r4.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
- r4.out.user_handle = &user_handle;
- r4.out.rid = &user_rid;
+ r1.in.domain_handle = handle;
+ r1.in.account_name = &username;
+ r1.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
+ r1.out.user_handle = &user_handle;
+ r1.out.rid = &user_rid;
printf("creating user '%s'\n", username.string);
- status = dcerpc_samr_CreateUser(p, mem_ctx, &r4);
+ status = dcerpc_samr_CreateUser(p, mem_ctx, &r1);
if (!NT_STATUS_IS_OK(status)) {
printf("CreateUser failed - %s\n", nt_errstr(status));
return False;
}
+ r2.in.handle = &user_handle;
+ r2.out.handle = &user_handle;
+
+ printf("closing user '%s'\n", username.string);
+
+ status = dcerpc_samr_Close(p, mem_ctx, &r2);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("Close failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
return True;
}