From 0236a14baccc6c8361ab5d00e8d2a71f8f0e9343 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 4 May 2000 09:31:57 +0000 Subject: added a test for the NT byte range lock into smbtorture (This used to be commit 7cfd45cc56e01a20a122c7742dc7e6a4ed59415f) --- source3/utils/torture.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'source3/utils') diff --git a/source3/utils/torture.c b/source3/utils/torture.c index 1e0ed29a28..40920f79c3 100644 --- a/source3/utils/torture.c +++ b/source3/utils/torture.c @@ -803,7 +803,7 @@ static void run_locktest4(int dummy) { static struct cli_state cli1, cli2; char *fname = "\\lockt4.lck"; - int fnum1, fnum2; + int fnum1, fnum2, f; BOOL ret; char buf[1000]; @@ -940,6 +940,21 @@ static void run_locktest4(int dummy) EXPECTED(ret, True); printf("the same process %s remove the first lock first\n", ret?"does":"doesn't"); + cli_close(&cli1, fnum1); + cli_close(&cli2, fnum2); + fnum1 = cli_open(&cli1, fname, O_RDWR, DENY_NONE); + f = cli_open(&cli1, fname, O_RDWR, DENY_NONE); + ret = cli_lock(&cli1, fnum1, 0, 8, 0, READ_LOCK) && + cli_lock(&cli1, f, 0, 1, 0, READ_LOCK) && + cli_close(&cli1, fnum1) && + ((fnum1 = cli_open(&cli1, fname, O_RDWR, DENY_NONE)) != -1) && + cli_lock(&cli1, fnum1, 7, 1, 0, WRITE_LOCK); + cli_close(&cli1, f); + EXPECTED(ret, True); + printf("the server %s have the NT byte range lock bug\n", !ret?"does":"doesn't"); + + + fail: cli_close(&cli1, fnum1); cli_close(&cli2, fnum2); -- cgit