diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-15 20:47:59 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-15 20:47:59 +0000 |
commit | c24f56e71c2d15ba0e41146abf4b0387a2461bac (patch) | |
tree | 9cfa6905626f6a1a5c8a07ddb39462691d939ff4 /source4/torture/rpc/samr.c | |
parent | 8c90fcd32b37f211c32bcabe5e0c9af1a1ec5381 (diff) | |
download | samba-c24f56e71c2d15ba0e41146abf4b0387a2461bac.tar.gz samba-c24f56e71c2d15ba0e41146abf4b0387a2461bac.tar.bz2 samba-c24f56e71c2d15ba0e41146abf4b0387a2461bac.zip |
remember to samr_Close() policy handles after use
(This used to be commit 8b4e5c65e0e18657befbd5eba2d195c2751dcf7f)
Diffstat (limited to 'source4/torture/rpc/samr.c')
-rw-r--r-- | source4/torture/rpc/samr.c | 51 |
1 files changed, 46 insertions, 5 deletions
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index 2cdde7fc59..bfabd01149 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -21,6 +21,26 @@ #include "includes.h" +static BOOL test_Close(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, + struct policy_handle *handle) +{ + NTSTATUS status; + struct samr_Close r; + + r.in.handle = handle; + r.out.handle = handle; + + status = dcerpc_samr_Close(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("Close handle failed - %s\n", nt_errstr(status)); + return False; + } + + return True; +} + + + static BOOL test_QueryAliasInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle) { @@ -131,6 +151,10 @@ static BOOL test_OpenUser(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, ret = False; } + if (!test_Close(p, mem_ctx, &acct_handle)) { + ret = False; + } + return ret; } @@ -159,6 +183,10 @@ static BOOL test_OpenGroup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, ret = False; } + if (!test_Close(p, mem_ctx, &acct_handle)) { + ret = False; + } + return ret; } @@ -187,6 +215,10 @@ static BOOL test_OpenAlias(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, ret = False; } + if (!test_Close(p, mem_ctx, &acct_handle)) { + ret = False; + } + return ret; } @@ -337,6 +369,7 @@ static BOOL test_OpenDomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, NTSTATUS status; struct samr_OpenDomain r; struct policy_handle domain_handle; + BOOL ret = True; printf("Testing OpenDomain\n"); @@ -352,22 +385,26 @@ static BOOL test_OpenDomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, } if (!test_QueryDomainInfo(p, mem_ctx, &domain_handle)) { - return False; + ret = False; } if (!test_EnumDomainUsers(p, mem_ctx, &domain_handle)) { - return False; + ret = False; } if (!test_EnumDomainGroups(p, mem_ctx, &domain_handle)) { - return False; + ret = False; } if (!test_EnumDomainAliases(p, mem_ctx, &domain_handle)) { - return False; + ret = False; } - return True; + if (!test_Close(p, mem_ctx, &domain_handle)) { + ret = False; + } + + return ret; } static BOOL test_LookupDomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, @@ -491,6 +528,10 @@ BOOL torture_rpc_samr(int dummy) ret = False; } + if (!test_Close(p, mem_ctx, &handle)) { + ret = False; + } + torture_rpc_close(p); return ret; |