summaryrefslogtreecommitdiff
path: root/lib/util
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util')
-rw-r--r--lib/util/fault.m414
-rw-r--r--lib/util/util.c4
-rw-r--r--lib/util/util.h5
3 files changed, 18 insertions, 5 deletions
diff --git a/lib/util/fault.m4 b/lib/util/fault.m4
index b24e63641c..da077af31d 100644
--- a/lib/util/fault.m4
+++ b/lib/util/fault.m4
@@ -1,5 +1,15 @@
AC_CHECK_HEADERS(execinfo.h)
AC_SEARCH_LIBS_EXT(backtrace, [execinfo], EXECINFO_LIBS)
AC_CHECK_FUNC_EXT(backtrace, $EXECINFO_LIBS)
-SMB_EXT_LIB(EXECINFO,[${EXECINFO_LIBS}])
-SMB_ENABLE(EXECINFO)
+
+
+if test x"$ac_cv_header_execinfo_h" = x"yes" -a x"$ac_cv_func_ext_backtrace" = x"yes";then
+ SMB_ENABLE(EXECINFO, YES)
+ EXECINFO_CFLAGS="$CFLAGS"
+ EXECINFO_CPPFLAGS="$CPPFLAGS"
+ EXECINFO_LDFLAGS="$LDFLAGS"
+else
+ SMB_ENABLE(EXECINFO,NO)
+fi
+
+SMB_EXT_LIB(EXECINFO, [${EXECINFO_LIBS}], [${EXECINFO_CFLAGS}], [${EXECINFO_CPPFLAGS}], [${EXECINFO_LDFLAGS}])
diff --git a/lib/util/util.c b/lib/util/util.c
index 4e2a5aab09..7548d30b7e 100644
--- a/lib/util/util.c
+++ b/lib/util/util.c
@@ -701,10 +701,14 @@ _PUBLIC_ char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_
char *hex_buffer;
hex_buffer = talloc_array(mem_ctx, char, (len*2)+1);
+ if (!hex_buffer) {
+ return NULL;
+ }
for (i = 0; i < len; i++)
slprintf(&hex_buffer[i*2], 3, "%02X", buff_in[i]);
+ talloc_set_name_const(hex_buffer, hex_buffer);
return hex_buffer;
}
diff --git a/lib/util/util.h b/lib/util/util.h
index ec1cfef110..dced557acb 100644
--- a/lib/util/util.h
+++ b/lib/util/util.h
@@ -21,6 +21,8 @@
#ifndef _SAMBA_UTIL_H_
#define _SAMBA_UTIL_H_
+#include <netinet/in.h>
+
#if _SAMBA_BUILD_ == 4
#include "../lib/util/charset/charset.h"
#endif
@@ -124,9 +126,6 @@ void CatchChildLeaveStatus(void);
/* The following definitions come from lib/util/system.c */
-
-struct in_addr;
-
/**************************************************************************
A wrapper for gethostbyname() that tries avoids looking up hostnames
in the root domain, which can cause dial-on-demand links to come up for no