From 740843e7fccd85b7adf258159543050fc1c12b99 Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Mon, 27 Nov 2006 22:40:53 +0000 Subject: r19925: Close the lsa handle in the end, and test calling libnet_UserList with non-zero resume index to continue longer enumeration. rafal (This used to be commit efa04d6d0b62ff3c6332db4b31622c0579428a56) --- source4/torture/libnet/libnet_user.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'source4/torture/libnet/libnet_user.c') diff --git a/source4/torture/libnet/libnet_user.c b/source4/torture/libnet/libnet_user.c index 44aa38073c..3d507090fd 100644 --- a/source4/torture/libnet/libnet_user.c +++ b/source4/torture/libnet/libnet_user.c @@ -696,20 +696,31 @@ BOOL torture_userlist(struct torture_context *torture) ZERO_STRUCT(req); - req.in.domain_name = domain_name.string; - req.in.page_size = 30; - req.in.resume_index = 0; + do { - status = libnet_UserList(ctx, mem_ctx, &req); - if (!NT_STATUS_IS_OK(status)) { + req.in.domain_name = domain_name.string; + req.in.page_size = 128; + req.in.resume_index = req.out.resume_index; + + status = libnet_UserList(ctx, mem_ctx, &req); + + } while (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)); + + if (!(NT_STATUS_IS_OK(status) || + NT_STATUS_EQUAL(status, NT_STATUS_NO_MORE_ENTRIES))) { printf("libnet_UserList call failed: %s\n", nt_errstr(status)); ret = False; - talloc_free(mem_ctx); goto done; } if (!test_samr_close(ctx->samr.pipe, mem_ctx, &ctx->samr.handle)) { - printf("domain close failed\n"); + printf("samr domain close failed\n"); + ret = False; + goto done; + } + + if (!test_lsa_close(ctx->lsa.pipe, mem_ctx, &ctx->lsa.handle)) { + printf("lsa domain close failed\n"); ret = False; } -- cgit