[SCM] Samba Shared Repository - branch master updated

Ralph Böhme slow at samba.org
Wed Mar 21 17:40:02 UTC 2018


The branch, master has been updated
       via  80f9ec0 talloc: version 2.1.12
       via  41b6810 talloc: use a library destructor instead of atexit() if available
       via  4a7eaf9 talloc: Fix size type and checks in _vasprintf_tc
       via  5c909ea s3: smbd: Fruit. Make the use of dom_sid_compare_domain() much clearer.
      from  9312a1c samba-tool visualize: fix python2.6 incompatibility

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


- Log -----------------------------------------------------------------
commit 80f9ec016496087bca06d3c34b6f687f0dc145ac
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Mar 21 08:24:06 2018 +0100

    talloc: version 2.1.12
    
    * Fix documentation typo
    * Fix compilation with -Wstrict-overflow=2
    * Use a library destructor instead of atexit() if available
      (bug #7587)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Wed Mar 21 18:39:33 CET 2018 on sn-devel-144

commit 41b6810ba01f44537f470c806adb8686e1a39c48
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Mar 20 16:48:33 2018 +0100

    talloc: use a library destructor instead of atexit() if available
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=7587
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 4a7eaf909d7f139462351c43ef1dbb2915f8490f
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Mar 21 11:55:45 2018 +0100

    talloc: Fix size type and checks in _vasprintf_tc
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 5c909ea4530d4e7e4aa27046c45e3e48b094a411
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Mar 19 15:46:41 2018 -0700

    s3: smbd: Fruit. Make the use of dom_sid_compare_domain() much clearer.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13319
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

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

Summary of changes:
 ...-util-2.1.10.sigs => pytalloc-util-2.1.12.sigs} |  0
 ...3-2.1.10.sigs => pytalloc-util.py3-2.1.12.sigs} |  0
 .../ABI/{talloc-2.1.10.sigs => talloc-2.1.12.sigs} |  0
 lib/talloc/talloc.c                                | 83 ++++++++++++++--------
 lib/talloc/wscript                                 |  2 +-
 source3/modules/vfs_fruit.c                        |  5 +-
 6 files changed, 56 insertions(+), 34 deletions(-)
 copy lib/talloc/ABI/{pytalloc-util-2.1.10.sigs => pytalloc-util-2.1.12.sigs} (100%)
 copy lib/talloc/ABI/{pytalloc-util.py3-2.1.10.sigs => pytalloc-util.py3-2.1.12.sigs} (100%)
 copy lib/talloc/ABI/{talloc-2.1.10.sigs => talloc-2.1.12.sigs} (100%)


Changeset truncated at 500 lines:

diff --git a/lib/talloc/ABI/pytalloc-util-2.1.10.sigs b/lib/talloc/ABI/pytalloc-util-2.1.12.sigs
similarity index 100%
copy from lib/talloc/ABI/pytalloc-util-2.1.10.sigs
copy to lib/talloc/ABI/pytalloc-util-2.1.12.sigs
diff --git a/lib/talloc/ABI/pytalloc-util.py3-2.1.10.sigs b/lib/talloc/ABI/pytalloc-util.py3-2.1.12.sigs
similarity index 100%
copy from lib/talloc/ABI/pytalloc-util.py3-2.1.10.sigs
copy to lib/talloc/ABI/pytalloc-util.py3-2.1.12.sigs
diff --git a/lib/talloc/ABI/talloc-2.1.10.sigs b/lib/talloc/ABI/talloc-2.1.12.sigs
similarity index 100%
copy from lib/talloc/ABI/talloc-2.1.10.sigs
copy to lib/talloc/ABI/talloc-2.1.12.sigs
diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c
index cd159ef..ce3bda4 100644
--- a/lib/talloc/talloc.c
+++ b/lib/talloc/talloc.c
@@ -121,8 +121,12 @@ static unsigned int talloc_magic = TALLOC_MAGIC_NON_RANDOM;
    NULL
 */
 static void *null_context;
+static bool talloc_report_null;
+static bool talloc_report_null_full;
 static void *autofree_context;
 
+static void talloc_setup_atexit(void);
+
 /* used to enable fill of memory on free, which can be useful for
  * catching use after free errors when valgrind is too slow
  */
@@ -426,6 +430,41 @@ void talloc_lib_init(void)
 #warning "No __attribute__((constructor)) support found on this platform, additional talloc security measures not available"
 #endif
 
