[SCM] Samba Shared Repository - branch v4-5-test updated

Karolin Seeger kseeger at samba.org
Fri Apr 28 11:18:02 UTC 2017


The branch, v4-5-test has been updated
       via  bc62091 vfs_fruit: lp_case_sensitive() does not return a bool
       via  68461b9 vfs_acl_xattr|tdb: ensure create mask is at least 0666 if ignore_system_acls is set
       via  36ff82f lib: Fix CID 1373623 Dereference after null check
       via  6800744 notify: Fix ordering of events in notifyd
      from  bd0f2e8 cleanupdb: Fix a memory read error

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-5-test


- Log -----------------------------------------------------------------
commit bc6209116841bcd30a0c109e07df9e0801fd0ba9
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Apr 19 13:12:55 2017 +0200

    vfs_fruit: lp_case_sensitive() does not return a bool
    
    lp_case_sensitive() returns an int, not a bool, so with the default
    setting of "Auto" by default we set the AAPL flag
    SMB2_CRTCTX_AAPL_CASE_SENSITIVE.
    
    This caused the client to believe the volume is case sensitive where it
    wasn't, leading to an error when trying to rename files changing only
    the case of the name.
    
    Also fix the existing torture test that verifies AAPL context
    negotiation and actually expected the server to return "case sensitive",
    while the Samba default is really "case insensitive".
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12749
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 36612723b2b18675116b6197183bdfe5e1d9e06f)
    
    Autobuild-User(v4-5-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-5-test): Fri Apr 28 13:17:19 CEST 2017 on sn-devel-144

commit 68461b9a0e20a802004a770ae618f26729ff6ba1
Author: Ralph Boehme <slow at samba.org>
Date:   Mon Feb 6 12:47:41 2017 +0100

    vfs_acl_xattr|tdb: ensure create mask is at least 0666 if ignore_system_acls is set
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12562
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Thu Apr 20 20:50:10 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 375d772d04338861d92e683ae3c6c9d7ecb846ad)

commit 36ff82f57bd06005431a90789312293440e88ecb
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Oct 12 12:35:12 2016 +0200

    lib: Fix CID 1373623 Dereference after null check
    
    We should not overload "p", this is used in the outer loop
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12276
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 6ec81ca3c196f3c4659a4e1c473759b393708d12)

commit 68007442da768517d623ff306764d126222607e0
Author: Shilpa Krishnareddy <skrishnareddy at panzura.com>
Date:   Tue Apr 25 16:59:45 2017 +0200

    notify: Fix ordering of events in notifyd
    
    In notifyd_trigger_parser() while initializing notify_event_msg values from
    notify_trigger_msg, 'when' value is ignored. So the smbd process does not get
    correct 'when' value and this is causing issues during qsort in
    notify_marshall_changes(). Because of this issue, smb2.notify.dir test was
    failing.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12756
    Signed-off-by: Shilpa Krishnareddy <skrishnareddy at panzura.com>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Wed Apr 26 17:02:58 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 5701880655c8a82b6d533c7c2e131cc803e7570b)

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

