From 045469493c2870cb1d63c964b18afc5e2210dcd5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 4 May 2000 21:57:28 +0000 Subject: rpc_server/srv_lsa.c: Bring into sync with 2.0.x. rpc_server/srv_pipe_hnd.c: Bring into sync with 2.0.x. smbd/blocking.c: Improve blocking debug reporting. utils/torture.c: Added check for NT locking bug. Jeremy. (This used to be commit e8ff6d3fb5537c39611a5784bf7216ae812acd27) --- source3/utils/torture.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/torture.c b/source3/utils/torture.c index 40920f79c3..e74106609d 100644 --- a/source3/utils/torture.c +++ b/source3/utils/torture.c @@ -998,8 +998,20 @@ static void run_locktest5(int dummy) goto fail; } + /* Check for NT bug... */ + ret = cli_lock(&cli1, fnum1, 0, 8, 0, READ_LOCK) && + cli_lock(&cli1, fnum3, 0, 1, 0, READ_LOCK); + cli_close(&cli1, fnum1); + fnum1 = cli_open(&cli1, fname, O_RDWR, DENY_NONE); + ret = cli_lock(&cli1, fnum1, 7, 1, 0, WRITE_LOCK); + EXPECTED(ret, True); + printf("this server %s the NT locking bug\n", ret ? "doesn't have" : "has"); + cli_close(&cli1, fnum1); + fnum1 = cli_open(&cli1, fname, O_RDWR, DENY_NONE); + cli_unlock(&cli1, fnum3, 0, 1); + ret = cli_lock(&cli1, fnum1, 0, 4, 0, WRITE_LOCK) && - cli_lock(&cli1, fnum1, 0, 4, 0, READ_LOCK); + cli_lock(&cli1, fnum1, 1, 1, 0, READ_LOCK); EXPECTED(ret, True); printf("the same process %s overlay a write with a read lock\n", ret?"can":"cannot"); @@ -1040,7 +1052,7 @@ static void run_locktest5(int dummy) /* We should have 3 stacked locks here. Ensure we need to do 3 unlocks. */ - ret = cli_unlock(&cli1, fnum1, 0, 4) && + ret = cli_unlock(&cli1, fnum1, 1, 1) && cli_unlock(&cli1, fnum1, 0, 4) && cli_unlock(&cli1, fnum1, 0, 4); -- cgit