summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/rpcclient/cmd_samr.c15
-rw-r--r--source3/utils/net_rpc.c12
2 files changed, 20 insertions, 7 deletions
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index 93aca9f15f..7184023082 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -1624,16 +1624,17 @@ static NTSTATUS cmd_samr_create_dom_alias(struct rpc_pipe_client *cli,
{
POLICY_HND connect_pol, domain_pol, alias_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- const char *alias_name;
+ struct lsa_String alias_name;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
+ uint32_t rid = 0;
if ((argc < 2) || (argc > 3)) {
printf("Usage: %s aliasname [access mask]\n", argv[0]);
return NT_STATUS_OK;
}
- alias_name = argv[1];
-
+ init_lsa_String(&alias_name, argv[1]);
+
if (argc > 2)
sscanf(argv[2], "%x", &access_mask);
@@ -1658,8 +1659,12 @@ static NTSTATUS cmd_samr_create_dom_alias(struct rpc_pipe_client *cli,
/* Create domain user */
- result = rpccli_samr_create_dom_alias(cli, mem_ctx, &domain_pol,
- alias_name, &alias_pol);
+ result = rpccli_samr_CreateDomAlias(cli, mem_ctx,
+ &domain_pol,
+ &alias_name,
+ MAXIMUM_ALLOWED_ACCESS,
+ &alias_pol,
+ &rid);
if (!NT_STATUS_IS_OK(result))
goto done;
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index eb21741a95..5ed56ba1bd 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -2005,6 +2005,8 @@ static NTSTATUS rpc_alias_add_internals(const DOM_SID *domain_sid,
POLICY_HND connect_pol, domain_pol, alias_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
ALIAS_INFO_CTR alias_info;
+ struct lsa_String alias_name;
+ uint32_t rid = 0;
if (argc != 1) {
d_printf("Alias name must be specified\n");
@@ -2012,6 +2014,8 @@ static NTSTATUS rpc_alias_add_internals(const DOM_SID *domain_sid,
return NT_STATUS_OK;
}
+ init_lsa_String(&alias_name, argv[0]);
+
/* Get sam policy handle */
result = rpccli_samr_connect(pipe_hnd, mem_ctx, MAXIMUM_ALLOWED_ACCESS,
@@ -2029,8 +2033,12 @@ static NTSTATUS rpc_alias_add_internals(const DOM_SID *domain_sid,
/* Create the group */
- result = rpccli_samr_create_dom_alias(pipe_hnd, mem_ctx, &domain_pol,
- argv[0], &alias_pol);
+ result = rpccli_samr_CreateDomAlias(pipe_hnd, mem_ctx,
+ &domain_pol,
+ &alias_name,
+ MAXIMUM_ALLOWED_ACCESS,
+ &alias_pol,
+ &rid);
if (!NT_STATUS_IS_OK(result)) goto done;
if (strlen(opt_comment) == 0) goto done;