#include <string.h>
#endif
-#if HAVE_GSSAPI_GSSAPI_H
-#include <gssapi/gssapi.h>
-#elif HAVE_GSSAPI_H
-#include <gssapi.h>
-#endif /* HAVE_GSSAPI_GSSAPI_H/HAVE_GSSAPI_H */
-
-#if !HAVE_HEIMDAL_KERBEROS
-#if HAVE_GSSAPI_GSSAPI_KRB5_H
-#include <gssapi/gssapi_krb5.h>
-#endif
-#if HAVE_GSSAPI_GSSAPI_GENERIC_H
-#include <gssapi/gssapi_generic.h>
-#endif
-#if HAVE_GSSAPI_GSSAPI_EXT_H
-#include <gssapi/gssapi_ext.h>
-#endif
-#endif
-
#if HAVE_KRB5_H
#if HAVE_BROKEN_SOLARIS_KRB5_H
#warn "Warning! You have a broken Solaris <krb5.h> system header"
#define error_message(code) krb5_get_err_text(kparam.context,code)
#endif /* HAVE_COM_ERR_H */
-#ifndef gss_nt_service_name
-#define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE
-#endif
-
#define LDAP_DEPRECATED 1
#ifdef HAVE_LDAP_REBIND_FUNCTION
#define LDAP_REFERRALS
int create_nd(struct main_args *margs);
int create_ls(struct main_args *margs);
+#ifdef HAVE_KRB5
int krb5_create_cache(struct main_args *margs, char *domain);
void krb5_cleanup(void);
+#endif
int get_ldap_hostname_list(struct main_args *margs, struct hstruct **hlist, int nhosts, char *domain);
int get_hostname_list(struct main_args *margs, struct hstruct **hlist, int nhosts, char *name);
if (domain) {
debug((char *) "%s| %s: DEBUG: Setup Kerberos credential cache\n", LogTime(), PROGRAM);
+#ifdef HAVE_KRB5
kc = krb5_create_cache(margs, domain);
if (kc) {
error((char *) "%s| %s: ERROR: Error during setup of Kerberos credential cache\n", LogTime(), PROGRAM);
}
+#else
+ kc = 1;
+ debug((char *) "%s| %s: DEBUG: Kerberos is not supported. Use username/passwaord with ldap url instead\n", LogTime(), PROGRAM);
+#endif
}
+
if (kc && (!margs->lurl || !margs->luser | !margs->lpass)) {
/*
* If Kerberos fails and no url given exit here
}
debug((char *) "%s| %s: DEBUG: Unbind ldap server\n", LogTime(), PROGRAM);
cleanup:
+#ifdef HAVE_KRB5
if (domain)
krb5_cleanup();
+#endif
if (lcreds) {
if (lcreds->dn)
xfree(lcreds->dn);