+ } else {
+ rc = backend_check_restrictions( NULL, conn, op,
+ &mech, &text );
+ }
+
+ /*
+ * we already forced connection to "anonymous",
+ * just need to send success
+ */
+ send_ldap_result( conn, op, rc,
+ NULL, text, NULL, NULL );
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, DETAIL1,
+ "do_bind: conn %d v%d anonymous bind\n",
+ conn->c_connid, version , 0 );
+#else
+ Debug( LDAP_DEBUG_TRACE, "do_bind: v%d anonymous bind\n",
+ version, 0, 0 );
+#endif
+ goto cleanup;
+
+ } else if ( global_disallows & SLAP_DISALLOW_BIND_SIMPLE ) {
+ /* disallow simple authentication */
+ rc = LDAP_UNWILLING_TO_PERFORM;
+ text = "unwilling to perform simple authentication";
+
+ send_ldap_result( conn, op, rc,
+ NULL, text, NULL, NULL );
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, INFO,
+ "do_bind: conn %d v%d simple bind(%s) disallowed\n",
+ conn->c_connid, version, ndn.bv_val );
+#else
+ Debug( LDAP_DEBUG_TRACE,
+ "do_bind: v%d simple bind(%s) disallowed\n",
+ version, ndn.bv_val, 0 );
+#endif
+ goto cleanup;
+
+ } else if (( global_disallows & SLAP_DISALLOW_BIND_SIMPLE_UNPROTECTED )
+ && ( op->o_ssf < global_ssf_set.sss_ssf ))
+ {
+ rc = LDAP_CONFIDENTIALITY_REQUIRED;
+ text = "unwilling to perform simple authentication "
+ "without confidentilty protection";
+
+ send_ldap_result( conn, op, rc,
+ NULL, text, NULL, NULL );
+
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, INFO, "do_bind: conn %d "
+ "v%d unprotected simple bind(%s) disallowed\n",
+ conn->c_connid, version, ndn.bv_val );
+#else
+ Debug( LDAP_DEBUG_TRACE,
+ "do_bind: v%d unprotected simple bind(%s) disallowed\n",
+ version, ndn.bv_val, 0 );
+#endif
+ goto cleanup;
+ }
+
+#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
+ } else if ( method == LDAP_AUTH_KRBV41 || method == LDAP_AUTH_KRBV42 ) {
+ if ( global_disallows & SLAP_DISALLOW_BIND_KRBV4 ) {
+ /* disallow simple authentication */
+ rc = LDAP_UNWILLING_TO_PERFORM;
+ text = "unwilling to perform Kerberos V4 bind";
+
+ send_ldap_result( conn, op, rc,
+ NULL, text, NULL, NULL );
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, DETAIL1,
+ "do_bind: conn %d v%d Kerberos V4 bind\n",
+ conn->c_connid, version , 0 );
+#else
+ Debug( LDAP_DEBUG_TRACE, "do_bind: v%d Kerberos V4 bind\n",
+ version, 0, 0 );
+#endif
+ goto cleanup;
+ }
+#endif
+
+ } else {
+ rc = LDAP_AUTH_METHOD_NOT_SUPPORTED;
+ text = "unknown authentication method";
+
+ send_ldap_result( conn, op, rc,
+ NULL, text, NULL, NULL );
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, INFO,
+ "do_bind: conn %ld v%d unknown authentication method (%ld)\n",
+ conn->c_connid, version, method );
+#else
+ Debug( LDAP_DEBUG_TRACE,
+ "do_bind: v%d unknown authentication method (%ld)\n",
+ version, method, 0 );
+#endif
+ goto cleanup;