[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Sun Oct 6 07:50:02 MDT 2013


The branch, master has been updated
       via  f650bb9 smbd: Remove unused "brl->key" struct element
       via  e9513bc smbd: Convert some dbgtxt to DEBUG
       via  3a72cdb torture: Remove an unused variable
       via  960bd9a torture: Continue buffer check after NOT_IMPLEMENTED infolevels
       via  c944d2e libcli: Correct smb2_lease_pull
       via  eb5e817 libcli: Add const to smb2_lease_pull
       via  b40fcf3 torture: Fix a typo
       via  c134a37 smbd: Fix a comment
       via  41857bd smbd: Fix confusing comments
       via  4cde5bf smbd: Avoid calling serverid_exists twice
      from  9110c07 smbd:smb2: clarify and comment code treating dh2c blob check.

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


- Log -----------------------------------------------------------------
commit f650bb94c8b79bec87c2a1f17b573c27e0ef1b1b
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Sep 11 09:31:36 2013 +0000

    smbd: Remove unused "brl->key" struct element
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Sun Oct  6 15:49:43 CEST 2013 on sn-devel-104

commit e9513bc6ab2974899a3f6ddc73886e969b142502
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Sep 15 19:18:41 2013 -0700

    smbd: Convert some dbgtxt to DEBUG
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 3a72cdb33aa34fa1d950b73c6ab6698bdc364bb4
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Sep 26 21:27:42 2013 -0700

    torture: Remove an unused variable
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 960bd9a584a27bde45433be1ca869b2197cf465d
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Sep 26 21:21:21 2013 -0700

    torture: Continue buffer check after NOT_IMPLEMENTED infolevels
    
    Patch from the SDC plugfest. Not every implementation supports every
    infolevel, and we want to be able to test buffersize error behaviour
    for all supported infolevels
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit c944d2ea41456d27e1f327f9e50b70c0bbbde824
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Sep 26 17:10:50 2013 -0700

    libcli: Correct smb2_lease_pull
    
    We don't really use leases yet, so so far this went by unnoticed. It's
    the V2 lease requests that hold the parent lease key, not the V1 ones.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit eb5e817a73ab158c8f106ac6ae0503d70a315d7f
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Aug 21 10:27:43 2013 +0000

    libcli: Add const to smb2_lease_pull
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit b40fcf3f17e4ed9dde31dff73e4669d867753941
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Sep 22 17:19:09 2013 -0700

    torture: Fix a typo
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit c134a37df3084d794267730612e38451887a2fc2
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Oct 2 15:20:16 2013 +0000

    smbd: Fix a comment
    
    This has been converted from a timed event to an immediate one in
    e7dab403c0ca6f6
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 41857bd0f73bf294fa98d6e697ac563297b24310
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Sep 3 13:31:27 2013 +0000

    smbd: Fix confusing comments
    
    The brlock-check is done in grant_fsp_oplock_type
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 4cde5bf1a406e14fcc7a51eba1e337fd1d3c80b3
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Sep 22 19:16:56 2013 -0700

    smbd: Avoid calling serverid_exists twice
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

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

Summary of changes:
 libcli/smb/smb2_lease.c        |   11 ++++++-----
 libcli/smb/smb2_lease.h        |    3 ++-
 source3/locking/brlock.c       |    4 +---
 source3/locking/locking.c      |    6 ++++++
 source3/smbd/open.c            |    3 +--
 source3/smbd/oplock.c          |   36 ++++++++++++++----------------------
 source4/torture/raw/streams.c  |    2 +-
 source4/torture/smb2/getinfo.c |    4 +++-
 8 files changed, 34 insertions(+), 35 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libcli/smb/smb2_lease.c b/libcli/smb/smb2_lease.c
index 10beaca..f97f096 100644
--- a/libcli/smb/smb2_lease.c
+++ b/libcli/smb/smb2_lease.c
@@ -23,7 +23,8 @@
 #include "includes.h"
 #include "../libcli/smb/smb_common.h"
 
-ssize_t smb2_lease_pull(uint8_t *buf, size_t len, struct smb2_lease *lease)
+ssize_t smb2_lease_pull(const uint8_t *buf, size_t len,
+			struct smb2_lease *lease)
 {
 	int version;
 
@@ -45,13 +46,13 @@ ssize_t smb2_lease_pull(uint8_t *buf, size_t len, struct smb2_lease *lease)
 
 	switch (version) {
 	case 1:
-		memcpy(&lease->parent_lease_key, buf+32, 16);
-		lease->lease_epoch = SVAL(buf, 48);
-		break;
-	case 2:
 		ZERO_STRUCT(lease->parent_lease_key);
 		lease->lease_epoch = 0;
 		break;
+	case 2:
+		memcpy(&lease->parent_lease_key, buf+32, 16);
+		lease->lease_epoch = SVAL(buf, 48);
+		break;
 	}
 
 	return len;
diff --git a/libcli/smb/smb2_lease.h b/libcli/smb/smb2_lease.h
index fa8e7af..73f97ac 100644
--- a/libcli/smb/smb2_lease.h
+++ b/libcli/smb/smb2_lease.h
@@ -44,7 +44,8 @@ struct smb2_lease {
  * Parse a smb2 lease create context. Return -1 on error, buffer.length on
  * success. V1 and V2 differ only by length of buffer.length
  */
-ssize_t smb2_lease_pull(uint8_t *buf, size_t len, struct smb2_lease *lease);
+ssize_t smb2_lease_pull(const uint8_t *buf, size_t len,
+			struct smb2_lease *lease);
 bool smb2_lease_push(const struct smb2_lease *lease, uint8_t *buf, size_t len);
 
 #endif /* _LIBCLI_SMB_SMB2_LEASE_H_ */
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c
index adbfc5f..ee4354c 100644
--- a/source3/locking/brlock.c
+++ b/source3/locking/brlock.c
@@ -48,7 +48,6 @@ struct byte_range_lock {
 	unsigned int num_locks;
 	bool modified;
 	bool read_only;
-	struct file_id key;
 	struct lock_struct *lock_data;
 	struct db_record *record;
 };
@@ -1944,9 +1943,8 @@ static struct byte_range_lock *brl_get_locks_internal(TALLOC_CTX *mem_ctx,
 	br_lck->fsp = fsp;
 	br_lck->num_locks = 0;
 	br_lck->modified = False;
-	br_lck->key = fsp->file_id;
 
-	key.dptr = (uint8 *)&br_lck->key;
+	key.dptr = (uint8 *)&fsp->file_id;
 	key.dsize = sizeof(struct file_id);
 
 	if (!fsp->lockdb_clean) {
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index d4c68f8..d0b6eaf 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -646,6 +646,12 @@ bool share_mode_stale_pid(struct share_mode_data *d, unsigned idx)
 		return false;
 	}
 	e = &d->share_modes[idx];
+	if (e->stale) {
+		/*
+		 * Checked before
+		 */
+		return true;
+	}
 	if (serverid_exists(&e->pid)) {
 		DEBUG(10, ("PID %s (index %u out of %u) still exists\n",
 			   procid_str_static(&e->pid), idx,
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 1a86233..858d2be 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -2676,8 +2676,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
 	status = set_file_oplock(fsp, fsp->oplock_type);
 	if (!NT_STATUS_IS_OK(status)) {
 		/*
-		 * Could not get the kernel oplock or there are byte-range
-		 * locks on the file.
+		 * Could not get the kernel oplock
 		 */
 		fsp->oplock_type = NO_OPLOCK;
 	}
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index 96c451c..70f168e 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -47,8 +47,7 @@ void break_kernel_oplock(struct messaging_context *msg_ctx, files_struct *fsp)
 
 /****************************************************************************
  Attempt to set an oplock on a file. Succeeds if kernel oplocks are
- disabled (just sets flags) and no byte-range locks in the file. Returns True
- if oplock set.
+ disabled (just sets flags).
 ****************************************************************************/
 
 NTSTATUS set_file_oplock(files_struct *fsp, int oplock_type)
@@ -256,13 +255,11 @@ static files_struct *initial_break_processing(
 {
 	files_struct *fsp = NULL;
 
-	if( DEBUGLVL( 3 ) ) {
-		dbgtext( "initial_break_processing: called for %s/%u\n",
-			 file_id_string_tos(&id), (int)file_id);
-		dbgtext( "Current oplocks_open (exclusive = %d, levelII = %d)\n",
-			sconn->oplocks.exclusive_open,
-			sconn->oplocks.level_II_open);
-	}
+	DEBUG(3, ("initial_break_processing: called for %s/%u\n"
+		  "Current oplocks_open (exclusive = %d, levelII = %d)\n",
+		  file_id_string_tos(&id), (int)file_id,
+		  sconn->oplocks.exclusive_open,
+		  sconn->oplocks.level_II_open));
 
 	/*
 	 * We need to search the file open table for the
@@ -274,11 +271,9 @@ static files_struct *initial_break_processing(
 
 	if(fsp == NULL) {
 		/* The file could have been closed in the meantime - return success. */
-		if( DEBUGLVL( 3 ) ) {
-			dbgtext( "initial_break_processing: cannot find open file with " );
-			dbgtext( "file_id %s gen_id = %lu, ", file_id_string_tos(&id), file_id);
-			dbgtext( "allowing break to succeed.\n" );
-		}
+		DEBUG(3, ("initial_break_processing: cannot find open file "
+			  "with file_id %s gen_id = %lu, allowing break to "
+			  "succeed.\n", file_id_string_tos(&id), file_id));
 		return NULL;
 	}
 
@@ -293,13 +288,10 @@ static files_struct *initial_break_processing(
 	 */
 
 	if(fsp->oplock_type == NO_OPLOCK) {
-		if( DEBUGLVL( 3 ) ) {
-			dbgtext( "initial_break_processing: file %s ",
-				 fsp_str_dbg(fsp));
-			dbgtext( "(file_id = %s gen_id = %lu) has no oplock.\n",
-				 file_id_string_tos(&id), fsp->fh->gen_id );
-			dbgtext( "Allowing break to succeed regardless.\n" );
-		}
+		DEBUG(3, ("initial_break_processing: file %s (file_id = %s "
+			  "gen_id = %lu) has no oplock. Allowing break to "
+			  "succeed regardless.\n", fsp_str_dbg(fsp),
+			  file_id_string_tos(&id), fsp->fh->gen_id));
 		return NULL;
 	}
 
@@ -646,7 +638,7 @@ static void contend_level2_oplocks_begin_default(files_struct *fsp,
 	 * When we get here we might have a brlock entry locked. Also
 	 * locking the share mode entry would violate the locking
 	 * order. Breaking level2 oplocks to none is asynchronous
-	 * anyway, so we postpone this into an immediate timed event.
+	 * anyway, so we postpone this into an immediate event.
 	 */
 
 	state = talloc(sconn, struct break_to_none_state);
diff --git a/source4/torture/raw/streams.c b/source4/torture/raw/streams.c
index 1611c64..cbb7dcf 100644
--- a/source4/torture/raw/streams.c
+++ b/source4/torture/raw/streams.c
@@ -478,7 +478,7 @@ done:
  * A stream held open with FILE_SHARE_DELETE allows the file to be
  * deleted. After the main file is deleted, access to the open file descriptor
  * still works, but all name-based access to both the main file as well as the
- * stream is denied with DELETE ending.
+ * stream is denied with DELETE pending.
  *
  * This means, an open of the main file with SEC_STD_DELETE should walk all
  * streams and also open them with SEC_STD_DELETE. If any of these opens gives
diff --git a/source4/torture/smb2/getinfo.c b/source4/torture/smb2/getinfo.c
index fafc36c..427fdd9 100644
--- a/source4/torture/smb2/getinfo.c
+++ b/source4/torture/smb2/getinfo.c
@@ -328,6 +328,9 @@ static bool torture_smb2_qfile_buffercheck(struct torture_context *tctx)
 		b.in.output_buffer_length	= 65535;
 
 		status = smb2_getinfo(tree, tree, &b);
+		if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED)) {
+			continue;
+		}
 		torture_assert_ntstatus_equal(
 			tctx, status, NT_STATUS_OK,
 			"Wrong error code for large buffer");
@@ -349,7 +352,6 @@ static bool torture_smb2_qsec_buffercheck(struct torture_context *tctx)
 	struct smb2_create c;
 	NTSTATUS status;
 	struct smb2_handle handle;
-	int i;
 
 	printf("Testing SMB2_GETINFO_SECURITY buffer sizes\n");
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list