summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-01 14:21:54 +0100
committerGünther Deschner <gd@samba.org>2008-02-01 16:29:20 +0100
commitddbe4ea6b79b511927d4d130cb345b873b12cc0e (patch)
tree7f8eab64473c0c26706bd5537d0367a124d4b1f9 /source3/rpcclient
parentf0438acfda7ae28a68d20be3cd05cdaeff9ac82b (diff)
downloadsamba-ddbe4ea6b79b511927d4d130cb345b873b12cc0e.tar.gz
samba-ddbe4ea6b79b511927d4d130cb345b873b12cc0e.tar.bz2
samba-ddbe4ea6b79b511927d4d130cb345b873b12cc0e.zip
Use rpccli_samr_CreateUser2() all over the place.
Guenther (This used to be commit 701af69118c9634c7dc0d5c10152ce776787694d)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_samr.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index f77a5d8891..976bc86d9b 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -26,6 +26,11 @@
extern DOM_SID domain_sid;
+static void init_lsa_String(struct lsa_String *name, const char *s)
+{
+ name->string = s;
+}
+
/****************************************************************************
display sam_user_info_7 structure
****************************************************************************/
@@ -1491,17 +1496,18 @@ static NTSTATUS cmd_samr_create_dom_user(struct rpc_pipe_client *cli,
{
POLICY_HND connect_pol, domain_pol, user_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- const char *acct_name;
+ struct lsa_String acct_name;
uint32 acb_info;
uint32 acct_flags, user_rid;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
+ uint32_t access_granted = 0;
if ((argc < 2) || (argc > 3)) {
printf("Usage: %s username [access mask]\n", argv[0]);
return NT_STATUS_OK;
}
- acct_name = argv[1];
+ init_lsa_String(&acct_name, argv[1]);
if (argc > 2)
sscanf(argv[2], "%x", &access_mask);
@@ -1534,9 +1540,14 @@ static NTSTATUS cmd_samr_create_dom_user(struct rpc_pipe_client *cli,
SAMR_USER_ACCESS_GET_ATTRIBUTES |
SAMR_USER_ACCESS_SET_ATTRIBUTES;
- result = rpccli_samr_create_dom_user(cli, mem_ctx, &domain_pol,
- acct_name, acb_info, acct_flags,
- &user_pol, &user_rid);
+ result = rpccli_samr_CreateUser2(cli, mem_ctx,
+ &domain_pol,
+ &acct_name,
+ acb_info,
+ acct_flags,
+ &user_pol,
+ &access_granted,
+ &user_rid);
if (!NT_STATUS_IS_OK(result))
goto done;
@@ -1554,11 +1565,6 @@ static NTSTATUS cmd_samr_create_dom_user(struct rpc_pipe_client *cli,
return result;
}
-static void init_lsa_String(struct lsa_String *name, const char *s)
-{
- name->string = s;
-}
-
/* Create domain group */
static NTSTATUS cmd_samr_create_dom_group(struct rpc_pipe_client *cli,