[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Wed Nov 18 00:24:56 MST 2009


The branch, master has been updated
       via  fb685d3... s4:selftest: mark samba4.smb2.lock.*.VALID-REQUEST as known failure
       via  c2a2996... SMB2-LOCK: make use of torture_assert_*()
       via  77f3350... s4:ntvfs_generic: check for valid SMB2_LOCK flags
      from  575967a... s4:selftest: fix logic for --option=torture:progress=no

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit fb685d3a8afed4c14f5e7a17ef58225c2946ed67
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Nov 18 08:20:29 2009 +0100

    s4:selftest: mark samba4.smb2.lock.*.VALID-REQUEST as known failure
    
    metze

commit c2a29967ea0395460583edbbb91d04f897fee81d
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Nov 18 08:12:48 2009 +0100

    SMB2-LOCK: make use of torture_assert_*()
    
    This is needed in order to mark tests as known failures.
    
    metze

commit 77f335042b01fcef0bbe09e1070528c00b523063
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Nov 18 08:11:46 2009 +0100

    s4:ntvfs_generic: check for valid SMB2_LOCK flags
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 source4/ntvfs/ntvfs_generic.c |    8 ++++++++
 source4/selftest/knownfail    |    1 +
 source4/torture/smb2/lock.c   |   18 ++++++------------
 3 files changed, 15 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c
index 6e2e075..1d81acf 100644
--- a/source4/ntvfs/ntvfs_generic.c
+++ b/source4/ntvfs/ntvfs_generic.c
@@ -1113,6 +1113,14 @@ NTSTATUS ntvfs_map_lock(struct ntvfs_module_context *ntvfs,
 			isunlock = false;
 		}
 		for (i=0;i<lck->smb2.in.lock_count;i++) {
+			if (lck->smb2.in.locks[i].flags == SMB2_LOCK_FLAG_NONE) {
+				return NT_STATUS_INVALID_PARAMETER;
+			}
+
+			if (lck->smb2.in.locks[i].flags & ~SMB2_LOCK_FLAG_ALL_MASK) {
+				return NT_STATUS_INVALID_PARAMETER;
+			}
+
 			if (isunlock && 
 			    (lck->smb2.in.locks[i].flags & 
 			     (SMB2_LOCK_FLAG_SHARED|SMB2_LOCK_FLAG_EXCLUSIVE))) {
diff --git a/source4/selftest/knownfail b/source4/selftest/knownfail
index 2f75760..3694aed 100644
--- a/source4/selftest/knownfail
+++ b/source4/selftest/knownfail
@@ -63,3 +63,4 @@ samba4.ntvfs.cifs.base.createx_sharemodes_dir
 samba4.ntvfs.cifs.base.maximum_allowed
 samba4.base.createx_access # this test is broken for non-administrator users
 samba4.smb2.oplock # oplocks in the s4 SMB2 server are a mess
+samba4.smb2.lock.*.VALID-REQUEST # the s4 SMB2 server doesn't check lock ranges
diff --git a/source4/torture/smb2/lock.c b/source4/torture/smb2/lock.c
index 211578b..4308ff9 100644
--- a/source4/torture/smb2/lock.c
+++ b/source4/torture/smb2/lock.c
@@ -32,20 +32,14 @@
 #define TARGET_IS_W2K8(_tctx) (torture_setting_bool(_tctx, "w2k8", false))
 
 #define CHECK_STATUS(status, correct) do { \
-	if (!NT_STATUS_EQUAL(status, correct)) { \
-		printf("(%s) Incorrect status %s - should be %s\n", \
-		       __location__, nt_errstr(status), nt_errstr(correct)); \
-		ret = false; \
-		goto done; \
-	}} while (0)
+	const char *_cmt = "(" __location__ ")"; \
+	torture_assert_ntstatus_equal_goto(torture,status,correct,ret,done,_cmt); \
+} while (0)
 
 #define CHECK_VALUE(v, correct) do { \
-	if ((v) != (correct)) { \
-		printf("(%s) Incorrect value %s=%d - should be %d\n", \
-		       __location__, #v, v, correct); \
-		ret = false; \
-		goto done; \
-	}} while (0)
+	const char *_cmt = "(" __location__ ")"; \
+	torture_assert_int_equal_goto(torture,v,correct,ret,done,_cmt); \
+} while (0)
 
 static bool test_valid_request(struct torture_context *torture, struct smb2_tree *tree)
 {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list