diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2009-05-28 14:41:00 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2009-05-28 15:41:04 -0400 |
commit | 181f25a1fb70d47490c1b82e9e968f77e2fab019 (patch) | |
tree | eefa3942329c0459c4aa5e95fa0b467bd503d109 /server/util | |
parent | 553b185f1c765855fe5f5ce9b29533261f80fcba (diff) | |
download | sssd-181f25a1fb70d47490c1b82e9e968f77e2fab019.tar.gz sssd-181f25a1fb70d47490c1b82e9e968f77e2fab019.tar.bz2 sssd-181f25a1fb70d47490c1b82e9e968f77e2fab019.zip |
Suppress "rootdse" error messages.
We will trap all LDB debug messages and pipe them into our
internal DEBUG() function. LDB FATAL messages will still be
printed by default, WARNING and TRACE functions will be at debug
level 3 and 9, respectively.
Diffstat (limited to 'server/util')
-rw-r--r-- | server/util/debug.c | 24 | ||||
-rw-r--r-- | server/util/util.h | 5 |
2 files changed, 29 insertions, 0 deletions
diff --git a/server/util/debug.c b/server/util/debug.c index 1398f800..f7f89f5c 100644 --- a/server/util/debug.c +++ b/server/util/debug.c @@ -3,6 +3,8 @@ #include <stdarg.h> #include <stdlib.h> +#include "util/util.h" + const char *debug_prg_name = "sssd"; int debug_level = 0; @@ -19,3 +21,25 @@ void debug_fn(const char *format, ...) fprintf(stderr, s); free(s); } + +void ldb_debug_messages(void *context, enum ldb_debug_level level, + const char *fmt, va_list ap) +{ + int loglevel = -1; + switch(level) { + case LDB_DEBUG_FATAL: + loglevel = 0; + break; + case LDB_DEBUG_ERROR: + loglevel = 1; + break; + case LDB_DEBUG_WARNING: + loglevel = 3; + break; + case LDB_DEBUG_TRACE: + loglevel = 9; + break; + } + + DEBUG(loglevel, (fmt, ap)); +} diff --git a/server/util/util.h b/server/util/util.h index b3a7c727..d328f3ae 100644 --- a/server/util/util.h +++ b/server/util/util.h @@ -11,6 +11,7 @@ #include "config.h" #include "talloc.h" #include "tevent.h" +#include "ldb.h" extern const char *debug_prg_name; extern int debug_level; @@ -54,6 +55,10 @@ struct main_context { #include "util/dlinklist.h" +/* From debug.c */ +void ldb_debug_messages(void *context, enum ldb_debug_level level, + const char *fmt, va_list ap); + /* from server.c */ int server_setup(const char *name, int flags, const char *conf_entry, |