diff options
author | Günther Deschner <gd@samba.org> | 2008-08-28 12:00:07 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-08-29 13:58:04 +0200 |
commit | 29b96a63f13dba707c430638a8f0ca34b5993321 (patch) | |
tree | 38b109b2c9f7052104f410f3c3cd5e7bfccb2703 | |
parent | 8bab11088b337f6f02e221472e1d0381d531ccf1 (diff) | |
download | samba-29b96a63f13dba707c430638a8f0ca34b5993321.tar.gz samba-29b96a63f13dba707c430638a8f0ca34b5993321.tar.bz2 samba-29b96a63f13dba707c430638a8f0ca34b5993321.zip |
netapi: add builtin handle to NetUserEnum.
Guenther
(This used to be commit f71b0808bec002f616fc451eddb7e19dd242a138)
-rw-r--r-- | source3/lib/netapi/user.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c index 25fb085f44..4e31175ebc 100644 --- a/source3/lib/netapi/user.c +++ b/source3/lib/netapi/user.c @@ -884,7 +884,7 @@ WERROR NetUserEnum_r(struct libnetapi_ctx *ctx, struct rpc_pipe_client *pipe_cli = NULL; struct policy_handle connect_handle; struct dom_sid2 *domain_sid = NULL; - struct policy_handle domain_handle; + struct policy_handle domain_handle, builtin_handle; struct samr_SamArray *sam = NULL; uint32_t filter = ACB_NORMAL; int i; @@ -895,6 +895,7 @@ WERROR NetUserEnum_r(struct libnetapi_ctx *ctx, ZERO_STRUCT(connect_handle); ZERO_STRUCT(domain_handle); + ZERO_STRUCT(builtin_handle); if (!r->out.buffer) { return WERR_INVALID_PARAM; @@ -926,6 +927,17 @@ WERROR NetUserEnum_r(struct libnetapi_ctx *ctx, goto done; } + werr = libnetapi_samr_open_builtin_domain(ctx, pipe_cli, + SAMR_ACCESS_ENUM_DOMAINS | + SAMR_ACCESS_OPEN_DOMAIN, + SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT | + SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS, + &connect_handle, + &builtin_handle); + if (!W_ERROR_IS_OK(werr)) { + goto done; + } + werr = libnetapi_samr_open_domain(ctx, pipe_cli, SAMR_ACCESS_ENUM_DOMAINS | SAMR_ACCESS_OPEN_DOMAIN, @@ -977,7 +989,7 @@ WERROR NetUserEnum_r(struct libnetapi_ctx *ctx, status = libnetapi_samr_lookup_user_map_USER_INFO(ctx, pipe_cli, domain_sid, &domain_handle, - NULL, /*&builtin_handle, */ + &builtin_handle, sam->entries[i].name.string, sam->entries[i].idx, r->in.level, @@ -1000,6 +1012,7 @@ WERROR NetUserEnum_r(struct libnetapi_ctx *ctx, if (ctx->disable_policy_handle_cache) { libnetapi_samr_close_domain_handle(ctx, &domain_handle); + libnetapi_samr_close_builtin_handle(ctx, &builtin_handle); libnetapi_samr_close_connect_handle(ctx, &connect_handle); } } |