r7285: It appears that MIT Kerberos does not have the log redirection
authorAndrew Bartlett <abartlet@samba.org>
Sat, 4 Jun 2005 22:27:33 +0000 (22:27 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:17:36 +0000 (13:17 -0500)
facility that I'm using. This should let us compile the non-KDC
components on MIT again.

Andrew Bartlett
(This used to be commit ae9c2d2b54a979ab8467c847b62dd2c2a0fa059f)

source4/auth/kerberos/clikrb5.c
source4/auth/kerberos/config.m4
source4/auth/kerberos/kerberos.h

index dc02cf7b014d8ea76b3c10edf20e54d4fa0c2a64..3858b694a783048d6e9775f0d0c74bef4c0165f3 100644 (file)
@@ -484,7 +484,7 @@ static int smb_krb5_context_destory_1(void *ptr)
        return 0;
 }
 
-#if defined(HAVE_KRB5_INITLOG) && defined(HAVE_KRB5_ADDLOG_FUNC) && defined(HAVE_KRB5_FREELOG)
+#ifdef HAVE_KRB5_LOGGING_CONTROL
 static int smb_krb5_context_destory_2(void *ptr) 
 {
        struct smb_krb5_context *ctx = ptr;
@@ -547,7 +547,7 @@ static void smb_krb5_debug_wrapper(const char *timestr, const char *msg, void *p
                }
        }
 
-#if defined(HAVE_KRB5_INITLOG) && defined(HAVE_KRB5_ADDLOG_FUNC) && defined(HAVE_KRB5_FREELOG)
+#ifdef HAVE_KRB5_LOGGING_CONTROL
        /* TODO: Should we have a different name here? */
        ret = krb5_initlog((*smb_krb5_context)->krb5_context, "Samba", &(*smb_krb5_context)->logf);
        
index 010a1c85da2ec40f6b920fba76d1fd7f3f457361..0c248289079499c4aeb0ccece1bc05a6b8d22364 100644 (file)
@@ -263,9 +263,22 @@ if test x"$with_krb5_support" != x"no"; then
        AC_CHECK_FUNC_EXT(krb5_initlog, $KRB5_LIBS)
        AC_CHECK_FUNC_EXT(krb5_freelog, $KRB5_LIBS)
        AC_CHECK_FUNC_EXT(krb5_addlog_func, $KRB5_LIBS)
+       AC_CHECK_FUNC_EXT(krb5_set_warn_dest, $KRB5_LIBS)
 
        LIBS="$LIBS $KRB5_LIBS"
   
+       AC_CACHE_CHECK([for krb5_log_facility type],
+                samba_cv_HAVE_KRB5_LOG_FACILITY,[
+       AC_TRY_COMPILE([#include <krb5.h>],
+               [krb5_log_facility block;],
+               samba_cv_HAVE_KRB5_LOG_FACILITY=yes,
+               samba_cv_HAVE_KRB5_LOG_FACILITY=no)])
+
+       if test x"$samba_cv_HAVE_KRB5_LOG_FACILITY" = x"yes"; then
+               AC_DEFINE(HAVE_KRB5_LOG_FACILITY,1,
+               [Whether the type krb5_log_facility exists])
+       fi
+
        AC_CACHE_CHECK([for krb5_encrypt_block type],
                 samba_cv_HAVE_KRB5_ENCRYPT_BLOCK,[
        AC_TRY_COMPILE([#include <krb5.h>],
index b65416e619eb8990a2e513ce550286b2c5653ad3..286e8ceb2e3da57b5759dabb1c4ba4f6c1cce1dd 100644 (file)
 
 #if defined(HAVE_KRB5)
 
+#if defined(HAVE_KRB5_INITLOG) && defined(HAVE_KRB5_ADDLOG_FUNC) && defined(HAVE_KRB5_FREELOG) && defined (HAVE_KRB5_SET_WARN_DEST) && defined(HAVE_KRB5_LOG_FACILITY)
+#define HAVE_KRB5_LOGGGING_CONTROL
+#else
+#undef HAVE_KRB5_LOGGGING_CONTROL
+#endif
+
 struct smb_krb5_context {
        krb5_context krb5_context;
+#ifdef HAVE_KRB5_LOGGGING_CONTROL
        krb5_log_facility *logf;
+#endif
 };