summaryrefslogtreecommitdiffstats
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
commit3e69ea6846e455d6ebb15e4481d4f98fd038c8a2 (patch)
tree975150d8dcab48fe2e36f6d7a3bf5dae2875f1b0
parent568e1d7b4389e5a49aa1d52eb4c74bc53dbc125f (diff)
downloadsamba-3e69ea6846e455d6ebb15e4481d4f98fd038c8a2.tar.gz
samba-3e69ea6846e455d6ebb15e4481d4f98fd038c8a2.tar.xz
samba-3e69ea6846e455d6ebb15e4481d4f98fd038c8a2.zip
expanded the lock6 test a bit to try lsarpc as well
this allows us to check that we refuse locking on pipes
-rw-r--r--source/torture/torture.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/source/torture/torture.c b/source/torture/torture.c
index a79f22c1a08..015ed5b8ebf 100644
--- a/source/torture/torture.c
+++ b/source/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");