summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-03-11 01:57:39 +0000
committerAndrew Tridgell <tridge@samba.org>2002-03-11 01:57:39 +0000
commit9bdb6e2b2266eee4b02cf5217db33bd47ef882f4 (patch)
treeb4fdb4fffac998cd8dc2093e2459c643864d5bcb /source3/torture
parent2fb07df753803d1c96e7600805c0984971d6dd22 (diff)
downloadsamba-9bdb6e2b2266eee4b02cf5217db33bd47ef882f4.tar.gz
samba-9bdb6e2b2266eee4b02cf5217db33bd47ef882f4.tar.bz2
samba-9bdb6e2b2266eee4b02cf5217db33bd47ef882f4.zip
expanded the lock6 test a bit to try lsarpc as well
this allows us to check that we refuse locking on pipes (This used to be commit 3e69ea6846e455d6ebb15e4481d4f98fd038c8a2)
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index a79f22c1a0..015ed5b8eb 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -1499,7 +1499,8 @@ static BOOL run_locktest5(int dummy)
static BOOL run_locktest6(int dummy)
{
static struct cli_state cli;
- char *fname = "\\lockt6.lck";
+ char *fname[2] = { "\\lock6.txt", "\\pipe\\lsarpc"};
+ int i;
int fnum;
NTSTATUS status;
@@ -1511,19 +1512,24 @@ static BOOL run_locktest6(int dummy)
printf("starting locktest6\n");
- cli_unlink(&cli, fname);
+ for (i=0;i<2;i++) {
+ printf("Testing %s\n", fname[i]);
- fnum = cli_open(&cli, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE);
- status = cli_locktype(&cli, fnum, 0, 8, 0, LOCKING_ANDX_CHANGE_LOCKTYPE);
- cli_close(&cli, fnum);
- printf("CHANGE_LOCKTYPE gave %s\n", get_nt_error_msg(status));
+ cli_unlink(&cli, fname[i]);
- fnum = cli_open(&cli, fname, O_RDWR, DENY_NONE);
- status = cli_locktype(&cli, fnum, 0, 8, 0, LOCKING_ANDX_CANCEL_LOCK);
- cli_close(&cli, fnum);
- printf("CANCEL_LOCK gave %s\n", get_nt_error_msg(status));
+ fnum = cli_open(&cli, fname[i], O_RDWR|O_CREAT|O_EXCL, DENY_NONE);
+ status = cli_locktype(&cli, fnum, 0, 8, 0, LOCKING_ANDX_CHANGE_LOCKTYPE);
+ cli_close(&cli, fnum);
+ printf("CHANGE_LOCKTYPE gave %s\n", get_nt_error_msg(status));
+
+ fnum = cli_open(&cli, fname[i], O_RDWR, DENY_NONE);
+ status = cli_locktype(&cli, fnum, 0, 8, 0, LOCKING_ANDX_CANCEL_LOCK);
+ cli_close(&cli, fnum);
+ printf("CANCEL_LOCK gave %s\n", get_nt_error_msg(status));
+
+ cli_unlink(&cli, fname[i]);
+ }
- cli_unlink(&cli, fname);
torture_close_connection(&cli);
printf("finished locktest6\n");