diff options
author | Jeremy Allison <jra@samba.org> | 2001-06-30 03:11:44 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-06-30 03:11:44 +0000 |
commit | 064b4904f9695a766acc0d87a630e18a59e5c540 (patch) | |
tree | 03feb3b6bccb247207ee77c617c15f38bdcbeb6f /source3/torture | |
parent | 6db4e7612070b8df8d126b596cb6665f0a582db0 (diff) | |
download | samba-064b4904f9695a766acc0d87a630e18a59e5c540.tar.gz samba-064b4904f9695a766acc0d87a630e18a59e5c540.tar.bz2 samba-064b4904f9695a766acc0d87a630e18a59e5c540.zip |
Ensure we return correct error on trying to unlock a region not locked.
Jeremy.
(This used to be commit 015a077acc49e59179dc10256fd32166ee4623e2)
Diffstat (limited to 'source3/torture')
-rw-r--r-- | source3/torture/torture.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c index a50c44b296..d7e169bdcc 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -909,8 +909,16 @@ static void run_locktest2(int dummy) cli_setpid(&cli, 2); - if (cli_unlock(&cli, fnum1, 0, 8)) { + if (cli_unlock(&cli, fnum1, 0, 4)) { printf("unlock1 succeeded! This is a locking bug\n"); + } else { + if (!check_error(&cli, ERRDOS, ERRnotlocked, 0)) return; + } + + if (cli_unlock(&cli, fnum1, 0, 8)) { + printf("unlock2 succeeded! This is a locking bug\n"); + } else { + if (!check_error(&cli, ERRDOS, ERRnotlocked, 0)) return; } if (cli_lock(&cli, fnum3, 0, 4, 0, WRITE_LOCK)) { |