summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-04-24 15:36:00 +0200
committerStefan Metzmacher <metze@samba.org>2009-04-25 03:16:11 +0200
commit09f1754a9b402e0be5926ea6217f2592423c38da (patch)
tree568649e467ca8221bc254081ed91b18704747025 /source4/torture
parent4ab243bcabefdcc044c6d517bb4d0e628227d5ac (diff)
downloadsamba-09f1754a9b402e0be5926ea6217f2592423c38da.tar.gz
samba-09f1754a9b402e0be5926ea6217f2592423c38da.tar.bz2
samba-09f1754a9b402e0be5926ea6217f2592423c38da.zip
RAW-LOCK: samba4 behaves like windows 7 in regard of locking error codes
metze
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/raw/lock.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/source4/torture/raw/lock.c b/source4/torture/raw/lock.c
index f756622f8f..f798f50ce7 100644
--- a/source4/torture/raw/lock.c
+++ b/source4/torture/raw/lock.c
@@ -70,6 +70,7 @@
#define BASEDIR "\\testlock"
#define TARGET_IS_WIN7(_tctx) (torture_setting_bool(_tctx, "win7", false))
+#define TARGET_IS_SAMBA4(_tctx) (torture_setting_bool(_tctx, "samba4", false))
/*
test SMBlock and SMBunlock ops
@@ -1576,9 +1577,11 @@ static bool test_unlock(struct torture_context *tctx, struct smbcli_state *cli)
* resolution as to whether Samba should support this or not. There is
* code to preference unlocking exclusive locks before shared locks,
* but its wrapped with "#ifdef ZERO_ZERO". -zkirsch */
- if (TARGET_IS_WIN7(tctx))
+ if (TARGET_IS_WIN7(tctx)) {
CHECK_STATUS(status, NT_STATUS_OK);
- else {
+ } else if (TARGET_IS_SAMBA4(tctx)) {
+ CHECK_STATUS(status, NT_STATUS_OK);
+ } else {
CHECK_STATUS_OR(status, NT_STATUS_LOCK_NOT_GRANTED,
NT_STATUS_FILE_LOCK_CONFLICT);
}
@@ -1588,11 +1591,14 @@ static bool test_unlock(struct torture_context *tctx, struct smbcli_state *cli)
io.lockx.in.lock_cnt = 0;
status = smb_raw_lock(cli->tree, &io);
- /* XXX Same as above. */
- if (TARGET_IS_WIN7(tctx))
- CHECK_STATUS(status, NT_STATUS_OK);
- else
- CHECK_STATUS(status, NT_STATUS_RANGE_NOT_LOCKED);
+ /* XXX Same as above. */
+ if (TARGET_IS_WIN7(tctx)) {
+ CHECK_STATUS(status, NT_STATUS_OK);
+ } else if (TARGET_IS_SAMBA4(tctx)) {
+ CHECK_STATUS(status, NT_STATUS_OK);
+ } else {
+ CHECK_STATUS(status, NT_STATUS_RANGE_NOT_LOCKED);
+ }
io.lockx.in.file.fnum = fnum1;
io.lockx.in.locks = &lock1;