diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-08-29 22:01:18 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:34:57 -0500 |
commit | ec934124db8a5234d8c83799a23c7bdced5dd95a (patch) | |
tree | 1cc89a41482b16b186f9bec3daad692d9dbcfed2 /source4/lib/samba3/tdbsam.c | |
parent | 721b22f9cdef811ac0e2738b62d7b978fad74dbc (diff) | |
download | samba-ec934124db8a5234d8c83799a23c7bdced5dd95a.tar.gz samba-ec934124db8a5234d8c83799a23c7bdced5dd95a.tar.bz2 samba-ec934124db8a5234d8c83799a23c7bdced5dd95a.zip |
r9762: Add support for reading good old smbpasswd files
Fix password support
Make base64 decode/encode functions available to EJS
(This used to be commit 1376a1fe44cd6b01709819095a711c14626b1d3e)
Diffstat (limited to 'source4/lib/samba3/tdbsam.c')
-rw-r--r-- | source4/lib/samba3/tdbsam.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/source4/lib/samba3/tdbsam.c b/source4/lib/samba3/tdbsam.c index c9b121ca77..fc293d5df9 100644 --- a/source4/lib/samba3/tdbsam.c +++ b/source4/lib/samba3/tdbsam.c @@ -69,8 +69,8 @@ static BOOL init_sam_from_buffer_v0(TDB_CONTEXT *tdb, struct samba3_samaccount * &munged_dial_len, &sampass->munged_dial, /* B */ &sampass->user_rid, /* d */ &sampass->group_rid, /* d */ - &lm_pw_len, &sampass->lm_pw_ptr, /* B */ - &nt_pw_len, &sampass->nt_pw_ptr, /* B */ + &lm_pw_len, sampass->lm_pw.hash, /* B */ + &nt_pw_len, sampass->nt_pw.hash, /* B */ &sampass->acct_ctrl, /* w */ &remove_me, /* remove on the next TDB_FORMAT upgarde */ /* d */ &sampass->logon_divs, /* w */ @@ -85,11 +85,11 @@ static BOOL init_sam_from_buffer_v0(TDB_CONTEXT *tdb, struct samba3_samaccount * } if (lm_pw_len != 16) { - sampass->lm_pw_ptr = NULL; + return False; } if (nt_pw_len != 16) { - sampass->nt_pw_ptr = NULL; + return False; } return True; @@ -135,8 +135,8 @@ static BOOL init_sam_from_buffer_v1(TDB_CONTEXT *tdb, struct samba3_samaccount * &munged_dial_len, &sampass->munged_dial, /* B */ &sampass->user_rid, /* d */ &sampass->group_rid, /* d */ - &lm_pw_len, &sampass->lm_pw_ptr, /* B */ - &nt_pw_len, &sampass->nt_pw_ptr, /* B */ + &lm_pw_len, sampass->lm_pw.hash, /* B */ + &nt_pw_len, sampass->nt_pw.hash, /* B */ &sampass->acct_ctrl, /* w */ &remove_me, /* d */ &sampass->logon_divs, /* w */ @@ -150,12 +150,12 @@ static BOOL init_sam_from_buffer_v1(TDB_CONTEXT *tdb, struct samba3_samaccount * return False; } - if (sampass->lm_pw_ptr && lm_pw_len != 16) { - sampass->lm_pw_ptr = NULL; + if (lm_pw_len != 16) { + return False; } - if (sampass->nt_pw_ptr && nt_pw_len != 16) { - sampass->nt_pw_ptr = NULL; + if (nt_pw_len != 16) { + return False; } return True; @@ -199,8 +199,8 @@ static BOOL init_sam_from_buffer_v2(TDB_CONTEXT *tdb, struct samba3_samaccount * &munged_dial_len, &sampass->munged_dial, /* B */ &sampass->user_rid, /* d */ &sampass->group_rid, /* d */ - &lm_pw_len, &sampass->lm_pw_ptr, /* B */ - &nt_pw_len, &sampass->nt_pw_ptr, /* B */ + &lm_pw_len, sampass->lm_pw.hash, /* B */ + &nt_pw_len, sampass->nt_pw.hash, /* B */ /* Change from V1 is addition of password history field. */ &nt_pw_hist_len, &sampass->nt_pw_hist_ptr, /* B */ &sampass->acct_ctrl, /* w */ @@ -216,12 +216,12 @@ static BOOL init_sam_from_buffer_v2(TDB_CONTEXT *tdb, struct samba3_samaccount * return False; } - if (sampass->lm_pw_ptr && lm_pw_len != 16) { - sampass->lm_pw_ptr = NULL; + if (lm_pw_len != 16) { + return False; } - if (sampass->nt_pw_ptr && nt_pw_len != 16) { - sampass->nt_pw_ptr = NULL; + if (nt_pw_len != 16) { + return False; } return True; |