summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2011-07-18 14:09:50 +0200
committerStefan Metzmacher <metze@samba.org>2011-07-18 23:27:55 +0200
commitd29f8491bdc3e04e4644c7ad0d0ef79c6f1affc3 (patch)
tree6e591948457d2d1e7d5efa851a55ff417839142f /source3
parent8f7b7d7aa2eb1eb27eb7c90c7056d46d198634d4 (diff)
downloadsamba-d29f8491bdc3e04e4644c7ad0d0ef79c6f1affc3.tar.gz
samba-d29f8491bdc3e04e4644c7ad0d0ef79c6f1affc3.tar.bz2
samba-d29f8491bdc3e04e4644c7ad0d0ef79c6f1affc3.zip
s3-torture: run_locktest5(): replace cli_lock() with cli_lock32()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/torture/torture.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 22d9b13927..39d7ad3005 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -2126,23 +2126,25 @@ static bool run_locktest5(int dummy)
}
/* Check for NT bug... */
- ret = cli_lock(cli1, fnum1, 0, 8, 0, READ_LOCK) &&
- cli_lock(cli1, fnum3, 0, 1, 0, READ_LOCK);
+ ret = NT_STATUS_IS_OK(cli_lock32(cli1, fnum1, 0, 8, 0, READ_LOCK)) &&
+ NT_STATUS_IS_OK(cli_lock32(cli1, fnum3, 0, 1, 0, READ_LOCK));
cli_close(cli1, fnum1);
cli_open(cli1, fname, O_RDWR, DENY_NONE, &fnum1);
- ret = cli_lock(cli1, fnum1, 7, 1, 0, WRITE_LOCK);
+ status = cli_lock32(cli1, fnum1, 7, 1, 0, WRITE_LOCK);
+ ret = NT_STATUS_IS_OK(status);
EXPECTED(ret, True);
printf("this server %s the NT locking bug\n", ret ? "doesn't have" : "has");
cli_close(cli1, fnum1);
cli_open(cli1, fname, O_RDWR, DENY_NONE, &fnum1);
cli_unlock(cli1, fnum3, 0, 1);
- ret = cli_lock(cli1, fnum1, 0, 4, 0, WRITE_LOCK) &&
- cli_lock(cli1, fnum1, 1, 1, 0, READ_LOCK);
+ ret = NT_STATUS_IS_OK(cli_lock32(cli1, fnum1, 0, 4, 0, WRITE_LOCK)) &&
+ NT_STATUS_IS_OK(cli_lock32(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");
- ret = cli_lock(cli2, fnum2, 0, 4, 0, READ_LOCK);
+ status = cli_lock32(cli2, fnum2, 0, 4, 0, READ_LOCK);
+ ret = NT_STATUS_IS_OK(status);
EXPECTED(ret, False);
printf("a different processs %s get a read lock on the first process lock stack\n", ret?"can":"cannot");
@@ -2150,7 +2152,8 @@ static bool run_locktest5(int dummy)
/* Unlock the process 2 lock. */
cli_unlock(cli2, fnum2, 0, 4);
- ret = cli_lock(cli1, fnum3, 0, 4, 0, READ_LOCK);
+ status = cli_lock32(cli1, fnum3, 0, 4, 0, READ_LOCK);
+ ret = NT_STATUS_IS_OK(status);
EXPECTED(ret, False);
printf("the same processs on a different fnum %s get a read lock\n", ret?"can":"cannot");
@@ -2159,8 +2162,8 @@ static bool run_locktest5(int dummy)
cli_unlock(cli1, fnum3, 0, 4);
/* Stack 2 more locks here. */
- ret = cli_lock(cli1, fnum1, 0, 4, 0, READ_LOCK) &&
- cli_lock(cli1, fnum1, 0, 4, 0, READ_LOCK);
+ ret = NT_STATUS_IS_OK(cli_lock32(cli1, fnum1, 0, 4, 0, READ_LOCK)) &&
+ NT_STATUS_IS_OK(cli_lock32(cli1, fnum1, 0, 4, 0, READ_LOCK));
EXPECTED(ret, True);
printf("the same process %s stack read locks\n", ret?"can":"cannot");
@@ -2169,7 +2172,7 @@ static bool run_locktest5(int dummy)
removed. */
ret = NT_STATUS_IS_OK(cli_unlock(cli1, fnum1, 0, 4)) &&
- cli_lock(cli2, fnum2, 0, 4, 0, READ_LOCK);
+ NT_STATUS_IS_OK(cli_lock32(cli2, fnum2, 0, 4, 0, READ_LOCK));
EXPECTED(ret, True);
printf("the first unlock removes the %s lock\n", ret?"WRITE":"READ");
@@ -2192,7 +2195,8 @@ static bool run_locktest5(int dummy)
printf("the same process %s count the lock stack\n", !ret?"can":"cannot");
/* Ensure connection 2 can get a write lock. */
- ret = cli_lock(cli2, fnum2, 0, 4, 0, WRITE_LOCK);
+ status = cli_lock32(cli2, fnum2, 0, 4, 0, WRITE_LOCK);
+ ret = NT_STATUS_IS_OK(status);
EXPECTED(ret, True);
printf("a different processs %s get a write lock on the unlocked stack\n", ret?"can":"cannot");