summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_lsarpc.c8
-rw-r--r--source3/rpc_client/cli_reg.c10
-rw-r--r--source3/rpc_client/cli_samr.c10
3 files changed, 15 insertions, 13 deletions
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c
index 4c55572b62..21eba6ddb7 100644
--- a/source3/rpc_client/cli_lsarpc.c
+++ b/source3/rpc_client/cli_lsarpc.c
@@ -331,8 +331,8 @@ BOOL lsa_lookup_sids(struct cli_state *cli, uint16 fnum,
if (dom_idx != 0xffffffff)
{
- fstrcpy(dom_name, unistr2_to_str(&ref.ref_dom[dom_idx].uni_dom_name));
- fstrcpy(name , unistr2_to_str(&t_names.uni_name[i]));
+ unistr2_to_ascii(dom_name, &ref.ref_dom[dom_idx].uni_dom_name, sizeof(dom_name));
+ unistr2_to_ascii(name, &t_names.uni_name[i], sizeof(name));
memset(full_name, 0, sizeof(full_name));
@@ -427,7 +427,7 @@ BOOL lsa_query_info_pol(struct cli_state *cli, uint16 fnum,
{
if (r_q.dom.id3.buffer_dom_name != 0)
{
- fstrcpy(domain_name, unistr2_to_str(&r_q.dom.id3.uni_domain_name));
+ unistr2_to_ascii(domain_name, &r_q.dom.id3.uni_domain_name, sizeof(domain_name));
}
if (r_q.dom.id3.buffer_dom_sid != 0)
{
@@ -441,7 +441,7 @@ BOOL lsa_query_info_pol(struct cli_state *cli, uint16 fnum,
{
if (r_q.dom.id5.buffer_dom_name != 0)
{
- fstrcpy(domain_name, unistr2_to_str(&r_q.dom.id5.uni_domain_name));
+ unistr2_to_ascii(domain_name, &r_q.dom.id5.uni_domain_name, sizeof(domain_name));
}
if (r_q.dom.id5.buffer_dom_sid != 0)
{
diff --git a/source3/rpc_client/cli_reg.c b/source3/rpc_client/cli_reg.c
index b3d2f6e864..6fe48599d5 100644
--- a/source3/rpc_client/cli_reg.c
+++ b/source3/rpc_client/cli_reg.c
@@ -306,7 +306,7 @@ BOOL do_reg_query_key(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd,
valid_query = True;
*class_len = r_o.hdr_class.uni_max_len;
- fstrcpy(class, unistr2_to_str(&r_o.uni_class));
+ unistr2_to_ascii(class, &r_o.uni_class, sizeof(class));
*num_subkeys = r_o.num_subkeys ;
*max_subkeylen = r_o.max_subkeylen ;
*max_subkeysize = r_o.max_subkeysize;
@@ -425,7 +425,8 @@ BOOL do_reg_query_info(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd,
if (p)
{
valid_query = True;
- fstrcpy(type, buffer2_to_str(&r_o.uni_type));
+ unistr_to_ascii(type, r_o.uni_type.buffer,
+ MIN(r_o.uni_type.buf_len, sizeof(type)));
(*unk_0) = r_o.unknown_0;
(*unk_1) = r_o.unknown_1;
}
@@ -786,7 +787,8 @@ BOOL do_reg_enum_key(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd,
valid_query = True;
(*unk_1) = r_o.unknown_1;
(*unk_2) = r_o.unknown_2;
- fstrcpy(key_name, unistr2(r_o.key_name.str.buffer));
+ unistr_to_ascii(key_name, r_o.key_name.str.buffer,
+ sizeof(key_name));
(*mod_time) = nt_time_to_unix(&r_o.time);
}
}
@@ -902,7 +904,7 @@ BOOL do_reg_enum_val(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd,
{
valid_query = True;
(*val_type) = r_o.type;
- fstrcpy(val_name, unistr2_to_str(&r_o.uni_name));
+ unistr2_to_ascii(val_name, &r_o.uni_name, sizeof(val_name));
}
}
diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c
index f97a38b718..2ddc0877a9 100644
--- a/source3/rpc_client/cli_samr.c
+++ b/source3/rpc_client/cli_samr.c
@@ -585,12 +585,12 @@ BOOL samr_enum_dom_groups(struct cli_state *cli, uint16 fnum,
(*sam)[i].acct_desc[0] = 0;
if (r_e.sam[i].hdr_grp_name.buffer)
{
- fstrcpy((*sam)[i].acct_name, unistr2_to_str(&r_e.str[name_idx].uni_grp_name));
+ unistr2_to_ascii((*sam)[i].acct_name, &r_e.str[name_idx].uni_grp_name, sizeof((*sam)[i].acct_name));
name_idx++;
}
if (r_e.sam[i].hdr_grp_desc.buffer)
{
- fstrcpy((*sam)[i].acct_desc, unistr2_to_str(&r_e.str[desc_idx].uni_grp_desc));
+ unistr2_to_ascii((*sam)[i].acct_desc, &r_e.str[name_idx].uni_grp_desc, sizeof((*sam)[i].acct_desc));
desc_idx++;
}
DEBUG(5,("samr_enum_dom_groups: idx: %4d rid: %8x acct: %s desc: %s\n",
@@ -678,7 +678,7 @@ BOOL samr_enum_dom_aliases(struct cli_state *cli, uint16 fnum,
(*sam)[i].acct_desc[0] = 0;
if (r_e.sam[i].hdr_name.buffer)
{
- fstrcpy((*sam)[i].acct_name, unistr2_to_str(&r_e.uni_grp_name[name_idx]));
+ unistr2_to_ascii((*sam)[i].acct_name, &r_e.uni_grp_name[name_idx], sizeof((*sam)[i].acct_name));
name_idx++;
}
DEBUG(5,("samr_enum_dom_aliases: idx: %4d rid: %8x acct: %s\n",
@@ -767,7 +767,7 @@ BOOL samr_enum_dom_users(struct cli_state *cli, uint16 fnum,
(*sam)[i].acct_desc[0] = 0;
if (r_e.sam[i].hdr_name.buffer)
{
- fstrcpy((*sam)[i].acct_name, unistr2_to_str(&r_e.uni_acct_name[name_idx]));
+ unistr2_to_ascii((*sam)[i].acct_name, &r_e.uni_acct_name[name_idx], sizeof((*sam)[i].acct_name));
name_idx++;
}
DEBUG(5,("samr_enum_dom_users: idx: %4d rid: %8x acct: %s\n",
@@ -1774,7 +1774,7 @@ BOOL samr_query_lookup_rids(struct cli_state *cli, uint16 fnum,
for (i = 0; i < r_o.num_names1; i++)
{
- fstrcpy(names[i], unistr2_to_str(&r_o.uni_name[i]));
+ unistr2_to_ascii(names[i], &r_o.uni_name[i], sizeof(names[i]));
}
for (i = 0; i < r_o.num_types1; i++)
{