Summary of changes:
 source3/lib/substitute.c        |  7 ++++---
 source3/modules/vfs_acl_tdb.c   | 24 +++++++++++++++++++++---
 source3/modules/vfs_acl_xattr.c | 24 +++++++++++++++++++++---
 source3/modules/vfs_fruit.c     | 20 +++++++++++++++++---
 source3/smbd/notifyd/notifyd.c  |  3 ++-
 source4/torture/vfs/fruit.c     |  4 ++--
 6 files changed, 67 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index 1f98327..f56e2c4 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -524,9 +524,10 @@ char *talloc_sub_basic(TALLOC_CTX *mem_ctx,
 
 				group_name = gidtoname(pass->pw_gid);
 				if (is_domain_name) {
-					p = strchr_m(group_name, *sep);
-					if (p != NULL) {
-						group_name = p + 1;
+					char *group_sep;
+					group_sep = strchr_m(group_name, *sep);
+					if (group_sep != NULL) {
+						group_name = group_sep + 1;
 					}
 				}
 				a_string = realloc_string_sub(a_string,
diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c
index 174affe..a71bfdc 100644
--- a/source3/modules/vfs_acl_tdb.c
+++ b/source3/modules/vfs_acl_tdb.c
@@ -342,12 +342,30 @@ static int connect_acl_tdb(struct vfs_handle_struct *handle,
 				return -1);
 
 	if (config->ignore_system_acls) {
-		DBG_NOTICE("setting 'create mask = 0666', "
-			   "'directory mask = 0777', "
+		mode_t create_mask = lp_create_mask(SNUM(handle->conn));
+		char *create_mask_str = NULL;
+
+		if ((create_mask & 0666) != 0666) {
+			create_mask |= 0666;
+			create_mask_str = talloc_asprintf(handle, "0%o",
+							  create_mask);
+			if (create_mask_str == NULL) {
+				DBG_ERR("talloc_asprintf failed\n");
+				return -1;
+			}
+
+			DBG_NOTICE("setting 'create mask = %s'\n", create_mask_str);
+
+			lp_do_parameter (SNUM(handle->conn),
+					"create mask", create_mask_str);
+
+			TALLOC_FREE(create_mask_str);
+		}
+
+		DBG_NOTICE("setting 'directory mask = 0777', "
 			   "'store dos attributes = yes' and all "
 			   "'map ...' options to 'no'\n");
 
-		lp_do_parameter(SNUM(handle->conn), "create mask", "0666");
 		lp_do_parameter(SNUM(handle->conn), "directory mask", "0777");
 		lp_do_parameter(SNUM(handle->conn), "map archive", "no");
 		lp_do_parameter(SNUM(handle->conn), "map hidden", "no");
diff --git a/source3/modules/vfs_acl_xattr.c b/source3/modules/vfs_acl_xattr.c
index 421860b..bb2e565 100644
--- a/source3/modules/vfs_acl_xattr.c
+++ b/source3/modules/vfs_acl_xattr.c
@@ -243,12 +243,30 @@ static int connect_acl_xattr(struct vfs_handle_struct *handle,
 				return -1);
 
 	if (config->ignore_system_acls) {
-		DBG_NOTICE("setting 'create mask = 0666', "
-			   "'directory mask = 0777', "
+		mode_t create_mask = lp_create_mask(SNUM(handle->conn));
+		char *create_mask_str = NULL;
+
+		if ((create_mask & 0666) != 0666) {
+			create_mask |= 0666;
+			create_mask_str = talloc_asprintf(handle, "0%o",
+							  create_mask);
+			if (create_mask_str == NULL) {
+				DBG_ERR("talloc_asprintf failed\n");
+				return -1;
+			}
+
+			DBG_NOTICE("setting 'create mask = %s'\n", create_mask_str);
+
+			lp_do_parameter (SNUM(handle->conn),
+					"create mask", create_mask_str);
+
+			TALLOC_FREE(create_mask_str);
+		}
+
+		DBG_NOTICE("setting 'directory mask = 0777', "
 			   "'store dos attributes = yes' and all "
 			   "'map ...' options to 'no'\n");
 
-		lp_do_parameter(SNUM(handle->conn), "create mask", "0666");
 		lp_do_parameter(SNUM(handle->conn), "directory mask", "0777");
 		lp_do_parameter(SNUM(handle->conn), "map archive", "no");
 		lp_do_parameter(SNUM(handle->conn), "map hidden", "no");
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 4437d45..a03f454 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -2186,9 +2186,23 @@ static NTSTATUS check_aapl(vfs_handle_struct *handle,
 	}
 
 	if (req_bitmap & SMB2_CRTCTX_AAPL_VOLUME_CAPS) {
-		SBVAL(p, 0,
-		      lp_case_sensitive(SNUM(handle->conn->tcon->compat)) ?
-		      SMB2_CRTCTX_AAPL_CASE_SENSITIVE : 0);
+		int val = lp_case_sensitive(SNUM(handle->conn->tcon->compat));
+		uint64_t caps = 0;
+
+		switch (val) {
+		case Auto:
+			break;
+
+		case True:
+			caps |= SMB2_CRTCTX_AAPL_CASE_SENSITIVE;
+			break;
+
+		default:
+			break;
+		}
+
+		SBVAL(p, 0, caps);
+
 		ok = data_blob_append(req, &blob, p, 8);
 		if (!ok) {
 			return NT_STATUS_UNSUCCESSFUL;
diff --git a/source3/smbd/notifyd/notifyd.c b/source3/smbd/notifyd/notifyd.c
index 69d30f7..d7d1428 100644
--- a/source3/smbd/notifyd/notifyd.c
+++ b/source3/smbd/notifyd/notifyd.c
@@ -732,7 +732,8 @@ static void notifyd_trigger_parser(TDB_DATA key, TDB_DATA data,
 
 {
 	struct notifyd_trigger_state *tstate = private_data;
-	struct notify_event_msg msg = { .action = tstate->msg->action };
+	struct notify_event_msg msg = { .action = tstate->msg->action,
+					.when = tstate->msg->when };
 	struct iovec iov[2];
 	size_t path_len = key.dsize;
 	struct notifyd_instance *instances = NULL;
diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c
index eed3266..6c3fee9 100644
--- a/source4/torture/vfs/fruit.c
+++ b/source4/torture/vfs/fruit.c
@@ -2068,9 +2068,9 @@ static bool test_aapl(struct torture_context *tctx,
 	}
 
 	aapl_vol_caps = BVAL(aapl->data.data, 24);
-	if (aapl_vol_caps != SMB2_CRTCTX_AAPL_CASE_SENSITIVE) {
+	if (aapl_vol_caps != 0) {
 		/* this will fail on a case insensitive fs ... */
-		torture_warning(tctx,
+		torture_result(tctx, TORTURE_FAIL,
 				"(%s) unexpected vol_caps: %d",
 				__location__, (int)aapl_vol_caps);
 	}


-- 
Samba Shared Repository



More information about the samba-cvs mailing list