RAW-LOCK: samba4 behaves like windows 7 in regard of locking error codes
authorStefan Metzmacher <metze@samba.org>
Fri, 24 Apr 2009 13:36:00 +0000 (15:36 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 25 Apr 2009 01:16:11 +0000 (03:16 +0200)
metze

source4/torture/raw/lock.c

index f756622f8fd25117c0f130b7f95e23ed5abe0387..f798f50ce755d689132e6eb250ba6fb05f32fa43 100644 (file)
@@ -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;