mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
4a8ab5dbf2
ITS#1677 - cast away const warnings ITS#1678 - unsigned char args to ctype funcs ITS#1682 - don't redefine ldap_debug ITS#1683 - uninitialized vars ITS#1703 - ldo_debug initialization ITS#1705 - unsigned testing ITS#1706 - socklen_t args ITS#1719 - back-tcl update (other cleanups/fixes/improvements; yet untested) ITS#1724 - integerNormalize/integerFilter/integerIndexer bugs ITS#1725 - libdes not required Implement back-null (/dev/null style backend) Cleanup some misc warnings ("%lu" format, unused/uninitialized vars, ambiguous operator precedence) Kurt, please regenerate configure
59 lines
1.4 KiB
C
59 lines
1.4 KiB
C
/* bind.c - DNS SRV backend bind function */
|
|
/* $OpenLDAP$ */
|
|
/*
|
|
* Copyright 2000-2002 The OpenLDAP Foundation, All Rights Reserved.
|
|
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
|
*/
|
|
|
|
|
|
#include "portable.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <ac/socket.h>
|
|
#include <ac/string.h>
|
|
|
|
#include "slap.h"
|
|
#include "external.h"
|
|
|
|
int
|
|
dnssrv_back_bind(
|
|
Backend *be,
|
|
Connection *conn,
|
|
Operation *op,
|
|
struct berval *dn,
|
|
struct berval *ndn,
|
|
int method,
|
|
struct berval *cred,
|
|
struct berval *edn )
|
|
{
|
|
Debug( LDAP_DEBUG_TRACE, "DNSSRV: bind %s (%d)\n",
|
|
dn->bv_val == NULL ? "" : dn->bv_val,
|
|
method, NULL );
|
|
|
|
if( method == LDAP_AUTH_SIMPLE && cred != NULL && cred->bv_len ) {
|
|
Statslog( LDAP_DEBUG_STATS,
|
|
"conn=%lu op=%lu DNSSRV BIND dn=\"%s\" provided passwd\n",
|
|
op->o_connid, op->o_opid,
|
|
dn->bv_val == NULL ? "" : dn->bv_val , 0, 0 );
|
|
|
|
Debug( LDAP_DEBUG_TRACE,
|
|
"DNSSRV: BIND dn=\"%s\" provided cleartext password\n",
|
|
dn->bv_val == NULL ? "" : dn->bv_val, 0, 0 );
|
|
|
|
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
|
|
NULL, "you shouldn\'t send strangers your password",
|
|
NULL, NULL );
|
|
|
|
} else {
|
|
Debug( LDAP_DEBUG_TRACE, "DNSSRV: BIND dn=\"%s\"\n",
|
|
dn->bv_val == NULL ? "" : dn->bv_val, 0, 0 );
|
|
|
|
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
|
|
NULL, "anonymous bind expected",
|
|
NULL, NULL );
|
|
}
|
|
|
|
return 1;
|
|
}
|