From eae9b12ca56837a2a39c1ebad21eee7e502b579b Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sat, 30 Oct 1999 20:32:40 +0000 Subject: general, drastic improvements to rpcclient. added samgroup command added samgroupmem 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) --- source3/rpc_client/cli_samr.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'source3/rpc_client/cli_samr.c') 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]; -- cgit