>From 2f9b687b73d3d48ecd29fce247b75da1ad6d8f45 Mon Sep 17 00:00:00 2001
From: Michal Zidek <mzidek@redhat.com>
Date: Mon, 15 Oct 2012 15:24:15 +0200
Subject: [PATCH] Include talloc log in our debug facility

https://fedorahosted.org/sssd/ticket/1495
---
 src/monitor/monitor.c                        |  2 +-
 src/providers/data_provider_be.c             |  3 +--
 src/providers/krb5/krb5_child.c              |  2 +-
 src/providers/ldap/ldap_child.c              |  2 +-
 src/providers/proxy/proxy_child.c            |  2 +-
 src/responder/autofs/autofssrv.c             |  2 +-
 src/responder/nss/nsssrv.c                   |  2 +-
 src/responder/pac/pacsrv.c                   |  2 +-
 src/responder/pam/pamsrv.c                   |  2 +-
 src/responder/ssh/sshsrv.c                   |  2 +-
 src/responder/sudo/sudosrv.c                 |  2 +-
 src/sss_client/ssh/sss_ssh_authorizedkeys.c  |  2 +-
 src/sss_client/ssh/sss_ssh_knownhostsproxy.c |  2 +-
 src/tests/auth-tests.c                       |  2 +-
 src/tests/crypto-tests.c                     |  2 +-
 src/tests/fail_over-tests.c                  |  2 +-
 src/tests/files-tests.c                      |  2 +-
 src/tests/krb5_child-test.c                  |  2 +-
 src/tests/krb5_utils-tests.c                 |  2 +-
 src/tests/refcount-tests.c                   |  2 +-
 src/tests/resolv-tests.c                     |  2 +-
 src/tests/responder_socket_access-tests.c    |  2 +-
 src/tests/simple_access-tests.c              |  2 +-
 src/tests/strtonum-tests.c                   |  2 +-
 src/tests/sysdb-tests.c                      |  2 +-
 src/tests/sysdb_ssh-tests.c                  |  2 +-
 src/tests/util-tests.c                       |  2 +-
 src/tools/sss_cache.c                        |  2 +-
 src/tools/sss_debuglevel.c                   |  2 +-
 src/tools/sss_groupadd.c                     |  2 +-
 src/tools/sss_groupdel.c                     |  2 +-
 src/tools/sss_groupmod.c                     |  2 +-
 src/tools/sss_groupshow.c                    |  2 +-
 src/tools/sss_seed.c                         |  2 +-
 src/tools/sss_useradd.c                      |  2 +-
 src/tools/sss_userdel.c                      |  2 +-
 src/tools/sss_usermod.c                      |  2 +-
 src/util/debug.c                             |  6 ++++++
 src/util/util.h                              | 15 ++++++++++-----
 39 files changed, 53 insertions(+), 43 deletions(-)

diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index a565399..af2189c 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -2497,7 +2497,7 @@ int main(int argc, const char *argv[])
         }
     }
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     if (opt_version) {
         puts(VERSION""DISTRO_VERSION""PRERELEASE_VERSION);
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index 4e4bdab..0ac83f4 100644
--- a/src/providers/data_provider_be.c
+++ b/src/providers/data_provider_be.c
@@ -2388,8 +2388,7 @@ int main(int argc, const char *argv[])
 
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
-
+    DEBUG_INIT(debug_level);
 
     /* set up things like debug , signals, daemonization, etc... */
     debug_log_file = talloc_asprintf(NULL, "sssd_%s", be_domain);
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c
index a92ba57..d9baa06 100644
--- a/src/providers/krb5/krb5_child.c
+++ b/src/providers/krb5/krb5_child.c
@@ -1917,7 +1917,7 @@ int main(int argc, const char *argv[])
 
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     debug_prg_name = talloc_asprintf(NULL, "[sssd[krb5_child[%d]]]", getpid());
     if (!debug_prg_name) {
diff --git a/src/providers/ldap/ldap_child.c b/src/providers/ldap/ldap_child.c
index f35d946..9d82e7c 100644
--- a/src/providers/ldap/ldap_child.c
+++ b/src/providers/ldap/ldap_child.c
@@ -458,7 +458,7 @@ int main(int argc, const char *argv[])
 
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     debug_prg_name = talloc_asprintf(NULL, "[sssd[ldap_child[%d]]]", getpid());
     if (!debug_prg_name) {
diff --git a/src/providers/proxy/proxy_child.c b/src/providers/proxy/proxy_child.c
index 8aa1d76..c575948 100644
--- a/src/providers/proxy/proxy_child.c
+++ b/src/providers/proxy/proxy_child.c
@@ -510,7 +510,7 @@ int main(int argc, const char *argv[])
 
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     /* set up things like debug , signals, daemonization, etc... */
     debug_log_file = talloc_asprintf(NULL, "proxy_child_%s", domain);
diff --git a/src/responder/autofs/autofssrv.c b/src/responder/autofs/autofssrv.c
index dcb188f..86a816a 100644
--- a/src/responder/autofs/autofssrv.c
+++ b/src/responder/autofs/autofssrv.c
@@ -198,7 +198,7 @@ int main(int argc, const char *argv[])
 
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     /* set up things like debug, signals, daemonization, etc... */
     debug_log_file = "sssd_autofs";
diff --git a/src/responder/nss/nsssrv.c b/src/responder/nss/nsssrv.c
index 1156c45..e01bd1a 100644
--- a/src/responder/nss/nsssrv.c
+++ b/src/responder/nss/nsssrv.c
@@ -472,7 +472,7 @@ int main(int argc, const char *argv[])
 
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     /* set up things like debug, signals, daemonization, etc... */
     debug_log_file = "sssd_nss";
diff --git a/src/responder/pac/pacsrv.c b/src/responder/pac/pacsrv.c
index 348fc6f..036dd6a 100644
--- a/src/responder/pac/pacsrv.c
+++ b/src/responder/pac/pacsrv.c
@@ -235,7 +235,7 @@ int main(int argc, const char *argv[])
 
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     /* set up things like debug, signals, daemonization, etc... */
     debug_log_file = "sssd_pac";
diff --git a/src/responder/pam/pamsrv.c b/src/responder/pam/pamsrv.c
index c94596c..c608f58 100644
--- a/src/responder/pam/pamsrv.c
+++ b/src/responder/pam/pamsrv.c
@@ -236,7 +236,7 @@ int main(int argc, const char *argv[])
 
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     /* set up things like debug, signals, daemonization, etc... */
     debug_log_file = "sssd_pam";
diff --git a/src/responder/ssh/sshsrv.c b/src/responder/ssh/sshsrv.c
index fe01f81..32c0f30 100644
--- a/src/responder/ssh/sshsrv.c
+++ b/src/responder/ssh/sshsrv.c
@@ -186,7 +186,7 @@ int main(int argc, const char *argv[])
 
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     /* set up things like debug, signals, daemonization, etc... */
     debug_log_file = "sssd_ssh";
diff --git a/src/responder/sudo/sudosrv.c b/src/responder/sudo/sudosrv.c
index b4f8f88..cb89e1f 100644
--- a/src/responder/sudo/sudosrv.c
+++ b/src/responder/sudo/sudosrv.c
@@ -176,7 +176,7 @@ int main(int argc, const char *argv[])
 
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     /* set up things like debug, signals, daemonization, etc... */
     debug_log_file = "sssd_sudo";
diff --git a/src/sss_client/ssh/sss_ssh_authorizedkeys.c b/src/sss_client/ssh/sss_ssh_authorizedkeys.c
index 902b4a0..11deff9 100644
--- a/src/sss_client/ssh/sss_ssh_authorizedkeys.c
+++ b/src/sss_client/ssh/sss_ssh_authorizedkeys.c
@@ -73,7 +73,7 @@ int main(int argc, const char **argv)
     while ((ret = poptGetNextOpt(pc)) > 0)
         ;
 
-    debug_level = debug_convert_old_level(pc_debug);
+    DEBUG_INIT(pc_debug);
 
     if (ret != -1) {
         BAD_POPT_PARAMS(pc, poptStrerror(ret), ret, fini);
diff --git a/src/sss_client/ssh/sss_ssh_knownhostsproxy.c b/src/sss_client/ssh/sss_ssh_knownhostsproxy.c
index 76356bd..600895d 100644
--- a/src/sss_client/ssh/sss_ssh_knownhostsproxy.c
+++ b/src/sss_client/ssh/sss_ssh_knownhostsproxy.c
@@ -228,7 +228,7 @@ int main(int argc, const char **argv)
     while ((ret = poptGetNextOpt(pc)) > 0)
         ;
 
-    debug_level = debug_convert_old_level(pc_debug);
+    DEBUG_INIT(pc_debug);
 
     if (ret != -1) {
         BAD_POPT_PARAMS(pc, poptStrerror(ret), ret, fini);
diff --git a/src/tests/auth-tests.c b/src/tests/auth-tests.c
index 4d25e2e..ff8b9e1 100644
--- a/src/tests/auth-tests.c
+++ b/src/tests/auth-tests.c
@@ -317,7 +317,7 @@ int main(int argc, const char *argv[])
     }
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     tests_set_cwd();
 
diff --git a/src/tests/crypto-tests.c b/src/tests/crypto-tests.c
index 0492a38..8932d8f 100644
--- a/src/tests/crypto-tests.c
+++ b/src/tests/crypto-tests.c
@@ -206,7 +206,7 @@ int main(int argc, const char *argv[])
     }
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     tests_set_cwd();
 
diff --git a/src/tests/fail_over-tests.c b/src/tests/fail_over-tests.c
index 3a7c4ae..93dda3a 100644
--- a/src/tests/fail_over-tests.c
+++ b/src/tests/fail_over-tests.c
@@ -311,7 +311,7 @@ main(int argc, const char *argv[])
     }
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     tests_set_cwd();
 
diff --git a/src/tests/files-tests.c b/src/tests/files-tests.c
index cb20e1a..56c9ab9 100644
--- a/src/tests/files-tests.c
+++ b/src/tests/files-tests.c
@@ -322,7 +322,7 @@ int main(int argc, const char *argv[])
     }
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     tests_set_cwd();
 
diff --git a/src/tests/krb5_child-test.c b/src/tests/krb5_child-test.c
index b07592a..c370d6c 100644
--- a/src/tests/krb5_child-test.c
+++ b/src/tests/krb5_child-test.c
@@ -476,7 +476,7 @@ main(int argc, const char *argv[])
         }
     }
 
