summaryrefslogtreecommitdiffstats
path: root/source/passdb/passdb.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-10-15 21:36:48 +0000
committerGerald Carter <jerry@samba.org>2002-10-15 21:36:48 +0000
commit4f77cf6a2a2ae4b01c02d64ca0a8fd075310bada (patch)
treefb03eb763f295ec78a6fa5d2ae4e4abc20703e93 /source/passdb/passdb.c
parentc8240ad49ff0b32a6be27986c94ff260e25b8c9a (diff)
downloadsamba-4f77cf6a2a2ae4b01c02d64ca0a8fd075310bada.tar.gz
samba-4f77cf6a2a2ae4b01c02d64ca0a8fd075310bada.tar.xz
samba-4f77cf6a2a2ae4b01c02d64ca0a8fd075310bada.zip
updating whatsnew and merging from SAMBA_2_2
Diffstat (limited to 'source/passdb/passdb.c')
-rw-r--r--source/passdb/passdb.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/passdb/passdb.c b/source/passdb/passdb.c
index a79522d5e58..517a82b94fb 100644
--- a/source/passdb/passdb.c
+++ b/source/passdb/passdb.c
@@ -866,6 +866,9 @@ void copy_sam_passwd(SAM_ACCOUNT *to, const SAM_ACCOUNT *from)
by _api_samr_create_user() in rpc_server/srv_samr.c
--jerry
+
+ FIXME ! The new password is in UNIX character set. Must be
+ changed to DOS codepage before hashing.
*************************************************************/
BOOL local_password_change(char *user_name, int local_flags,
@@ -1660,17 +1663,22 @@ BOOL pdb_set_lanman_passwd (SAM_ACCOUNT *sampass, uint8 *pwd)
/*********************************************************************
Set the user's PLAINTEXT password. Used as an interface to the above.
+ NB. The plaintext is in UNIX character set. Must be converted to DOS
+ codepage.
********************************************************************/
-BOOL pdb_set_plaintext_passwd (SAM_ACCOUNT *sampass, char *plaintext)
+BOOL pdb_set_plaintext_passwd (SAM_ACCOUNT *sampass, const char *plaintext)
{
uchar new_lanman_p16[16];
uchar new_nt_p16[16];
+ fstring dos_plaintext;
if (!sampass || !plaintext)
return False;
- nt_lm_owf_gen (plaintext, new_nt_p16, new_lanman_p16);
+ fstrcpy(dos_plaintext, unix_to_dos_static(plaintext));
+
+ nt_lm_owf_gen (dos_plaintext, new_nt_p16, new_lanman_p16);
if (!pdb_set_nt_passwd (sampass, new_nt_p16))
return False;