diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-05-04 09:31:57 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-05-04 09:31:57 +0000 |
commit | 0236a14baccc6c8361ab5d00e8d2a71f8f0e9343 (patch) | |
tree | d6d37064391419d77088bdbf0a87424dff35c89a | |
parent | 420d7e02dca5c207091ded625082b4f5df2b9c65 (diff) | |
download | samba-0236a14baccc6c8361ab5d00e8d2a71f8f0e9343.tar.gz samba-0236a14baccc6c8361ab5d00e8d2a71f8f0e9343.tar.bz2 samba-0236a14baccc6c8361ab5d00e8d2a71f8f0e9343.zip |
added a test for the NT byte range lock into smbtorture
(This used to be commit 7cfd45cc56e01a20a122c7742dc7e6a4ed59415f)
-rw-r--r-- | source3/utils/torture.c | 17 |
1 files changed, 16 insertions, 1 deletions
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); |