summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-10-30 20:32:40 +0000
committerLuke Leighton <lkcl@samba.org>1999-10-30 20:32:40 +0000
commiteae9b12ca56837a2a39c1ebad21eee7e502b579b (patch)
treea9ebc48e4a0f62d5fab67fc65d663dfea940b5f5 /source3/rpc_client
parent431d0dca732108c817e4f3fecfb4c28641383642 (diff)
downloadsamba-eae9b12ca56837a2a39c1ebad21eee7e502b579b.tar.gz
samba-eae9b12ca56837a2a39c1ebad21eee7e502b579b.tar.bz2
samba-eae9b12ca56837a2a39c1ebad21eee7e502b579b.zip
general, drastic improvements to rpcclient.
added samgroup <groupname> command added samgroupmem <groupname> command added proper registry key completion added sam command user-completion (e.g samuser [tab]) added sam command group-completion (e.g samgroup [tab]) (This used to be commit bc5d021916a2f070c62011870a80b3b2707aff3b)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_samr.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c
index ccf76eb943..16925b0806 100644
--- a/source3/rpc_client/cli_samr.c
+++ b/source3/rpc_client/cli_samr.c
@@ -1903,7 +1903,7 @@ BOOL samr_query_lookup_names(struct cli_state *cli, uint16 fnum,
{
/* report error code */
DEBUG(4,("SAMR_R_LOOKUP_NAMES: %s\n", get_nt_error_msg(r_o.status)));
- p = False;
+ p = r_o.status == 0x107;
}
if (p)
@@ -1998,19 +1998,23 @@ BOOL samr_query_lookup_rids(struct cli_state *cli, uint16 fnum,
r_o.num_types1 == r_o.num_names1)
{
uint32 i;
-
valid_query = True;
- *num_names = r_o.num_names1;
- (*names) = (char**)malloc((*num_names) * sizeof(**names));
- for (i = 0; (*names) != NULL && i < r_o.num_names1; i++)
+ (*num_names) = 0;
+ (*names) = NULL;
+
+ for (i = 0; i < r_o.num_names1; i++)
{
fstring tmp;
unistr2_to_ascii(tmp, &r_o.uni_name[i], sizeof(tmp)-1);
- (*names)[i] = strdup(tmp);
+ add_chars_to_array(num_names, names, tmp);
+ }
+
+ if ((*num_names) != 0)
+ {
+ (*type) = (uint32*)malloc((*num_names) * sizeof(**type));
}
- (*type) = (uint32*)malloc((*num_names) * sizeof(**type));
for (i = 0; (*type) != NULL && i < r_o.num_types1; i++)
{
(*type)[i] = r_o.type[i];