diff options
author | Rafal Szczesniak <mimir@samba.org> | 2005-04-21 12:22:48 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:11:36 -0500 |
commit | f6e585d69bda48ef7625ce57b78978f77bb9c04c (patch) | |
tree | 2d28e0c5c69b381b03f27039361f814f1d0e8cdf | |
parent | 5c521587c99f1da49af4e8fb37282796fc531bc8 (diff) | |
download | samba-f6e585d69bda48ef7625ce57b78978f77bb9c04c.tar.gz samba-f6e585d69bda48ef7625ce57b78978f77bb9c04c.tar.xz samba-f6e585d69bda48ef7625ce57b78978f77bb9c04c.zip |
r6420: Close user account handle before calling tested function to better
simulate real conditions of calling the function.
rafal
(This used to be commit 2518122c9e230639db253ff02de1843cb3448198)
-rw-r--r-- | source4/torture/libnet/userman.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/source4/torture/libnet/userman.c b/source4/torture/libnet/userman.c index 75b05153d4c..947d671ae0e 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; } |