-    debug_level = debug_convert_old_level(pc_debug);
+    DEBUG_INIT(pc_debug);
 
     if (opt != -1) {
         poptPrintUsage(pc, stderr, 0);
diff --git a/src/tests/krb5_utils-tests.c b/src/tests/krb5_utils-tests.c
index 5fee454..0098858 100644
--- a/src/tests/krb5_utils-tests.c
+++ b/src/tests/krb5_utils-tests.c
@@ -746,7 +746,7 @@ int main(int argc, const char *argv[])
     }
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     ret = mkdir(TESTS_PATH, 0775);
     if (ret != EOK) {
diff --git a/src/tests/refcount-tests.c b/src/tests/refcount-tests.c
index 18f5553..9a7e5b9 100644
--- a/src/tests/refcount-tests.c
+++ b/src/tests/refcount-tests.c
@@ -222,7 +222,7 @@ int main(int argc, const char *argv[])
     }
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     tests_set_cwd();
 
diff --git a/src/tests/resolv-tests.c b/src/tests/resolv-tests.c
index ad89aaf..c61d6f8 100644
--- a/src/tests/resolv-tests.c
+++ b/src/tests/resolv-tests.c
@@ -856,7 +856,7 @@ int main(int argc, const char *argv[])
     }
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     if (!use_net_test) {
         printf("Network tests disabled. Rerun with the \"-n\" "
diff --git a/src/tests/responder_socket_access-tests.c b/src/tests/responder_socket_access-tests.c
index 734bf1c..a01a5d1 100644
--- a/src/tests/responder_socket_access-tests.c
+++ b/src/tests/responder_socket_access-tests.c
@@ -163,7 +163,7 @@ int main(int argc, const char *argv[])
     }
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
     tests_set_cwd();
 
     Suite *s = responder_test_suite();
diff --git a/src/tests/simple_access-tests.c b/src/tests/simple_access-tests.c
index c61814e..486f87d 100644
--- a/src/tests/simple_access-tests.c
+++ b/src/tests/simple_access-tests.c
@@ -196,7 +196,7 @@ int main(int argc, const char *argv[])
     }
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     tests_set_cwd();
 
diff --git a/src/tests/strtonum-tests.c b/src/tests/strtonum-tests.c
index e7d7036..009f004 100644
--- a/src/tests/strtonum-tests.c
+++ b/src/tests/strtonum-tests.c
@@ -449,7 +449,7 @@ int main(int argc, const char *argv[]) {
     }
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     tests_set_cwd();
 
diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c
index d9afe7b..3a07a64 100644
--- a/src/tests/sysdb-tests.c
+++ b/src/tests/sysdb-tests.c
@@ -4099,7 +4099,7 @@ int main(int argc, const char *argv[]) {
     }
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     tests_set_cwd();
 
diff --git a/src/tests/sysdb_ssh-tests.c b/src/tests/sysdb_ssh-tests.c
index f914993..f44c2f9 100644
--- a/src/tests/sysdb_ssh-tests.c
+++ b/src/tests/sysdb_ssh-tests.c
@@ -402,7 +402,7 @@ int main(int argc, const char *argv[])
     }
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     tests_set_cwd();
 
diff --git a/src/tests/util-tests.c b/src/tests/util-tests.c
index 59c80ca..80c03c7 100644
--- a/src/tests/util-tests.c
+++ b/src/tests/util-tests.c
@@ -713,7 +713,7 @@ int main(int argc, const char *argv[])
     }
     poptFreeContext(pc);
 
-    CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+    DEBUG_INIT(debug_level);
 
     tests_set_cwd();
 
diff --git a/src/tools/sss_cache.c b/src/tools/sss_cache.c
index 73d9965..9b91f98 100644
--- a/src/tools/sss_cache.c
+++ b/src/tools/sss_cache.c
@@ -414,7 +414,7 @@ errno_t init_context(int argc, const char *argv[], struct cache_tool_ctx **tctx)
                 ret, fini);
     }
 
-    debug_level = debug_convert_old_level(debug);
+    DEBUG_INIT(debug);
     debug_prg_name = argv[0];
     CHECK_ROOT(ret, debug_prg_name);
 
diff --git a/src/tools/sss_debuglevel.c b/src/tools/sss_debuglevel.c
index 7270138..e955ec3 100644
--- a/src/tools/sss_debuglevel.c
+++ b/src/tools/sss_debuglevel.c
@@ -88,7 +88,7 @@ int main(int argc, const char **argv)
             goto fini;
         }
     }
-    debug_level = debug_convert_old_level(pc_debug);
+    DEBUG_INIT(pc_debug);
 
     /* get debug level */
     debug_as_string = poptGetArg(pc);
diff --git a/src/tools/sss_groupadd.c b/src/tools/sss_groupadd.c
index 2a01f39..5667e9a 100644
--- a/src/tools/sss_groupadd.c
+++ b/src/tools/sss_groupadd.c
@@ -67,7 +67,7 @@ int main(int argc, const char **argv)
         BAD_POPT_PARAMS(pc, poptStrerror(ret), ret, fini);
     }
 
-    debug_level = debug_convert_old_level(pc_debug);
+    DEBUG_INIT(pc_debug);
 
     /* groupname is an argument, not option */
     pc_groupname = poptGetArg(pc);
diff --git a/src/tools/sss_groupdel.c b/src/tools/sss_groupdel.c
index 70030ca..57c3e70 100644
--- a/src/tools/sss_groupdel.c
+++ b/src/tools/sss_groupdel.c
@@ -61,7 +61,7 @@ int main(int argc, const char **argv)
         BAD_POPT_PARAMS(pc, poptStrerror(ret), ret, fini);
     }
 
-    debug_level = debug_convert_old_level(pc_debug);
+    DEBUG_INIT(pc_debug);
 
     pc_groupname = poptGetArg(pc);
     if (pc_groupname == NULL) {
diff --git a/src/tools/sss_groupmod.c b/src/tools/sss_groupmod.c
index c210bad..1d80c59 100644
--- a/src/tools/sss_groupmod.c
+++ b/src/tools/sss_groupmod.c
@@ -100,7 +100,7 @@ int main(int argc, const char **argv)
         BAD_POPT_PARAMS(pc, _("Specify group to modify\n"), ret, fini);
     }
 
-    debug_level = debug_convert_old_level(pc_debug);
+    DEBUG_INIT(pc_debug);
 
     CHECK_ROOT(ret, debug_prg_name);
 
diff --git a/src/tools/sss_groupshow.c b/src/tools/sss_groupshow.c
index 2ba495c..7ba1db1 100644
--- a/src/tools/sss_groupshow.c
+++ b/src/tools/sss_groupshow.c
@@ -675,7 +675,7 @@ int main(int argc, const char **argv)
         }
     }
 
