1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-22 02:35:23 +03:00
aports/testing/openvas-smb/disable-backtrace.patch
2019-07-22 11:32:39 +00:00

135 lines
3.7 KiB
Diff

diff --git a/samba/include/config.h b/samba/include/config.h
index b99c4d5..dd85ee4 100644
--- a/samba/include/config.h
+++ b/samba/include/config.h
@@ -38,7 +38,7 @@
/* #define HAVE_ATTR_XATTR_H 1 */
/* Define to 1 if you have the `backtrace' function. */
-#define HAVE_BACKTRACE 1
+#define HAVE_BACKTRACE 0
/* Define to 1 if you have the <blkid/blkid.h> header file. */
/* #undef HAVE_BLKID_BLKID_H */
diff --git a/samba/include/config_tmp.h b/samba/include/config_tmp.h
index e85cb77..9c7e93c 100644
--- a/samba/include/config_tmp.h
+++ b/samba/include/config_tmp.h
@@ -38,7 +38,7 @@
#define HAVE_ATTR_XATTR_H 1
/* Define to 1 if you have the `backtrace' function. */
-#define HAVE_BACKTRACE 1
+#define HAVE_BACKTRACE 0
/* Define to 1 if you have the <blkid/blkid.h> header file. */
/* #undef HAVE_BLKID_BLKID_H */
diff --git a/samba/lib/util/fault.c b/samba/lib/util/fault.c
index c7d6b7e..a9cdabb 100644
--- a/samba/lib/util/fault.c
+++ b/samba/lib/util/fault.c
@@ -36,83 +36,6 @@ static struct {
static const char *progname;
-#ifdef HAVE_BACKTRACE
-#include <execinfo.h>
-#elif HAVE_LIBEXC_H
-#include <libexc.h>
-#endif
-
-/**
- * Write backtrace to debug log
- */
-_PUBLIC_ void call_backtrace(void)
-{
-#ifdef HAVE_BACKTRACE
-#ifndef BACKTRACE_STACK_SIZE
-#define BACKTRACE_STACK_SIZE 64
-#endif
- void *backtrace_stack[BACKTRACE_STACK_SIZE];
- size_t backtrace_size;
- char **backtrace_strings;
-
- /* get the backtrace (stack frames) */
- backtrace_size = backtrace(backtrace_stack,BACKTRACE_STACK_SIZE);
- backtrace_strings = backtrace_symbols(backtrace_stack, backtrace_size);
-
- DEBUG(0, ("BACKTRACE: %lu stack frames:\n",
- (unsigned long)backtrace_size));
-
- if (backtrace_strings) {
- int i;
-
- for (i = 0; i < backtrace_size; i++)
- DEBUGADD(0, (" #%u %s\n", i, backtrace_strings[i]));
-
- /* Leak the backtrace_strings, rather than risk what free() might do */
- }
-
-#elif HAVE_LIBEXC
-
-#define NAMESIZE 32 /* Arbitrary */
-#ifndef BACKTRACE_STACK_SIZE
-#define BACKTRACE_STACK_SIZE 64
-#endif
-
- /* The IRIX libexc library provides an API for unwinding the stack. See
- * libexc(3) for details. Apparantly trace_back_stack leaks memory, but
- * since we are about to abort anyway, it hardly matters.
- *
- * Note that if we paniced due to a SIGSEGV or SIGBUS (or similar) this
- * will fail with a nasty message upon failing to open the /proc entry.
- */
- {
- uint64_t addrs[BACKTRACE_STACK_SIZE];
- char * names[BACKTRACE_STACK_SIZE];
- char namebuf[BACKTRACE_STACK_SIZE * NAMESIZE];
-
- int i;
- int levels;
-
- ZERO_ARRAY(addrs);
- ZERO_ARRAY(names);
- ZERO_ARRAY(namebuf);
-
- for (i = 0; i < BACKTRACE_STACK_SIZE; i++) {
- names[i] = namebuf + (i * NAMESIZE);
- }
-
- levels = trace_back_stack(0, addrs, names,
- BACKTRACE_STACK_SIZE, NAMESIZE);
-
- DEBUG(0, ("BACKTRACE: %d stack frames:\n", levels));
- for (i = 0; i < levels; i++) {
- DEBUGADD(0, (" #%d 0x%llx %s\n", i, addrs[i], names[i]));
- }
- }
-#undef NAMESIZE
-#endif
-}
-
_PUBLIC_ const char *panic_action = NULL;
/**
@@ -143,8 +66,6 @@ _PUBLIC_ void smb_panic(const char *why)
}
DEBUG(0,("PANIC: %s\n", why));
- call_backtrace();
-
#ifdef SIGABRT
CatchSignal(SIGABRT,SIGNAL_CAST SIG_DFL);
#endif
diff --git a/samba/lib/util/util_proto.h b/samba/lib/util/util_proto.h
index efc787f..bb48f46 100644
--- a/samba/lib/util/util_proto.h
+++ b/samba/lib/util/util_proto.h
@@ -44,7 +44,6 @@ _PUBLIC_ void register_debug_handlers(const char *name, struct debug_ops *ops);
/* The following definitions come from lib/util/fault.c */
-_PUBLIC_ void call_backtrace(void);
_PUBLIC_ void smb_panic(const char *why);
_PUBLIC_ void fault_setup(const char *pname);
_PUBLIC_ BOOL register_fault_handler(const char *name, void (*fault_handler)(int sig));