diff options
author | Günther Deschner <gd@samba.org> | 2008-02-01 13:48:19 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-02-01 16:29:20 +0100 |
commit | 99ebfd810fb725e8449fb6ef82e074fb072e27cf (patch) | |
tree | 5c0490c218e67d88564cd0b4822bdf6ec0b696d1 | |
parent | 3e67d648a1d164b67cf390ae33e83fc9362e3179 (diff) | |
download | samba-99ebfd810fb725e8449fb6ef82e074fb072e27cf.tar.gz samba-99ebfd810fb725e8449fb6ef82e074fb072e27cf.tar.bz2 samba-99ebfd810fb725e8449fb6ef82e074fb072e27cf.zip |
Use rpccli_samr_CreateDomAlias() in net and rpcclient.
Guenther
(This used to be commit 1248ec89d2d9a400f892f828126ce4e862de642f)
-rw-r--r-- | source3/rpcclient/cmd_samr.c | 15 | ||||
-rw-r--r-- | source3/utils/net_rpc.c | 12 |
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; |