summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-01 13:42:28 +0100
committerGünther Deschner <gd@samba.org>2008-02-01 16:29:20 +0100
commitcc1350a3532f600e5710052138f58476a0a0ae03 (patch)
tree6b0b45d5478839e0fe2e1fb154011b8807851a87
parent6e74a5dba33f8be671fddce367ef341c9c2fe6bc (diff)
downloadsamba-cc1350a3532f600e5710052138f58476a0a0ae03.tar.gz
samba-cc1350a3532f600e5710052138f58476a0a0ae03.tar.bz2
samba-cc1350a3532f600e5710052138f58476a0a0ae03.zip
Use rpccli_samr_CreateDomainGroup() in net and rpcclient.
Guenther (This used to be commit 7b7b10adcaa94de3fed9b5e925eeee714ffd1c50)
-rw-r--r--source3/rpcclient/cmd_samr.c27
-rw-r--r--source3/utils/net_rpc.c18
2 files changed, 30 insertions, 15 deletions
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index 7184023082..f77a5d8891 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -1554,6 +1554,11 @@ 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,
@@ -1562,16 +1567,17 @@ static NTSTATUS cmd_samr_create_dom_group(struct rpc_pipe_client *cli,
{
POLICY_HND connect_pol, domain_pol, group_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- const char *grp_name;
+ struct lsa_String grp_name;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
+ uint32_t rid = 0;
if ((argc < 2) || (argc > 3)) {
printf("Usage: %s groupname [access mask]\n", argv[0]);
return NT_STATUS_OK;
}
- grp_name = argv[1];
-
+ init_lsa_String(&grp_name, argv[1]);
+
if (argc > 2)
sscanf(argv[2], "%x", &access_mask);
@@ -1595,10 +1601,12 @@ static NTSTATUS cmd_samr_create_dom_group(struct rpc_pipe_client *cli,
goto done;
/* Create domain user */
-
- result = rpccli_samr_create_dom_group(cli, mem_ctx, &domain_pol,
- grp_name, MAXIMUM_ALLOWED_ACCESS,
- &group_pol);
+ result = rpccli_samr_CreateDomainGroup(cli, mem_ctx,
+ &domain_pol,
+ &grp_name,
+ MAXIMUM_ALLOWED_ACCESS,
+ &group_pol,
+ &rid);
if (!NT_STATUS_IS_OK(result))
goto done;
@@ -2141,11 +2149,6 @@ static NTSTATUS cmd_samr_get_usrdom_pwinfo(struct rpc_pipe_client *cli,
return result;
}
-static void init_lsa_String(struct lsa_String *name, const char *s)
-{
- name->string = s;
-}
-
static NTSTATUS cmd_samr_get_dom_pwinfo(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 5ed56ba1bd..50f3310d96 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -1935,6 +1935,11 @@ static int rpc_group_delete(int argc, const char **argv)
argc,argv);
}
+static void init_lsa_String(struct lsa_String *name, const char *s)
+{
+ name->string = s;
+}
+
static NTSTATUS rpc_group_add_internals(const DOM_SID *domain_sid,
const char *domain_name,
struct cli_state *cli,
@@ -1946,6 +1951,8 @@ static NTSTATUS rpc_group_add_internals(const DOM_SID *domain_sid,
POLICY_HND connect_pol, domain_pol, group_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
GROUP_INFO_CTR group_info;
+ struct lsa_String grp_name;
+ uint32_t rid = 0;
if (argc != 1) {
d_printf("Group name must be specified\n");
@@ -1953,6 +1960,8 @@ static NTSTATUS rpc_group_add_internals(const DOM_SID *domain_sid,
return NT_STATUS_OK;
}
+ init_lsa_String(&grp_name, argv[0]);
+
/* Get sam policy handle */
result = rpccli_samr_connect(pipe_hnd, mem_ctx, MAXIMUM_ALLOWED_ACCESS,
@@ -1970,9 +1979,12 @@ static NTSTATUS rpc_group_add_internals(const DOM_SID *domain_sid,
/* Create the group */
- result = rpccli_samr_create_dom_group(pipe_hnd, mem_ctx, &domain_pol,
- argv[0], MAXIMUM_ALLOWED_ACCESS,
- &group_pol);
+ result = rpccli_samr_CreateDomainGroup(pipe_hnd, mem_ctx,
+ &domain_pol,
+ &grp_name,
+ MAXIMUM_ALLOWED_ACCESS,
+ &group_pol,
+ &rid);
if (!NT_STATUS_IS_OK(result)) goto done;
if (strlen(opt_comment) == 0) goto done;