mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
UNICODE cleanup (see lib/util_unistr.c).
No more ugly static library buffers and all functions take a destination
string length (especially unistrcpy was rather dangerous; we were only
saved by the fact that datagrams are limited in size).
(This used to be commit a1d39af1ce
)
This commit is contained in:
@ -1440,7 +1440,7 @@ static void samr_reply_lookup_names(SAMR_Q_LOOKUP_NAMES *q_u,
|
||||
{
|
||||
DOM_SID sid;
|
||||
fstring name;
|
||||
fstrcpy(name, unistr2_to_str(&q_u->uni_name[i]));
|
||||
unistr2_to_ascii(name, &q_u->uni_name[i], sizeof(name));
|
||||
|
||||
status = lookup_name(name, &sid, &(type[i]));
|
||||
if (status == 0x0)
|
||||
@ -1489,8 +1489,8 @@ static void samr_reply_chgpasswd_user(SAMR_Q_CHGPASSWD_USER *q_u,
|
||||
fstring user_name;
|
||||
fstring wks;
|
||||
|
||||
fstrcpy(user_name, unistr2_to_str(&q_u->uni_user_name));
|
||||
fstrcpy(wks , unistr2_to_str(&q_u->uni_dest_host));
|
||||
unistr2_to_ascii(user_name, &q_u->uni_user_name, sizeof(user_name));
|
||||
unistr2_to_ascii(wks, &q_u->uni_dest_host, sizeof(wks));
|
||||
|
||||
DEBUG(5,("samr_chgpasswd_user: user: %s wks: %s\n", user_name, wks));
|
||||
|
||||
@ -2024,7 +2024,7 @@ static void samr_reply_create_dom_alias(SAMR_Q_CREATE_DOM_ALIAS *q_u,
|
||||
|
||||
if (status == 0x0)
|
||||
{
|
||||
fstrcpy(grp.name, unistr2_to_str(&q_u->uni_acct_desc));
|
||||
unistr2_to_ascii(grp.name, &q_u->uni_acct_desc, sizeof(grp.name));
|
||||
fstrcpy(grp.comment, "");
|
||||
grp.rid = 0xffffffff;
|
||||
|
||||
@ -2135,7 +2135,7 @@ static void samr_reply_create_dom_group(SAMR_Q_CREATE_DOM_GROUP *q_u,
|
||||
|
||||
if (status == 0x0)
|
||||
{
|
||||
fstrcpy(grp.name, unistr2_to_str(&q_u->uni_acct_desc));
|
||||
unistr2_to_ascii(grp.name, &q_u->uni_acct_desc, sizeof(grp.name));
|
||||
fstrcpy(grp.comment, "");
|
||||
grp.rid = 0xffffffff;
|
||||
grp.attr = 0x07;
|
||||
@ -2302,7 +2302,7 @@ static void api_samr_unknown_32( uint16 vuid, prs_struct *data, prs_struct *rdat
|
||||
reply if the account already exists...
|
||||
*/
|
||||
|
||||
fstrcpy(mach_acct, unistr2_to_str(&q_u.uni_mach_acct));
|
||||
unistr2_to_ascii(mach_acct, &q_u.uni_mach_acct, sizeof(mach_acct));
|
||||
|
||||
become_root(True);
|
||||
sam_pass = getsam21pwntnam(mach_acct);
|
||||
|
Reference in New Issue
Block a user