summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2011-01-18 11:57:33 +0100
committerGünther Deschner <gd@samba.org>2011-02-01 23:29:14 +0100
commit84e3d14f7a1cc9a0d03235a95a2813cb54947ded (patch)
treed78b2885534f5e3ad25c09d9439103c63e8511b8
parentb9b2325f4566423f67b93309b47401d992257c38 (diff)
downloadsamba-84e3d14f7a1cc9a0d03235a95a2813cb54947ded.tar.gz
samba-84e3d14f7a1cc9a0d03235a95a2813cb54947ded.tar.bz2
samba-84e3d14f7a1cc9a0d03235a95a2813cb54947ded.zip
s3-net: prefer dcerpc_samr_X functions in rpc_del_aliasmem.
Guenther
-rw-r--r--source3/utils/net_rpc.c48
1 files changed, 34 insertions, 14 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index cc3eab6543..7bdf8796db 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -2335,9 +2335,10 @@ static NTSTATUS rpc_del_aliasmem(struct rpc_pipe_client *pipe_hnd,
const char *member)
{
struct policy_handle connect_pol, domain_pol;
- NTSTATUS result;
+ NTSTATUS status, result;
uint32 alias_rid;
struct policy_handle alias_pol;
+ struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
struct dom_sid member_sid;
enum lsa_SidType member_type;
@@ -2359,43 +2360,62 @@ static NTSTATUS rpc_del_aliasmem(struct rpc_pipe_client *pipe_hnd,
}
/* Get sam policy handle */
- result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
+ status = dcerpc_samr_Connect2(b, mem_ctx,
pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
- &connect_pol);
+ &connect_pol,
+ &result);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto done;
+ }
if (!NT_STATUS_IS_OK(result)) {
+ status = result;
goto done;
}
/* Get domain policy handle */
- result = rpccli_samr_OpenDomain(pipe_hnd, mem_ctx,
+ status = dcerpc_samr_OpenDomain(b, mem_ctx,
&connect_pol,
MAXIMUM_ALLOWED_ACCESS,
&sid,
- &domain_pol);
+ &domain_pol,
+ &result);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto done;
+ }
if (!NT_STATUS_IS_OK(result)) {
+ status = result;
goto done;
}
- result = rpccli_samr_OpenAlias(pipe_hnd, mem_ctx,
+ status = dcerpc_samr_OpenAlias(b, mem_ctx,
&domain_pol,
MAXIMUM_ALLOWED_ACCESS,
alias_rid,
- &alias_pol);
+ &alias_pol,
+ &result);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
- if (!NT_STATUS_IS_OK(result))
+ if (!NT_STATUS_IS_OK(result)) {
return result;
+ }
- result = rpccli_samr_DeleteAliasMember(pipe_hnd, mem_ctx,
+ status = dcerpc_samr_DeleteAliasMember(b, mem_ctx,
&alias_pol,
- &member_sid);
+ &member_sid,
+ &result);
- if (!NT_STATUS_IS_OK(result))
- return result;
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ status = result;
done:
- rpccli_samr_Close(pipe_hnd, mem_ctx, &connect_pol);
- return result;
+ dcerpc_samr_Close(b, mem_ctx, &connect_pol, &result);
+ return status;
}
static NTSTATUS rpc_group_delmem_internals(struct net_context *c,