Blame SOURCES/openchange-2.2-samba-4.2.0-rc2.patch

d490f0
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
d490f0
--- openchange-openchange-2.3-VULCAN/libmapi/cdo_mapi.c.samba-4.2.0-rc2	2015-12-03 11:20:17.502119228 +0100
d490f0
+++ openchange-openchange-2.3-VULCAN/libmapi/cdo_mapi.c	2015-12-03 11:20:44.524118102 +0100
d490f0
@@ -337,6 +337,9 @@ _PUBLIC_ enum MAPISTATUS SetMAPIDebugLev
d490f0
 	ret = lpcfg_set_cmdline(mapi_ctx->lp_ctx, "log level", debuglevel);
d490f0
 	talloc_free(debuglevel);
d490f0
 
d490f0
+	if (ret)
d490f0
+		_oc_log_samba_level = level;
d490f0
+
d490f0
 	return (ret == true) ? MAPI_E_SUCCESS : MAPI_E_INVALID_PARAMETER;
d490f0
 }
d490f0
 
d490f0
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
d490f0
--- openchange-openchange-2.3-VULCAN/libmapi/oc_log.c.samba-4.2.0-rc2	2015-12-03 11:11:01.801142393 +0100
d490f0
+++ openchange-openchange-2.3-VULCAN/libmapi/oc_log.c	2015-12-03 11:27:22.921101494 +0100
d490f0
@@ -20,7 +20,9 @@
d490f0
 */
d490f0
 
d490f0
 #include "libmapi/libmapi.h"
d490f0
-#include <util/debug.h>
d490f0
+#include <stdio.h>
d490f0
+
d490f0
+int _oc_log_samba_level = 0;
d490f0
 
d490f0
 void oc_log(enum oc_log_level level, const char *fmt_string, ...)
d490f0
 {
d490f0
@@ -47,12 +49,16 @@ void oc_logv(enum oc_log_level level, co
d490f0
 		samba_level = 0;
d490f0
 	}
d490f0
 
d490f0
+	if (samba_level && !(_oc_log_samba_level & samba_level))
d490f0
+		return;
d490f0
+
d490f0
 	/* Add a trailing newline if one is not already present */
d490f0
 	if (line[strlen(line)-1] == '\n') {
d490f0
-		DEBUG(samba_level, ("%s", line));
d490f0
+		fprintf(stderr, "%s", line);
d490f0
 	} else {
d490f0
-		DEBUG(samba_level, ("%s\n", line));
d490f0
+		fprintf(stderr, "%s\n", line);
d490f0
 	}
d490f0
+	fflush(stderr);
d490f0
 }
d490f0
 
d490f0
 void oc_log_init_stdout()
