[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Sep 10 19:55:04 MDT 2014


The branch, master has been updated
       via  0c53b29 vfs_acl_common: dacl size must be updated
       via  29b00ca s3: smbd: Ensure we don't call qsort() with a size of -1.
       via  9da09b5 s3:smbd:open_file: use a more natural check.
      from  c7c1f64 s4:torture:base: slightly more generous timing in the defer_open test

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


- Log -----------------------------------------------------------------
commit 0c53b293ab5c11fd78bccd4ac832ea16df5c3f80
Author: Ralph Boehme <rb at sernet.de>
Date:   Mon Sep 8 20:53:44 2014 +0200

    vfs_acl_common: dacl size must be updated
    
    Signed-off-by: Ralph Boehme <rb at sernet.de>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Simo Sorce <idra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Sep 11 03:54:42 CEST 2014 on sn-devel-104

commit 29b00ca2bd5f8fae383dbe6598126eb108a78d36
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Sep 8 16:16:24 2014 -0700

    s3: smbd: Ensure we don't call qsort() with a size of -1.
    
    Based on a patch idea from Ken Harris <kharris at mathworks.com>
    
    Fixes bug 10798 - crash in source3/smbd/notify.c
    
    https://bugzilla.samba.org/show_bug.cgi?id=10798
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>

commit 9da09b52e8cc0453e694d85fc2bd82994138e20b
Author: Michael Adam <obnox at samba.org>
Date:   Wed Sep 10 21:58:04 2014 +0200

    s3:smbd:open_file: use a more natural check.
    
    As suggested by Jeremy Allison <jra at samba.org>.
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 source3/modules/vfs_acl_common.c |    3 +++
 source3/smbd/notify.c            |   32 ++++++++++++++++----------------
 source3/smbd/open.c              |    4 +++-
 3 files changed, 22 insertions(+), 17 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c
index 57fc6c8..b749157 100644
--- a/source3/modules/vfs_acl_common.c
+++ b/source3/modules/vfs_acl_common.c
@@ -343,6 +343,9 @@ static NTSTATUS add_directory_inheritable_components(vfs_handle_struct *handle,
 	if (psd->dacl) {
 		psd->dacl->aces = new_ace_list;
 		psd->dacl->num_aces += 3;
+		psd->dacl->size += new_ace_list[num_aces].size +
+			new_ace_list[num_aces+1].size +
+			new_ace_list[num_aces+2].size;
 	} else {
 		psd->dacl = make_sec_acl(psd,
 				NT4_ACL_REVISION,
diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c
index dd4dc1a..ac1a55c 100644
--- a/source3/smbd/notify.c
+++ b/source3/smbd/notify.c
@@ -105,6 +105,14 @@ static bool notify_change_record_identical(struct notify_change_event *c1,
 	return False;
 }
 
+static int compare_notify_change_events(const void *p1, const void *p2)
+{
+	const struct notify_change_event *e1 = p1;
+	const struct notify_change_event *e2 = p2;
+
+	return timespec_compare(&e1->when, &e2->when);
+}
+
 static bool notify_marshall_changes(int num_changes,
 				uint32 max_offset,
 				struct notify_change_event *changes,
@@ -116,6 +124,14 @@ static bool notify_marshall_changes(int num_changes,
 		return false;
 	}
 
+	/*
+	 * Sort the notifies by timestamp when the event happened to avoid
+	 * coalescing and thus dropping events.
+	 */
+
+	qsort(changes, num_changes,
+	      sizeof(*changes), compare_notify_change_events);
+
 	for (i=0; i<num_changes; i++) {
 		enum ndr_err_code ndr_err;
 		struct notify_change_event *c;
@@ -170,14 +186,6 @@ static bool notify_marshall_changes(int num_changes,
 	return True;
 }
 
-static int compare_notify_change_events(const void *p1, const void *p2)
-{
-	const struct notify_change_event *e1 = p1;
-	const struct notify_change_event *e2 = p2;
-
-	return timespec_compare(&e1->when, &e2->when);
-}
-
 /****************************************************************************
  Setup the common parts of the return packet and send it.
 *****************************************************************************/
@@ -202,14 +210,6 @@ void change_notify_reply(struct smb_request *req,
 		return;
 	}
 
-	/*
-	 * Sort the notifies by timestamp when the event happened to avoid
-	 * coalescing and thus dropping events in notify_marshall_changes.
-	 */
-
-	qsort(notify_buf->changes, notify_buf->num_changes,
-	      sizeof(*(notify_buf->changes)), compare_notify_change_events);
-
 	if (!notify_marshall_changes(notify_buf->num_changes, max_param,
 					notify_buf->changes, &blob)) {
 		/*
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index a33cce1..6261a44 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -835,7 +835,9 @@ static NTSTATUS open_file(files_struct *fsp,
 					return status;
 				}
 
-				if (!NT_STATUS_IS_OK(status)) {
+				if (NT_STATUS_EQUAL(status,
+					NT_STATUS_OBJECT_NAME_NOT_FOUND))
+				{
 					DEBUG(10, ("open_file: "
 						"file %s vanished since we "
 						"checked for existence.\n",


-- 
Samba Shared Repository


More information about the samba-cvs mailing list