From 09f1754a9b402e0be5926ea6217f2592423c38da Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 24 Apr 2009 15:36:00 +0200 Subject: RAW-LOCK: samba4 behaves like windows 7 in regard of locking error codes metze --- source4/torture/raw/lock.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'source4') 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; -- cgit