summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-12-04 21:48:06 +0000
committerLuke Leighton <lkcl@samba.org>1998-12-04 21:48:06 +0000
commit89c56492a86fb02b2045182490b93f17a475f03d (patch)
treea05232c9a4e77b8ec2148abd0758f86503861429 /source3/rpcclient
parentcf0ea874b1a7cb1dcaaea159d9a4a8a5deae1310 (diff)
downloadsamba-89c56492a86fb02b2045182490b93f17a475f03d.tar.gz
samba-89c56492a86fb02b2045182490b93f17a475f03d.tar.bz2
samba-89c56492a86fb02b2045182490b93f17a475f03d.zip
- oops, i got "add alias member" and "delete alias member" swapped.
- samr_enum_dom_users, the first 4 bytes is some sort of garbage, nt5-beta2 clears them out to zeros whereas nt4 does not. fixed bug where we were assuming that the first 4 bytes of a response _had_ to be non-zero. - cli_lsarpc.c: forgot to append the rid on the lsa_lookup_names() client call. - added in "addaliasmem" and "addgroupmem" commands. the addaliasmem command actually turned out to be a "delaliasmem" :-) :-) - parse_lsa.c: moved assert array check to after the size of useable array space is set... (This used to be commit 165b15a8cacc4bc7cf8cc0b9aaabb6b92cef7fdb)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_samr.c24
-rw-r--r--source3/rpcclient/rpcclient.c2
2 files changed, 14 insertions, 12 deletions
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index 13e0829613..ae3ef548c6 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -208,9 +208,9 @@ void cmd_sam_add_aliasmem(struct client_info *info)
fprintf(out_hnd, "addaliasmem: <alias rid> [member sid1] [member sid2] ...\n");
return;
}
- alias_rid = strtoul(tmp, (char**)NULL, 10);
+ alias_rid = get_number(tmp);
- fprintf(out_hnd, "SAM Create Domain Alias\n");
+ fprintf(out_hnd, "SAM Domain Alias Member\n");
/* open SAMR session. negotiate credentials */
res = res ? cli_nt_session_open(smb_cli, PIPE_SAMR) : False;
@@ -385,9 +385,9 @@ void cmd_sam_add_groupmem(struct client_info *info)
fprintf(out_hnd, "addgroupmem: <group rid> [member rid1] [member rid2] ...\n");
return;
}
- group_rid = strtoul(tmp, (char**)NULL, 10);
+ group_rid = get_number(tmp);
- fprintf(out_hnd, "SAM Create Domain Group\n");
+ fprintf(out_hnd, "SAM Add Domain Group member\n");
/* open SAMR session. negotiate credentials */
res = res ? cli_nt_session_open(smb_cli, PIPE_SAMR) : False;
@@ -959,7 +959,7 @@ void cmd_sam_enum_aliases(struct client_info *info)
DOM_SID sid1;
BOOL res = True;
BOOL request_member_info = False;
- uint32 flags = 0x304; /* absolutely no idea. */
+ uint32 flags = 0x200003f3; /* absolutely no idea. */
fstring tmp;
uint32 alias_idx;
@@ -1049,15 +1049,15 @@ void cmd_sam_enum_aliases(struct client_info *info)
uint16 old_fnum = smb_cli->nt_pipe_fnum;
if (num_aliases != 0)
- {
+ {
sids = malloc(num_aliases * sizeof(DOM_SID*));
- }
+ }
res3 = sids != NULL;
if (res3)
- {
+ {
for (i = 0; i < num_aliases; i++)
- {
+ {
sids[i] = &sid_mem[i].sid;
}
}
@@ -1083,7 +1083,7 @@ void cmd_sam_enum_aliases(struct client_info *info)
smb_cli->nt_pipe_fnum = old_fnum;
if (res4 && names != NULL)
- {
+ {
display_alias_members(out_hnd, ACTION_HEADER , num_names, names);
display_alias_members(out_hnd, ACTION_ENUMERATE, num_names, names);
display_alias_members(out_hnd, ACTION_FOOTER , num_names, names);
@@ -1104,8 +1104,8 @@ void cmd_sam_enum_aliases(struct client_info *info)
free(sids);
}
}
- }
- }
+ }
+ }
res = res ? samr_close(smb_cli,
&info->dom.samr_pol_connect) : False;
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 68b7356e53..400faffef4 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -124,6 +124,8 @@ struct
{"lookupsids", cmd_lsa_lookup_sids, "Resolve names from SIDs"},
{"lookupnames",cmd_lsa_lookup_names, "Resolve SIDs from names"},
{"enumusers", cmd_sam_enum_users, "SAM User Database Query (experimental!)"},
+ {"addgroupmem",cmd_sam_add_groupmem,"<group rid> [member rid1] [member rid2] ... SAM Add Domain Group Member"},
+ {"addaliasmem",cmd_sam_add_aliasmem,"<alias rid> [member sid1] [member sid2] ... SAM Add Domain Alias Member"},
{"creategroup",cmd_sam_create_dom_group,"SAM Create Domain Group"},
{"createalias",cmd_sam_create_dom_alias,"SAM Create Domain Alias"},
{"ntpass", cmd_sam_ntchange_pwd, "NT SAM Password Change"},