1 /* bind.c - DNS SRV backend bind function */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 2000-2003 The OpenLDAP Foundation.
6 * Portions Copyright 2000-2003 Kurt D. Zeilenga.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted only as authorized by the OpenLDAP
13 * A copy of this license is available in the file LICENSE in the
14 * top-level directory of the distribution or, alternatively, at
15 * <http://www.OpenLDAP.org/license.html>.
18 * This work was originally developed by Kurt D. Zeilenga for inclusion
19 * in OpenLDAP Software.
27 #include <ac/socket.h>
28 #include <ac/string.h>
38 Debug( LDAP_DEBUG_TRACE, "DNSSRV: bind %s (%d)\n",
39 op->o_req_dn.bv_val == NULL ? "" : op->o_req_dn.bv_val,
40 op->oq_bind.rb_method, NULL );
42 if( op->oq_bind.rb_method == LDAP_AUTH_SIMPLE && op->oq_bind.rb_cred.bv_val != NULL && op->oq_bind.rb_cred.bv_len ) {
43 Statslog( LDAP_DEBUG_STATS,
44 "conn=%lu op=%lu DNSSRV BIND dn=\"%s\" provided passwd\n",
45 op->o_connid, op->o_opid,
46 op->o_req_dn.bv_val == NULL ? "" : op->o_req_dn.bv_val , 0, 0 );
48 Debug( LDAP_DEBUG_TRACE,
49 "DNSSRV: BIND dn=\"%s\" provided cleartext password\n",
50 op->o_req_dn.bv_val == NULL ? "" : op->o_req_dn.bv_val, 0, 0 );
52 send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
53 "you shouldn\'t send strangers your password" );
56 Debug( LDAP_DEBUG_TRACE, "DNSSRV: BIND dn=\"%s\"\n",
57 op->o_req_dn.bv_val == NULL ? "" : op->o_req_dn.bv_val, 0, 0 );
59 send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
60 "anonymous bind expected" );