1 /* kerberos.c - ldbm backend kerberos bind routines */
3 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
14 #include <ac/socket.h>
15 #include <ac/string.h>
18 #include "back-ldbm.h"
20 #define LDAP_KRB_PRINCIPAL "ldapserver"
22 extern char *ldap_srvtab;
23 extern Attribute *attr_find();
33 char instance[INST_SZ];
36 Debug( LDAP_DEBUG_TRACE, "=> kerberosv4_ldap_auth\n", 0, 0, 0 );
38 SAFEMEMCPY( ktxt->dat, cred->bv_val, cred->bv_len );
39 ktxt->length = cred->bv_len;
41 strcpy( instance, "*" );
42 if ( (err = krb_rd_req( ktxt, LDAP_KRB_PRINCIPAL, instance, 0L, ad,
43 ldap_srvtab )) != KSUCCESS ) {
44 Debug( LDAP_DEBUG_ANY, "krb_rd_req failed (%s)\n",
45 krb_err_txt[err], 0, 0 );
46 return( LDAP_INVALID_CREDENTIALS );
49 return( LDAP_SUCCESS );