summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_samr_nt.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-01-17 04:58:45 +0000
committerAndrew Tridgell <tridge@samba.org>2003-01-17 04:58:45 +0000
commitec879eacc263043409b584797d1e8c39258ba125 (patch)
tree7a7775040b27f7fea0f7bd1c8f0ede91c9ce770d /source3/rpc_server/srv_samr_nt.c
parentba51d1d888f98e196627486490e8569faeb641c2 (diff)
downloadsamba-ec879eacc263043409b584797d1e8c39258ba125.tar.gz
samba-ec879eacc263043409b584797d1e8c39258ba125.tar.bz2
samba-ec879eacc263043409b584797d1e8c39258ba125.zip
This removes the 3rd argument from init_unistr2(). There were 240
calls to init_unistr2() in the code and every one of them got the 3rd argument incorrect, so I thought it best just to remove the argument. The incorrect usage was caused by callers using strlen() to determine the length of the string. The 3rd argument to init_unistr2() was supposed to be the character length, not the byte length of the string, so for non-english this could come out wrong. I also removed the bogus 'always allocate at least 256 bytes' hack. There may be some code that relies on this, but if there is then the code is broken and needs fixing. (This used to be commit b9eff31b1433c81fbff733e194914a40f25e3bda)
Diffstat (limited to 'source3/rpc_server/srv_samr_nt.c')
-rw-r--r--source3/rpc_server/srv_samr_nt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 2896fd79e4..74361fd931 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -717,7 +717,7 @@ static NTSTATUS make_user_sam_entry_list(TALLOC_CTX *ctx, SAM_ENTRY **sam_pp, UN
for (i = 0; i < num_entries; i++) {
pwd = disp_user_info[i+start_idx].sam;
temp_name = pdb_get_username(pwd);
- init_unistr2(&uni_temp_name, temp_name, strlen(temp_name)+1);
+ init_unistr2(&uni_temp_name, temp_name);
user_sid = pdb_get_user_sid(pwd);
if (!sid_peek_check_rid(domain_sid, user_sid, &user_rid)) {
@@ -866,7 +866,7 @@ static void make_group_sam_entry_list(TALLOC_CTX *ctx, SAM_ENTRY **sam_pp, UNIST
int len = strlen(grp[i].name)+1;
init_sam_entry(&sam[i], len, grp[i].rid);
- init_unistr2(&uni_name[i], grp[i].name, len);
+ init_unistr2(&uni_name[i], grp[i].name);
}
*sam_pp = sam;
@@ -1574,7 +1574,7 @@ static BOOL make_samr_lookup_rids(TALLOC_CTX *ctx, uint32 num_names, fstring nam
int len = names[i] != NULL ? strlen(names[i]) : 0;
DEBUG(10, ("names[%d]:%s\n", i, names[i]));
init_uni_hdr(&hdr_name[i], len);
- init_unistr2(&uni_name[i], names[i], len);
+ init_unistr2(&uni_name[i], names[i]);
}
*pp_uni_name = uni_name;
@@ -2555,7 +2555,7 @@ static BOOL make_enum_domains(TALLOC_CTX *ctx, SAM_ENTRY **pp_sam,
int len = doms[i] != NULL ? strlen(doms[i]) : 0;
init_sam_entry(&sam[i], len, 0);
- init_unistr2(&uni_name[i], doms[i], len);
+ init_unistr2(&uni_name[i], doms[i]);
}
*pp_sam = sam;