1 diff -up openchange-openchange-2.3-VULCAN/libmapi/cdo_mapi.c.samba-4.2.0-rc2 openchange-openchange-2.3-VULCAN/libmapi/cdo_mapi.c
2 --- openchange-openchange-2.3-VULCAN/libmapi/cdo_mapi.c.samba-4.2.0-rc2 2015-12-03 11:20:17.502119228 +0100
3 +++ openchange-openchange-2.3-VULCAN/libmapi/cdo_mapi.c 2015-12-03 11:20:44.524118102 +0100
4 @@ -337,6 +337,9 @@ _PUBLIC_ enum MAPISTATUS SetMAPIDebugLev
5 ret = lpcfg_set_cmdline(mapi_ctx->lp_ctx, "log level", debuglevel);
6 talloc_free(debuglevel);
9 + _oc_log_samba_level = level;
11 return (ret == true) ? MAPI_E_SUCCESS : MAPI_E_INVALID_PARAMETER;
14 diff -up openchange-openchange-2.3-VULCAN/libmapi/oc_log.c.samba-4.2.0-rc2 openchange-openchange-2.3-VULCAN/libmapi/oc_log.c
15 --- openchange-openchange-2.3-VULCAN/libmapi/oc_log.c.samba-4.2.0-rc2 2015-12-03 11:11:01.801142393 +0100
16 +++ openchange-openchange-2.3-VULCAN/libmapi/oc_log.c 2015-12-03 11:27:22.921101494 +0100
20 #include "libmapi/libmapi.h"
21 -#include <util/debug.h>
24 +int _oc_log_samba_level = 0;
26 void oc_log(enum oc_log_level level, const char *fmt_string, ...)
28 @@ -47,12 +49,16 @@ void oc_logv(enum oc_log_level level, co
32 + if (samba_level && !(_oc_log_samba_level & samba_level))
35 /* Add a trailing newline if one is not already present */
36 if (line[strlen(line)-1] == '\n') {
37 - DEBUG(samba_level, ("%s", line));
38 + fprintf(stderr, "%s", line);
40 - DEBUG(samba_level, ("%s\n", line));
41 + fprintf(stderr, "%s\n", line);
46 void oc_log_init_stdout()
47 diff -up openchange-openchange-2.3-VULCAN/libmapi/oc_log.h.samba-4.2.0-rc2 openchange-openchange-2.3-VULCAN/libmapi/oc_log.h
48 --- openchange-openchange-2.3-VULCAN/libmapi/oc_log.h.samba-4.2.0-rc2 2015-12-03 11:18:27.407123817 +0100
49 +++ openchange-openchange-2.3-VULCAN/libmapi/oc_log.h 2015-12-03 11:20:19.228119156 +0100
50 @@ -77,4 +77,6 @@ void oc_log_init_user(const char *progna
51 defaulting to /var/log/openchange.log */
52 void oc_log_init_server(const char *progname, struct loadparm_context *lp_ctx);
54 +extern int _oc_log_samba_level; /* Private, do not change it other than by SetMAPIDebugLevel() */
56 #endif /* _OC_LOG_H_ */
57 diff -up openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/fault_util.c.samba-4.2.0-rc2 openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/fault_util.c
58 --- openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/fault_util.c.samba-4.2.0-rc2 2015-12-03 11:11:17.337141745 +0100
59 +++ openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/fault_util.c 2015-12-03 11:27:46.505100511 +0100
61 #include "fault_util.h"
62 #include "libmapi/libmapi.h"
63 #include "libmapi/libmapi_private.h"
64 -#include <util/debug.h>
67 #include <samba/version.h>
72 - \details print a backtrace using DEBUG() macro.
73 + \details print a backtrace (*not* using DEBUG() macro).
76 _PUBLIC_ void debug_print_backtrace(int dbg_level)
77 @@ -47,16 +47,19 @@ _PUBLIC_ void debug_print_backtrace(int
78 size_t backtrace_size;
79 char **backtrace_strings;
81 + if (!(_oc_log_samba_level & dbg_level))
84 backtrace_size = backtrace(backtrace_stack, BACKTRACE_SIZE);
85 backtrace_strings = backtrace_symbols(backtrace_stack, backtrace_size);
87 - DEBUG(dbg_level, ("BACKTRACE: %lu stack frames:\n", (unsigned long)backtrace_size));
88 + fprintf(stderr, "BACKTRACE: %lu stack frames:\n", (unsigned long)backtrace_size);
90 if (backtrace_strings) {
93 for (i = 0; i < backtrace_size; i++) {
94 - DEBUGADD(dbg_level, (" #%.2u %s\n", i, backtrace_strings[i]));
95 + fprintf(stderr, " #%.2u %s\n", i, backtrace_strings[i]);
98 free(backtrace_strings);
99 diff -up openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/fault_util.h.samba-4.2.0-rc2 openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/fault_util.h
100 --- openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/fault_util.h.samba-4.2.0-rc2 2015-12-03 11:11:37.089140922 +0100
101 +++ openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/fault_util.h 2015-12-03 11:26:38.633103340 +0100
103 * It will print information about the error and if is_fatal is true abort()
106 - * DEBUG macro will be used to print a report with the following format:
107 + * DEBUG macro will *not* be used to print a report with the following format:
109 * ==================================
110 * OPENCHANGE INTERNAL ERROR: pid 123
114 #define OC_PANIC( is_fatal, body ) \
116 - DEBUG(0, ("OPENCHANGE INTERNAL ERROR: pid %d\n", (int)getpid())); \
118 + fprintf(stderr,"\n"); \
119 + fprintf(stderr, "OPENCHANGE INTERNAL ERROR: pid %d\n", (int)getpid()); \
120 + fprintf(stderr, body); \
122 openchange_abort(is_fatal);
124 #ifndef __BEGIN_DECLS
125 diff -up openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/mapi_handles.c.samba-4.2.0-rc2 openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/mapi_handles.c
126 --- openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/mapi_handles.c.samba-4.2.0-rc2 2015-12-03 11:12:08.457139614 +0100
127 +++ openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/mapi_handles.c 2015-12-03 11:26:50.473102847 +0100
128 @@ -429,7 +429,7 @@ static int mapi_handles_traverse_delete(
129 OC_DEBUG(5, "handles being released must NOT have child handles attached to them (%s is a child of %s)", handle_str, container_handle_str);
130 handle = strtol((const char *) handle_str, NULL, 16);
132 - /* DEBUG(5, ("deleting child handle: %d, %s\n", handle, handle_str)); */
133 + /* OC_DEBUG(5, ("deleting child handle: %d, %s\n", handle, handle_str)); */
134 mapi_handles_delete(handles_private->handles_ctx, handle);