From 420d7e02dca5c207091ded625082b4f5df2b9c65 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 4 May 2000 08:58:07 +0000 Subject: an even simpler example of NT gettings its locking code wrong. This one doesn't even need two connections to the box, just two file handles. it is a very simple case actually, and one I think will happen quite a lot in real life. I wonder how they haven't noticed it? I checked and W2K has the same bug. (This used to be commit 0b335e415818028ac0daad5f99c2fd9086a2a656) --- source3/utils/locktest.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'source3/utils/locktest.c') diff --git a/source3/utils/locktest.c b/source3/utils/locktest.c index 0d1c1719a8..d52d023f25 100644 --- a/source3/utils/locktest.c +++ b/source3/utils/locktest.c @@ -38,6 +38,8 @@ static BOOL analyze; #define LOCK_PCT 25 #define UNLOCK_PCT 65 #define RANGE_MULTIPLE 32 +#define NCONNECTIONS 2 +#define NFILES 2 struct record { char r1, r2; @@ -47,16 +49,10 @@ struct record { }; static struct record preset[] = { -#if 0 -{36, 5, 1, 1, 1, 2, 1}, -{ 2, 6, 0, 1, 0, 2, 1}, -{53, 92, 1, 1, 0, 0, 1}, -{99, 11, 1, 1, 2, 1, 1}, -#endif -{36, 5, 1, 1, 1888, 960, 1}, -{47, 23, 0, 1, 0, 2176, 1}, -{84, 95, 1, 1, 3072, 96, 1}, -{65, 14, 0, 0, 2752, 352, 1}, +{36, 5, 0, 0, 0, 8, 1}, +{ 2, 6, 0, 1, 0, 1, 1}, +{53, 92, 0, 0, 0, 0, 1}, +{99, 11, 0, 0, 7, 1, 1}, }; static struct record *recorded; @@ -178,12 +174,10 @@ static void reconnect(struct cli_state *cli[2][2], int fnum[2][2][2], share[0] = share1; share[1] = share2; - - for (server=0;server<2;server++) - for (conn=0;conn<2;conn++) { + for (conn=0;conn