From d0b7bccf6d7ce8b5f053a73a722d388d2483d8e8 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 9 Jun 2008 11:01:59 +0200 Subject: netapi: implement NetUserEnum filters. Guenther (This used to be commit 0bd69df7704789888eba2a07aba505dce037c4eb) --- source3/lib/netapi/user.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'source3/lib/netapi') diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c index f053732ac9..53a307a6aa 100644 --- a/source3/lib/netapi/user.c +++ b/source3/lib/netapi/user.c @@ -468,6 +468,7 @@ WERROR NetUserEnum_r(struct libnetapi_ctx *ctx, struct dom_sid2 *domain_sid = NULL; struct policy_handle domain_handle; struct samr_SamArray *sam = NULL; + uint32_t filter = ACB_NORMAL; NTSTATUS status; WERROR werr; @@ -512,11 +513,31 @@ WERROR NetUserEnum_r(struct libnetapi_ctx *ctx, goto done; } + switch (r->in.filter) { + case FILTER_NORMAL_ACCOUNT: + filter = ACB_NORMAL; + break; + case FILTER_TEMP_DUPLICATE_ACCOUNT: + filter = ACB_TEMPDUP; + break; + case FILTER_INTERDOMAIN_TRUST_ACCOUNT: + filter = ACB_DOMTRUST; + break; + case FILTER_WORKSTATION_TRUST_ACCOUNT: + filter = ACB_WSTRUST; + break; + case FILTER_SERVER_TRUST_ACCOUNT: + filter = ACB_SVRTRUST; + break; + default: + break; + } + status = rpccli_samr_EnumDomainUsers(pipe_cli, ctx, &domain_handle, r->in.resume_handle, - r->in.filter, + filter, &sam, r->in.prefmaxlen, r->out.entries_read); -- cgit