]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/connection.c
remove dbenv->lock_put() call from transaction-protected operations
[openldap] / servers / slapd / connection.c
index 5cb8f524aacffcac6b50c8e7b3ae5ea78c938995..a93af0d11679b6b19f2934aa1053dfd50cbd8260 100644 (file)
@@ -1189,7 +1189,7 @@ int connection_read(ber_socket_t s)
 
                } else if ( rc == 0 ) {
                        void *ssl;
-                       char *authid;
+                       struct berval authid = { 0, NULL };
 
                        c->c_needs_tls_accept = 0;
 
@@ -1201,8 +1201,21 @@ int connection_read(ber_socket_t s)
                                c->c_ssf = c->c_tls_ssf;
                        }
 
-                       authid = dnX509peerNormalize( ssl );
-                       slap_sasl_external( c, c->c_tls_ssf, authid );
+                       rc = dnX509peerNormalize( ssl, &authid );
+                       if ( rc != LDAP_SUCCESS ) {
+#ifdef NEW_LOGGING
+                               LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
+                               "connection_read: conn %lu unable to get TLS client DN, error %d\n",
+                                       c->c_connid, rc));
+#else
+                               Debug( LDAP_DEBUG_TRACE,
+                               "connection_read(%d): unable to get TLS client DN "
+                               "error=%d id=%lu\n",
+                               s, rc, c->c_connid );
+#endif
+                       }
+                       slap_sasl_external( c, c->c_tls_ssf, authid.bv_val );
+                       if ( authid.bv_val )    free( authid.bv_val );
                }
                connection_return( c );
                ldap_pvt_thread_mutex_unlock( &connections_mutex );
@@ -1410,6 +1423,8 @@ connection_input(
 
        op = slap_op_alloc( ber, msgid, tag, conn->c_n_ops_received++ );
 
+       op->vrFilter = NULL;
+
        op->o_pagedresults_state = conn->c_pagedresults_state;
 
 #ifdef LDAP_CONNECTIONLESS