diff options
author | Jeremy Allison <jra@samba.org> | 2001-06-20 19:55:59 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-06-20 19:55:59 +0000 |
commit | 3f1254bee1b3cc8cce1e17be6f0250090f579417 (patch) | |
tree | 931ea411eafa5e7f1f88c82b52f0eb9f2ac6ce53 /source3/rpc_server | |
parent | 6fb063b4d5dfb1b201cb4531855662997ca02dbf (diff) | |
download | samba-3f1254bee1b3cc8cce1e17be6f0250090f579417.tar.gz samba-3f1254bee1b3cc8cce1e17be6f0250090f579417.tar.bz2 samba-3f1254bee1b3cc8cce1e17be6f0250090f579417.zip |
Fixed W2K SP2 joining a Samba PDC hosted domain.
Jermey.
(This used to be commit 05a2911403a0710d994a618e72743205a3b0b87a)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_netlog_nt.c | 4 | ||||
-rw-r--r-- | source3/rpc_server/srv_samr_nt.c | 40 |
2 files changed, 35 insertions, 9 deletions
diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c index eb026a1f98..bbda4060f2 100644 --- a/source3/rpc_server/srv_netlog_nt.c +++ b/source3/rpc_server/srv_netlog_nt.c @@ -470,8 +470,8 @@ static uint32 net_login_interactive(NET_ID_INFO_1 *id1, SAM_ACCOUNT *sampass, pi dump_data(100, nt_pwd, 16); #endif - SamOEMhash((uchar *)lm_pwd, key, False); - SamOEMhash((uchar *)nt_pwd, key, False); + SamOEMhash((uchar *)lm_pwd, key, 16); + SamOEMhash((uchar *)nt_pwd, key, 16); #ifdef DEBUG_PASSWORD DEBUG(100,("decrypt of lm owf password:")); diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index 0a82c90a1d..502774e986 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -2259,10 +2259,10 @@ static BOOL set_user_info_23(SAM_USER_INFO_23 *id23, uint32 rid) } /******************************************************************* - set_user_info_24 + set_user_info_pw ********************************************************************/ -static BOOL set_user_info_24(SAM_USER_INFO_24 *id24, uint32 rid) +static BOOL set_user_info_pw(char *pass, uint32 rid) { SAM_ACCOUNT *pwd = NULL; uchar nt_hash[16]; @@ -2282,7 +2282,7 @@ static BOOL set_user_info_24(SAM_USER_INFO_24 *id24, uint32 rid) memset(buf, 0, sizeof(buf)); - if (!decode_pw_buffer((char*)id24->pass, buf, 256, &len, nt_hash, lm_hash)) { + if (!decode_pw_buffer(pass, buf, 256, &len, nt_hash, lm_hash)) { pdb_free_sam(pwd); return False; } @@ -2306,7 +2306,7 @@ static BOOL set_user_info_24(SAM_USER_INFO_24 *id24, uint32 rid) memset(buf, 0, sizeof(buf)); - DEBUG(0,("set_user_info_24: pdb_update_sam_account()\n")); + DEBUG(5,("set_user_info_pw: pdb_update_sam_account()\n")); /* update the SAMBA password */ if(!pdb_update_sam_account(pwd, True)) { @@ -2390,13 +2390,39 @@ uint32 _samr_set_userinfo(pipes_struct *p, SAMR_Q_SET_USERINFO *q_u, SAMR_R_SET_ break; case 24: - SamOEMhash(ctr->info.id24->pass, sess_key, 1); - if (!set_user_info_24(ctr->info.id24, rid)) + SamOEMhash(ctr->info.id24->pass, sess_key, 516); + + dump_data(100, (char *)ctr->info.id24->pass, 516); + + if (!set_user_info_pw(ctr->info.id24->pass, rid)) return NT_STATUS_ACCESS_DENIED; break; + case 25: +#if 0 + /* + * Currently we don't really know how to unmarshall + * the level 25 struct, and the password encryption + * is different. This is a placeholder for when we + * do understand it. In the meantime just return INVALID + * info level and W2K SP2 drops down to level 23... JRA. + */ + + SamOEMhash(ctr->info.id25->pass, sess_key, 532); + + dump_data(100, (char *)ctr->info.id25->pass, 532); + + if (!set_user_info_pw(ctr->info.id25->pass, rid)) + return NT_STATUS_ACCESS_DENIED; + break; +#endif + return NT_STATUS_INVALID_INFO_CLASS; + case 23: - SamOEMhash(ctr->info.id23->pass, sess_key, 1); + SamOEMhash(ctr->info.id23->pass, sess_key, 516); + + dump_data(100, (char *)ctr->info.id23->pass, 516); + if (!set_user_info_23(ctr->info.id23, rid)) return NT_STATUS_ACCESS_DENIED; break; |