diff options
author | Günther Deschner <gd@samba.org> | 2008-06-03 00:13:59 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-06-03 01:27:50 +0200 |
commit | bd9d129e6a3857a0faa3ed4ab5a4a71f1272f94a (patch) | |
tree | 682568bc46d90c85c5e464ca230ddca69127746b /source3 | |
parent | 56bdfad87f69963d65ceb8f7c780a1bd887c1fea (diff) | |
download | samba-bd9d129e6a3857a0faa3ed4ab5a4a71f1272f94a.tar.gz samba-bd9d129e6a3857a0faa3ed4ab5a4a71f1272f94a.tar.bz2 samba-bd9d129e6a3857a0faa3ed4ab5a4a71f1272f94a.zip |
netapi: use libnetapi_samr_open_builtin_domain().
Guenther
(This used to be commit d1bf8c5ae6f4e3ade2000dd884c8384fb4b9f12c)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/netapi/localgroup.c | 92 |
1 files changed, 28 insertions, 64 deletions
diff --git a/source3/lib/netapi/localgroup.c b/source3/lib/netapi/localgroup.c index 77d7498371..a505abdf5b 100644 --- a/source3/lib/netapi/localgroup.c +++ b/source3/lib/netapi/localgroup.c @@ -78,22 +78,13 @@ WERROR NetLocalGroupAdd_r(struct libnetapi_ctx *ctx, goto done; } - status = rpccli_try_samr_connects(pipe_cli, ctx, - SAMR_ACCESS_OPEN_DOMAIN | - SAMR_ACCESS_ENUM_DOMAINS, - &connect_handle); - if (!NT_STATUS_IS_OK(status)) { - werr = ntstatus_to_werror(status); - goto done; - } - - status = rpccli_samr_OpenDomain(pipe_cli, ctx, - &connect_handle, - SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT, - CONST_DISCARD(DOM_SID *, &global_sid_Builtin), - &builtin_handle); - if (!NT_STATUS_IS_OK(status)) { - werr = ntstatus_to_werror(status); + werr = libnetapi_samr_open_builtin_domain(ctx, pipe_cli, + SAMR_ACCESS_OPEN_DOMAIN | + SAMR_ACCESS_ENUM_DOMAINS, + SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT, + &connect_handle, + &builtin_handle); + if (!W_ERROR_IS_OK(werr)) { goto done; } @@ -226,22 +217,13 @@ WERROR NetLocalGroupDel_r(struct libnetapi_ctx *ctx, goto done; } - status = rpccli_try_samr_connects(pipe_cli, ctx, - SAMR_ACCESS_OPEN_DOMAIN | - SAMR_ACCESS_ENUM_DOMAINS, - &connect_handle); - if (!NT_STATUS_IS_OK(status)) { - werr = ntstatus_to_werror(status); - goto done; - } - - status = rpccli_samr_OpenDomain(pipe_cli, ctx, - &connect_handle, - SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT, - CONST_DISCARD(DOM_SID *, &global_sid_Builtin), - &builtin_handle); - if (!NT_STATUS_IS_OK(status)) { - werr = ntstatus_to_werror(status); + werr = libnetapi_samr_open_builtin_domain(ctx, pipe_cli, + SAMR_ACCESS_OPEN_DOMAIN | + SAMR_ACCESS_ENUM_DOMAINS, + SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT, + &connect_handle, + &builtin_handle); + if (!W_ERROR_IS_OK(werr)) { goto done; } @@ -429,22 +411,13 @@ WERROR NetLocalGroupGetInfo_r(struct libnetapi_ctx *ctx, goto done; } - status = rpccli_try_samr_connects(pipe_cli, ctx, - SAMR_ACCESS_OPEN_DOMAIN | - SAMR_ACCESS_ENUM_DOMAINS, - &connect_handle); - if (!NT_STATUS_IS_OK(status)) { - werr = ntstatus_to_werror(status); - goto done; - } - - status = rpccli_samr_OpenDomain(pipe_cli, ctx, - &connect_handle, - SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT, - CONST_DISCARD(DOM_SID *, &global_sid_Builtin), - &builtin_handle); - if (!NT_STATUS_IS_OK(status)) { - werr = ntstatus_to_werror(status); + werr = libnetapi_samr_open_builtin_domain(ctx, pipe_cli, + SAMR_ACCESS_OPEN_DOMAIN | + SAMR_ACCESS_ENUM_DOMAINS, + SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT, + &connect_handle, + &builtin_handle); + if (!W_ERROR_IS_OK(werr)) { goto done; } @@ -634,22 +607,13 @@ WERROR NetLocalGroupSetInfo_r(struct libnetapi_ctx *ctx, goto done; } - status = rpccli_try_samr_connects(pipe_cli, ctx, - SAMR_ACCESS_OPEN_DOMAIN | - SAMR_ACCESS_ENUM_DOMAINS, - &connect_handle); - if (!NT_STATUS_IS_OK(status)) { - werr = ntstatus_to_werror(status); - goto done; - } - - status = rpccli_samr_OpenDomain(pipe_cli, ctx, - &connect_handle, - SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT, - CONST_DISCARD(DOM_SID *, &global_sid_Builtin), - &builtin_handle); - if (!NT_STATUS_IS_OK(status)) { - werr = ntstatus_to_werror(status); + werr = libnetapi_samr_open_builtin_domain(ctx, pipe_cli, + SAMR_ACCESS_OPEN_DOMAIN | + SAMR_ACCESS_ENUM_DOMAINS, + SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT, + &connect_handle, + &builtin_handle); + if (!W_ERROR_IS_OK(werr)) { goto done; } |