diff options
author | Zachary Loafman <zachary.loafman@isilon.com> | 2009-11-17 23:25:58 +0000 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-12-03 20:21:22 -0800 |
commit | f26a500d9ff854734decdcb196136dc8cc19eb4a (patch) | |
tree | 2ff455a7cc6f104c564c1354879ac97e2a4cd83d | |
parent | 5882282deaf3ce06c18fe2102f7f8dcc6e79b409 (diff) | |
download | samba-f26a500d9ff854734decdcb196136dc8cc19eb4a.tar.gz samba-f26a500d9ff854734decdcb196136dc8cc19eb4a.tar.bz2 samba-f26a500d9ff854734decdcb196136dc8cc19eb4a.zip |
s4 torture: Add lockread_supported based off of CAP_LOCK_AND_READ
Signed-off-by: Tim Prouty <tprouty@samba.org>
-rw-r--r-- | source4/libcli/raw/libcliraw.h | 1 | ||||
-rw-r--r-- | source4/libcli/raw/rawnegotiate.c | 3 | ||||
-rw-r--r-- | source4/torture/raw/read.c | 5 | ||||
-rw-r--r-- | source4/torture/raw/write.c | 5 |
4 files changed, 14 insertions, 0 deletions
diff --git a/source4/libcli/raw/libcliraw.h b/source4/libcli/raw/libcliraw.h index 37e158a465..69de33ce71 100644 --- a/source4/libcli/raw/libcliraw.h +++ b/source4/libcli/raw/libcliraw.h @@ -65,6 +65,7 @@ struct smbcli_negotiate { time_t server_time; uint_t readbraw_supported:1; uint_t writebraw_supported:1; + uint_t lockread_supported:1; char *server_domain; }; diff --git a/source4/libcli/raw/rawnegotiate.c b/source4/libcli/raw/rawnegotiate.c index dedc891ac1..67f3bfa0af 100644 --- a/source4/libcli/raw/rawnegotiate.c +++ b/source4/libcli/raw/rawnegotiate.c @@ -152,6 +152,9 @@ NTSTATUS smb_raw_negotiate_recv(struct smbcli_request *req) transport->negotiate.readbraw_supported = true; transport->negotiate.writebraw_supported = true; } + + if (transport->negotiate.capabilities & CAP_LOCK_AND_READ) + transport->negotiate.lockread_supported = true; } else if (transport->negotiate.protocol >= PROTOCOL_LANMAN1) { SMBCLI_CHECK_WCT(req, 13); transport->negotiate.sec_mode = SVAL(req->in.vwv,VWV(1)); diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c index 90ca18d5b6..efdd040451 100644 --- a/source4/torture/raw/read.c +++ b/source4/torture/raw/read.c @@ -224,6 +224,11 @@ static bool test_lockread(struct torture_context *tctx, const char *test_data = "TEST DATA"; uint_t seed = time(NULL); + if (!cli->transport->negotiate.lockread_supported) { + printf("Server does not support lockread - skipping\n"); + return true; + } + buf = talloc_zero_array(tctx, uint8_t, maxsize); if (!torture_setup_dir(cli, BASEDIR)) { diff --git a/source4/torture/raw/write.c b/source4/torture/raw/write.c index cd1b078dbf..31cbb98a88 100644 --- a/source4/torture/raw/write.c +++ b/source4/torture/raw/write.c @@ -425,6 +425,11 @@ static bool test_writeunlock(struct torture_context *tctx, buf = talloc_zero_array(tctx, uint8_t, maxsize); + if (!cli->transport->negotiate.lockread_supported) { + printf("Server does not support writeunlock - skipping\n"); + return true; + } + if (!torture_setup_dir(cli, BASEDIR)) { return false; } |