[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Thu Nov 19 09:06:03 UTC 2015


The branch, master has been updated
       via  155eeac lib: Fix memalign_array overflow protection
       via  69e427e idl: Some CC can't find indented #defines
       via  12b9b77 idl: Avoid // style comments
       via  5f6c4fa libreplace: Only check for malloc.h if needed
       via  b64f249 libreplace: Put the malloc.h check on a line of its own
       via  4dfa4ed libreplace: Only check malloc.h once
      from  bf06a51 Set LD_LIBRARY_PATH during tests.

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


- Log -----------------------------------------------------------------
commit 155eeac5ac9db6742b51ba9da57ef6eb0a796aed
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Nov 18 13:13:57 2015 +0100

    lib: Fix memalign_array overflow protection
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Thu Nov 19 10:05:08 CET 2015 on sn-devel-104

commit 69e427ecee84777906b46ddbf63a7d0bb3b8ed39
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Nov 16 16:23:10 2015 +0100

    idl: Some CC can't find indented #defines
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 12b9b770283c47f307e4ea7a8683762a25b35de5
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Nov 16 16:11:48 2015 +0100

    idl: Avoid // style comments
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 5f6c4fa4860f794d25f1fcc2e557ca81cbe90183
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jun 30 15:46:21 2014 +0200

    libreplace: Only check for malloc.h if needed
    
    OpenBSD complains that malloc.h is deprecated on every gcc invocation.
    That hides a lot of real warnings. malloc and friends nowadays are
    typically defined in stdlib.h, only check there.
    
    We need memalign. On OpenBSD this does not exist, so libreplace replaces
    it. The wscript test in libreplace only checks whether memalign can
    link. Unfortunately in glibc memalign comes from malloc.h.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit b64f24971c5930ff382af6f69ab1fd84b4024fbf
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jun 30 15:15:37 2014 +0200

    libreplace: Put the malloc.h check on a line of its own
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 4dfa4edd1bf3cca42deec514e30e6962c6794647
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jun 30 13:52:02 2014 +0200

    libreplace: Only check malloc.h once
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

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

Summary of changes:
 lib/replace/wscript    | 13 +++++++++++--
 lib/util/util.c        |  2 +-
 librpc/idl/clusapi.idl | 26 +++++++++++++-------------
 3 files changed, 25 insertions(+), 16 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/replace/wscript b/lib/replace/wscript
index 7bfe7ee..37cbbb7 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -43,7 +43,12 @@ def configure(conf):
     conf.CHECK_HEADERS('sys/id.h sys/ioctl.h sys/ipc.h sys/mman.h sys/mode.h sys/ndir.h sys/priv.h')
     conf.CHECK_HEADERS('sys/resource.h sys/security.h sys/shm.h sys/statfs.h sys/statvfs.h sys/termio.h')
     conf.CHECK_HEADERS('sys/vfs.h sys/xattr.h termio.h termios.h sys/file.h')
-    conf.CHECK_HEADERS('sys/ucontext.h sys/wait.h sys/stat.h malloc.h grp.h')
+    conf.CHECK_HEADERS('sys/ucontext.h sys/wait.h sys/stat.h')
+
+    if not conf.CHECK_DECLS('malloc', headers='stdlib.h'):
+        conf.CHECK_HEADERS('malloc.h')
+
+    conf.CHECK_HEADERS('grp.h')
     conf.CHECK_HEADERS('sys/select.h setjmp.h utime.h sys/syslog.h syslog.h')
     conf.CHECK_HEADERS('stdarg.h vararg.h sys/mount.h mntent.h')
     conf.CHECK_HEADERS('stropts.h unix.h string.h strings.h sys/param.h limits.h')
@@ -71,7 +76,7 @@ def configure(conf):
     conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
     conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
     conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
-    conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h malloc.h')
+    conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
     conf.CHECK_HEADERS('syscall.h sys/syscall.h inttypes.h')
     conf.CHECK_HEADERS('sys/atomic.h')
     conf.CHECK_HEADERS('libgen.h')
@@ -245,6 +250,10 @@ def configure(conf):
     conf.CHECK_FUNCS('link readlink symlink realpath snprintf vsnprintf')
     conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen strtoull __strtoull')
     conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq memalign posix_memalign')
+
+    if conf.CONFIG_SET('HAVE_MEMALIGN'):
+        conf.CHECK_DECLS('memalign', headers='malloc.h')
+
     conf.CHECK_FUNCS('prctl dirname basename')
 
     # libbsd on some platforms provides strlcpy and strlcat
diff --git a/lib/util/util.c b/lib/util/util.c
index d8a84da..03edd7f 100644
--- a/lib/util/util.c
+++ b/lib/util/util.c
@@ -773,7 +773,7 @@ void *malloc_array(size_t el_size, unsigned int count)
 
 void *memalign_array(size_t el_size, size_t align, unsigned int count)
 {
-	if (count*el_size >= MAX_MALLOC_SIZE) {
+	if (el_size == 0 || count >= MAX_MALLOC_SIZE/el_size) {
 		return NULL;
 	}
 
diff --git a/librpc/idl/clusapi.idl b/librpc/idl/clusapi.idl
index 3440047..8c4a227 100644
--- a/librpc/idl/clusapi.idl
+++ b/librpc/idl/clusapi.idl
@@ -28,15 +28,15 @@ import "winreg.idl", "misc.idl";
 	typedef [context_handle] void *HNETINTERFACE_RPC;
 	typedef [context_handle] void *HBATCH_PORT_RPC;
 #else
-	#define HCLUSTER_RPC policy_handle
-	#define HNODE_RPC policy_handle
-	#define HGROUP_RPC policy_handle
-	#define HRES_RPC policy_handle
-	#define HKEY_RPC policy_handle
-	#define HNOTIFY_RPC policy_handle
-	#define HNETWORK_RPC policy_handle
-	#define HNETINTERFACE_RPC policy_handle
-	#define HBATCH_PORT_RPC policy_handle
+#define HCLUSTER_RPC policy_handle
+#define HNODE_RPC policy_handle
+#define HGROUP_RPC policy_handle
+#define HRES_RPC policy_handle
+#define HKEY_RPC policy_handle
+#define HNOTIFY_RPC policy_handle
+#define HNETWORK_RPC policy_handle
+#define HNETINTERFACE_RPC policy_handle
+#define HBATCH_PORT_RPC policy_handle
 #endif
 
 	typedef struct {
@@ -2046,7 +2046,7 @@ import "winreg.idl", "misc.idl";
 #endif
 
 	typedef struct {
-		uint32 dwObjectType;	  // really of type CLUSTER_OBJECT_TYPE_RPC
+		uint32 dwObjectType;	  /* really of type CLUSTER_OBJECT_TYPE_RPC */
 		hyper FilterFlags;
 	} NOTIFY_FILTER_AND_TYPE_RPC;
 
@@ -2068,9 +2068,9 @@ import "winreg.idl", "misc.idl";
 	/*****************/
 	/* Function 0x89 */
 
-	//
-	// Notify interface V2 functions
-	//
+	/*
+	 * Notify interface V2 functions
+	 */
 #if 0
 	HNOTIFY_RPC
 	clusapi_CreateNotifyV2(


-- 
Samba Shared Repository



More information about the samba-cvs mailing list