- if ( method == LDAP_AUTH_SIMPLE ) {
- if( cred->bv_len == 0 ) {
- /* SUCCESS */
- send_ldap_result( conn, op, LDAP_SUCCESS,
- NULL, NULL, NULL, NULL );
-
- } else if ( be_isroot_pw( be, dn, cred ) ) {
- *edn = ch_strdup( be_root_dn( be ) );
- rc = 0; /* front end will send result */
-
- } else if ( refs != NULL ) {
- send_ldap_result( conn, op, LDAP_REFERRAL,
- matched_dn, NULL, refs, NULL );
-
- } else {
- send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS,
- NULL, NULL, NULL, NULL );
- }
-
- } else if ( method == LDAP_AUTH_SASL ) {
-#ifdef HAVE_CYRUS_SASL
- rc = sasl_bind( be, conn, op,
- dn, ndn, mech, cred, edn );
-#else
- if( mech != NULL && strcasecmp(mech,"DIGEST-MD5") == 0 ) {
- /* insert DIGEST calls here */
- send_ldap_result( conn, op, LDAP_AUTH_METHOD_NOT_SUPPORTED,
- NULL, NULL, NULL, NULL );
-
- } else {
- send_ldap_result( conn, op, LDAP_AUTH_METHOD_NOT_SUPPORTED,
- NULL, NULL, NULL, NULL );
- }
-#endif /* HAVE_CYRUS_SASL */
- } else if ( refs != NULL ) {
- send_ldap_result( conn, op, LDAP_REFERRAL,
- matched_dn, NULL, refs, NULL );
-
- } else {
- send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS,
- NULL, NULL, NULL, NULL );
- }
-
- if ( matched != NULL ) {
- ber_bvecfree( refs );
- free( matched_dn );
- }
- return( rc );