-    debug_level = debug_convert_old_level(pc_debug);
+    DEBUG_INIT(pc_debug);
 
     if (ret != -1) {
         BAD_POPT_PARAMS(pc, poptStrerror(ret), ret, fini);
diff --git a/src/tools/sss_seed.c b/src/tools/sss_seed.c
index 18d0b9d..cd1b263 100644
--- a/src/tools/sss_seed.c
+++ b/src/tools/sss_seed.c
@@ -521,7 +521,7 @@ static int seed_init(TALLOC_CTX *mem_ctx,
         BAD_POPT_PARAMS(pc, poptStrerror(ret), ret, fini);
     }
 
-    debug_level = debug_convert_old_level(pc_debug);
+    DEBUG_INIT(pc_debug);
 
     CHECK_ROOT(ret, argv[0]);
 
diff --git a/src/tools/sss_useradd.c b/src/tools/sss_useradd.c
index 1bf174c..ef594ae 100644
--- a/src/tools/sss_useradd.c
+++ b/src/tools/sss_useradd.c
@@ -98,7 +98,7 @@ int main(int argc, const char **argv)
         }
     }
 
-    debug_level = debug_convert_old_level(pc_debug);
+    DEBUG_INIT(pc_debug);
 
     if (ret != -1) {
         BAD_POPT_PARAMS(pc, poptStrerror(ret), ret, fini);
diff --git a/src/tools/sss_userdel.c b/src/tools/sss_userdel.c
index 0d1c63e..5d250f6 100644
--- a/src/tools/sss_userdel.c
+++ b/src/tools/sss_userdel.c
@@ -173,7 +173,7 @@ int main(int argc, const char **argv)
         }
     }
 
-    debug_level = debug_convert_old_level(pc_debug);
+    DEBUG_INIT(pc_debug);
 
     if (ret != -1) {
         BAD_POPT_PARAMS(pc, poptStrerror(ret), ret, fini);
diff --git a/src/tools/sss_usermod.c b/src/tools/sss_usermod.c
index a45005c..f673036 100644
--- a/src/tools/sss_usermod.c
+++ b/src/tools/sss_usermod.c
@@ -111,7 +111,7 @@ int main(int argc, const char **argv)
         BAD_POPT_PARAMS(pc, poptStrerror(ret), ret, fini);
     }
 
-    debug_level = debug_convert_old_level(pc_debug);
+    DEBUG_INIT(pc_debug);
 
     /* username is an argument without --option */
     pc_username = poptGetArg(pc);
diff --git a/src/util/debug.c b/src/util/debug.c
index e57656d..6f2dff7 100644
--- a/src/util/debug.c
+++ b/src/util/debug.c
@@ -256,3 +256,9 @@ int rotate_debug_files(void)
 
     return open_debug_file();
 }
+
+void talloc_log_fn(const char *message)
+{
+    DEBUG(SSSDBG_FATAL_FAILURE, (message));
+}
+
diff --git a/src/util/util.h b/src/util/util.h
index a96f519..df57a3d 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -194,11 +194,15 @@ errno_t set_debug_file_from_fd(const int fd);
 */
 #define DEBUG_IS_SET(level) (debug_level & (level))
 
-#define CONVERT_AND_SET_DEBUG_LEVEL(new_value) debug_level = ( \
-    ((new_value) != SSSDBG_INVALID) \
-    ? debug_convert_old_level(new_value) \
-    : SSSDBG_UNRESOLVED /* Debug level should be loaded from config file. */ \
-);
+#define DEBUG_INIT(dbg_lvl) do { \
+    if (dbg_lvl != SSSDBG_INVALID) { \
+        debug_level = debug_convert_old_level(dbg_lvl); \
+    } else { \
+        debug_level = SSSDBG_UNRESOLVED; \
+    } \
+\
+    talloc_set_log_fn(talloc_log_fn); \
+} while (0)
 
 #define PRINT(fmt, ...) fprintf(stdout, gettext(fmt), ##__VA_ARGS__)
 #define ERROR(fmt, ...) fprintf(stderr, gettext(fmt), ##__VA_ARGS__)
@@ -341,6 +345,7 @@ void ldb_debug_messages(void *context, enum ldb_debug_level level,
 int open_debug_file_ex(const char *filename, FILE **filep);
 int open_debug_file(void);
 int rotate_debug_files(void);
+void talloc_log_fn(const char *msg);
 
 /* From sss_log.c */
 #define SSS_LOG_EMERG   0   /* system is unusable */
-- 
1.7.11.2

