From 820b7045fc7c4a13ec10fe957a7c2b6bea47f353 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 16 Oct 1997 13:38:16 +0000 Subject: 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) --- source3/pipenetlog.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/source3/pipenetlog.c b/source3/pipenetlog.c index 4d28e3bef0..32096b3b84 100644 --- a/source3/pipenetlog.c +++ b/source3/pipenetlog.c @@ -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); -- cgit