summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>2000-03-06 23:30:03 +0000
committerLuke Leighton <lkcl@samba.org>2000-03-06 23:30:03 +0000
commit7177eed7d1005b9a23d45c60eaf7b75fe24b75dc (patch)
treefb0312af069ed84107c0ca2ff4c427e5accec462
parent751b80390720fc996e9c3faebc5b5251d2ea9ed1 (diff)
downloadsamba-7177eed7d1005b9a23d45c60eaf7b75fe24b75dc.tar.gz
info level 23 password change also has alignment issues
-rw-r--r--source/rpc_parse/parse_samr.c3
-rw-r--r--source/samrd/srv_samr_usr_tdb.c9
2 files changed, 8 insertions, 4 deletions
diff --git a/source/rpc_parse/parse_samr.c b/source/rpc_parse/parse_samr.c
index ca1df693611..3f0904183eb 100644
--- a/source/rpc_parse/parse_samr.c
+++ b/source/rpc_parse/parse_samr.c
@@ -5256,10 +5256,7 @@ BOOL make_sam_user_info21W(SAM_USER_INFO_21 *usr,
bzero(usr->padding1, sizeof(usr->padding1));
- dump_data_pw("user_name:", user_name, sizeof(*user_name));
-
copy_unistr2(&(usr->uni_user_name ), user_name);
- dump_data_pw("user_name:", &usr->uni_user_name, sizeof(*user_name));
copy_unistr2(&(usr->uni_full_name ), full_name);
copy_unistr2(&(usr->uni_home_dir ), home_dir );
copy_unistr2(&(usr->uni_dir_drive ), dir_drive);
diff --git a/source/samrd/srv_samr_usr_tdb.c b/source/samrd/srv_samr_usr_tdb.c
index 448b37a4bc4..4a4a942cc09 100644
--- a/source/samrd/srv_samr_usr_tdb.c
+++ b/source/samrd/srv_samr_usr_tdb.c
@@ -550,6 +550,8 @@ static BOOL set_user_info_23(TDB_CONTEXT * usr_tdb,
static uchar lm_hash[16];
UNISTR2 new_pw;
uint32 len;
+ char buf[512];
+ int i;
if (id23 == NULL)
{
@@ -557,7 +559,7 @@ static BOOL set_user_info_23(TDB_CONTEXT * usr_tdb,
return False;
}
- if (!decode_pw_buffer(id23->pass, (char *)new_pw.buffer, 256, &len))
+ if (!decode_pw_buffer(id23->pass, buf, 256, &len))
{
return False;
}
@@ -565,6 +567,11 @@ static BOOL set_user_info_23(TDB_CONTEXT * usr_tdb,
new_pw.uni_max_len = len / 2;
new_pw.uni_str_len = len / 2;
+ for (i = 0; i < new_pw.uni_str_len; i++)
+ {
+ new_pw.buffer[i] = SVAL(buf, i*2);
+ }
+
nt_lm_owf_genW(&new_pw, nt_hash, lm_hash);
return tdb_set_userinfo_23(usr_tdb, id23, lm_hash, nt_hash);