d490f0
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
d490f0
--- openchange-openchange-2.3-VULCAN/libmapi/oc_log.h.samba-4.2.0-rc2	2015-12-03 11:18:27.407123817 +0100
d490f0
+++ openchange-openchange-2.3-VULCAN/libmapi/oc_log.h	2015-12-03 11:20:19.228119156 +0100
d490f0
@@ -77,4 +77,6 @@ void oc_log_init_user(const char *progna
d490f0
    defaulting to /var/log/openchange.log */
d490f0
 void oc_log_init_server(const char *progname, struct loadparm_context *lp_ctx);
d490f0
 
d490f0
+extern int _oc_log_samba_level; /* Private, do not change it other than by SetMAPIDebugLevel() */
d490f0
+
d490f0
 #endif /* _OC_LOG_H_ */
d490f0
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
d490f0
--- openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/fault_util.c.samba-4.2.0-rc2	2015-12-03 11:11:17.337141745 +0100
d490f0
+++ openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/fault_util.c	2015-12-03 11:27:46.505100511 +0100
d490f0
@@ -30,14 +30,14 @@
d490f0
 #include "fault_util.h"
d490f0
 #include "libmapi/libmapi.h"
d490f0
 #include "libmapi/libmapi_private.h"
d490f0
-#include <util/debug.h>
d490f0
+#include <stdio.h>
d490f0
 
d490f0
 #include <samba/version.h>
d490f0
 
d490f0
 #include <execinfo.h>
d490f0
 
d490f0
 /**
d490f0
-   \details print a backtrace using DEBUG() macro.
d490f0
+   \details print a backtrace (*not* using DEBUG() macro).
d490f0
 
d490f0
  */
d490f0
 _PUBLIC_ void debug_print_backtrace(int dbg_level)
d490f0
@@ -47,16 +47,19 @@ _PUBLIC_ void debug_print_backtrace(int
d490f0
 	size_t backtrace_size;
d490f0
 	char **backtrace_strings;
d490f0
 
d490f0
+	if (!(_oc_log_samba_level & dbg_level))
d490f0
+		return;
d490f0
+
d490f0
 	backtrace_size = backtrace(backtrace_stack, BACKTRACE_SIZE);
d490f0
 	backtrace_strings = backtrace_symbols(backtrace_stack, backtrace_size);
d490f0
 
d490f0
-	DEBUG(dbg_level, ("BACKTRACE: %lu stack frames:\n", (unsigned long)backtrace_size));
d490f0
+	fprintf(stderr, "BACKTRACE: %lu stack frames:\n", (unsigned long)backtrace_size);
d490f0
 
d490f0
 	if (backtrace_strings) {
d490f0
 		int i;
d490f0
 
d490f0
 		for (i = 0; i < backtrace_size; i++) {
d490f0
-			DEBUGADD(dbg_level, (" #%.2u %s\n", i, backtrace_strings[i]));
d490f0
+			fprintf(stderr, " #%.2u %s\n", i, backtrace_strings[i]);
d490f0
 		}
d490f0
 
d490f0
 		free(backtrace_strings);
d490f0
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
d490f0
--- openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/fault_util.h.samba-4.2.0-rc2	2015-12-03 11:11:37.089140922 +0100
d490f0
+++ openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/fault_util.h	2015-12-03 11:26:38.633103340 +0100
d490f0
@@ -28,7 +28,7 @@
d490f0
  * It will print information about the error and if is_fatal is true abort()
d490f0
  * will be called.
d490f0
  *
d490f0
- * DEBUG macro will be used to print a report with the following format:
d490f0
+ * DEBUG macro will *not* be used to print a report with the following format:
d490f0
  * @code
d490f0
  *  ==================================
d490f0
  *  OPENCHANGE INTERNAL ERROR: pid 123
d490f0
@@ -59,9 +59,10 @@
d490f0
  * @see DEBUG()
d490f0
  */
d490f0
 #define OC_PANIC( is_fatal, body ) \
d490f0
-	DEBUGSEP(0); \
d490f0
-	DEBUG(0, ("OPENCHANGE INTERNAL ERROR: pid %d\n", (int)getpid())); \
d490f0
-	DEBUG(0, body); \
d490f0
+	fprintf(stderr,"\n"); \
d490f0
+	fprintf(stderr, "OPENCHANGE INTERNAL ERROR: pid %d\n", (int)getpid()); \
d490f0
+	fprintf(stderr, body); \
d490f0
+	fflush(stderr); \
d490f0
 	openchange_abort(is_fatal);
d490f0
 
d490f0
 #ifndef __BEGIN_DECLS
d490f0
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
d490f0
--- openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/mapi_handles.c.samba-4.2.0-rc2	2015-12-03 11:12:08.457139614 +0100
d490f0
+++ openchange-openchange-2.3-VULCAN/mapiproxy/libmapiproxy/mapi_handles.c	2015-12-03 11:26:50.473102847 +0100
d490f0
@@ -429,7 +429,7 @@ static int mapi_handles_traverse_delete(
d490f0
 		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);
d490f0
 		handle = strtol((const char *) handle_str, NULL, 16);
d490f0
 		/* abort(); */
d490f0
-		/* DEBUG(5, ("deleting child handle: %d, %s\n", handle, handle_str)); */
d490f0
+		/* OC_DEBUG(5, ("deleting child handle: %d, %s\n", handle, handle_str)); */
d490f0
 		mapi_handles_delete(handles_private->handles_ctx, handle);
d490f0
 	}
d490f0