summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1997-10-16 13:38:16 +0000
committerLuke Leighton <lkcl@samba.org>1997-10-16 13:38:16 +0000
commit820b7045fc7c4a13ec10fe957a7c2b6bea47f353 (patch)
tree09f287bea03be6b0d86c5ec2854187bd05c15e65 /source3
parent0d7bdcb6a1e60ed04412908bf6b11004ce748d63 (diff)
downloadsamba-820b7045fc7c4a13ec10fe957a7c2b6bea47f353.tar.gz
samba-820b7045fc7c4a13ec10fe957a7c2b6bea47f353.tar.bz2
samba-820b7045fc7c4a13ec10fe957a7c2b6bea47f353.zip
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)
Diffstat (limited to 'source3')
-rw-r--r--source3/pipenetlog.c22
1 files 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);