1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-25 14:50:24 +03:00

dealing with some stack overflow bug somewhere around the use of

deal_with_credentials() by moving important code to the beginning
of the function :-) :-) :-).

the new seed (old_cred + time + 1) was getting corrupted.
(This used to be commit dab35ce5d61d53bce6ede44e56d9393645c0d67e)
This commit is contained in:
Luke Leighton 1997-10-16 13:38:16 +00:00
parent 0d7bdcb6a1
commit 820b7045fc

View File

@ -390,6 +390,17 @@ static BOOL deal_with_credentials(user_struct *vuser,
UTIME new_clnt_time;
uint32 new_cred;
DEBUG(5,("deal_with_credentials: %d\n", __LINE__));
/* increment client time by one second */
new_clnt_time.time = clnt_cred->timestamp.time + 1;
/* first 4 bytes of the new seed is old client 4 bytes + clnt time + 1 */
new_cred = IVAL(vuser->dc.clnt_cred.data, 0);
new_cred += new_clnt_time.time;
DEBUG(5,("deal_with_credentials: new_cred[0]=%lx\n", new_cred));
/* doesn't matter that server time is 0 */
srv_cred->timestamp.time = 0;
@ -400,25 +411,16 @@ static BOOL deal_with_credentials(user_struct *vuser,
return False;
}
/* increment client time by one second */
new_clnt_time.time = clnt_cred->timestamp.time + 1;
DEBUG(5,("deal_with_credentials: new_clnt_time=%lx\n", new_clnt_time.time));
/* create server credentials for inclusion in the reply */
cred_create(vuser->dc.sess_key, &(vuser->dc.clnt_cred), new_clnt_time,
&(srv_cred->challenge));
DEBUG(5,("deal_with_credentials: %d\n", __LINE__));
DEBUG(5,("deal_with_credentials: clnt_cred[0]=%lx\n",
vuser->dc.clnt_cred.data[0]));
new_cred = IVAL(vuser->dc.clnt_cred.data, 0);
new_cred += new_clnt_time.time;
DEBUG(5,("deal_with_credentials: new_cred[0]=%lx\n", new_cred));
/* store new seed in client and server credentials */
SIVAL(vuser->dc.clnt_cred.data, 0, new_cred);
SIVAL(vuser->dc.srv_cred .data, 0, new_cred);