+#ifdef HAVE_DESTRUCTOR_ATTRIBUTE
+void talloc_lib_fini(void) __attribute__((destructor));
+void talloc_lib_fini(void)
+#else /* ! HAVE_DESTRUCTOR_ATTRIBUTE */
+static void talloc_lib_fini(void)
+#endif /* ! HAVE_DESTRUCTOR_ATTRIBUTE */
+{
+	TALLOC_FREE(autofree_context);
+
+	if (talloc_total_size(null_context) == 0) {
+		return;
+	}
+
+	if (talloc_report_null_full) {
+		talloc_report_full(null_context, stderr);
+	} else if (talloc_report_null) {
+		talloc_report(null_context, stderr);
+	}
+}
+
+static void talloc_setup_atexit(void)
+{
+#ifndef HAVE_DESTRUCTOR_ATTRIBUTE
+	static bool done;
+
+	if (done) {
+		return;
+	}
+
+#warning "No __attribute__((destructor)) support found on this platform, using atexit"
+	atexit(talloc_lib_fini);
+	done = true;
+#endif /* ! HAVE_DESTRUCTOR_ATTRIBUTE */
+}
+
 static void talloc_log(const char *fmt, ...) PRINTF_ATTRIBUTE(1,2);
 static void talloc_log(const char *fmt, ...)
 {
@@ -2295,26 +2334,6 @@ _PUBLIC_ void talloc_report(const void *ptr, FILE *f)
 }
 
 /*
-  report on any memory hanging off the null context
-*/
-static void talloc_report_null(void)
-{
-	if (talloc_total_size(null_context) != 0) {
-		talloc_report(null_context, stderr);
-	}
-}
-
-/*
-  report on any memory hanging off the null context
-*/
-static void talloc_report_null_full(void)
-{
-	if (talloc_total_size(null_context) != 0) {
-		talloc_report_full(null_context, stderr);
-	}
-}
-
-/*
   enable tracking of the NULL context
 */
 _PUBLIC_ void talloc_enable_null_tracking(void)
@@ -2369,7 +2388,8 @@ _PUBLIC_ void talloc_disable_null_tracking(void)
 _PUBLIC_ void talloc_enable_leak_report(void)
 {
 	talloc_enable_null_tracking();
-	atexit(talloc_report_null);
+	talloc_report_null = true;
+	talloc_setup_atexit();
 }
 
 /*
@@ -2378,7 +2398,8 @@ _PUBLIC_ void talloc_enable_leak_report(void)
 _PUBLIC_ void talloc_enable_leak_report_full(void)
 {
 	talloc_enable_null_tracking();
-	atexit(talloc_report_null_full);
+	talloc_report_null_full = true;
+	talloc_setup_atexit();
 }
 
 /*
@@ -2554,7 +2575,8 @@ static struct talloc_chunk *_vasprintf_tc(const void *t,
 					  const char *fmt,
 					  va_list ap)
 {
-	int len;
+	int vlen;
+	size_t len;
 	char *ret;
 	va_list ap2;
 	struct talloc_chunk *tc;
@@ -2562,9 +2584,13 @@ static struct talloc_chunk *_vasprintf_tc(const void *t,
 
 	/* this call looks strange, but it makes it work on older solaris boxes */
 	va_copy(ap2, ap);
-	len = vsnprintf(buf, sizeof(buf), fmt, ap2);
+	vlen = vsnprintf(buf, sizeof(buf), fmt, ap2);
 	va_end(ap2);
-	if (unlikely(len < 0)) {
+	if (unlikely(vlen < 0)) {
+		return NULL;
+	}
+	len = vlen;
+	if (unlikely(len + 1 < len)) {
 		return NULL;
 	}
 
@@ -2760,11 +2786,6 @@ static int talloc_autofree_destructor(void *ptr)
 	return 0;
 }
 
-static void talloc_autofree(void)
-{
-	talloc_free(autofree_context);
-}
-
 /*
   return a context which will be auto-freed on exit
   this is useful for reducing the noise in leak reports
@@ -2774,7 +2795,7 @@ _PUBLIC_ void *talloc_autofree_context(void)
 	if (autofree_context == NULL) {
 		autofree_context = _talloc_named_const(NULL, 0, "autofree_context");
 		talloc_set_destructor(autofree_context, talloc_autofree_destructor);
-		atexit(talloc_autofree);
+		talloc_setup_atexit();
 	}
 	return autofree_context;
 }
diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index 0afa162..6320021 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'talloc'
-VERSION = '2.1.11'
+VERSION = '2.1.12'
 
 
 blddir = 'bin'
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 19b78ed..1a05d0b 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -2965,9 +2965,10 @@ static NTSTATUS remove_virtual_nfs_aces(struct security_descriptor *psd)
 
 	for (i = 0; i < psd->dacl->num_aces; i++) {
 		/* MS NFS style mode/uid/gid */
-		if (!dom_sid_compare_domain(
+		int cmp = dom_sid_compare_domain(
 				&global_sid_Unix_NFS,
-				&psd->dacl->aces[i].trustee) == 0) {
+				&psd->dacl->aces[i].trustee);
+		if (cmp != 0) {
 			/* Normal ACE entry. */
 			continue;
 		}


-- 
Samba Shared Repository



More information about the samba-cvs mailing list