]> git.sur5r.net Git - openldap/commitdiff
Deleted Connection->c_cdn. Use conn->c_dn instead...
authorHoward Chu <hyc@openldap.org>
Wed, 12 Jun 2002 08:38:59 +0000 (08:38 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 12 Jun 2002 08:38:59 +0000 (08:38 +0000)
servers/slapd/back-ldap/bind.c
servers/slapd/back-meta/conn.c
servers/slapd/back-monitor/conn.c
servers/slapd/bind.c
servers/slapd/connection.c
servers/slapd/slap.h

index 2c1af55ef793c2da2059f3bb7f9c11bee4a9dc92..c0e532930a884995f4ddb0b0b37b2248651037fd 100644 (file)
@@ -242,7 +242,7 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op)
                ( void )rewrite_session_init( li->rwinfo, conn );
 #endif /* ENABLE_REWRITE */
 
-               if ( lc->conn->c_cdn.bv_len != 0 ) {
+               if ( lc->conn->c_dn.bv_len != 0 ) {
                        
                        /*
                         * Rewrite the bind dn if needed
@@ -251,23 +251,23 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op)
                        lc->bound_dn.bv_val = NULL;
                        lc->bound_dn.bv_len = 0;
                        switch ( rewrite_session( li->rwinfo, "bindDn",
-                                               lc->conn->c_cdn.bv_val, conn,
+                                               lc->conn->c_dn.bv_val, conn,
                                                &lc->bound_dn.bv_val ) ) {
                        case REWRITE_REGEXEC_OK:
                                if ( lc->bound_dn.bv_val == NULL ) {
-                                       ber_dupbv( &lc->bound_dn, &lc->conn->c_cdn );
+                                       ber_dupbv( &lc->bound_dn, &lc->conn->c_dn );
                                }
 #ifdef NEW_LOGGING
                                LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
                                                "[rw] bindDn: \"%s\" ->"
                                                " \"%s\"\n%s",
-                                               lc->conn->c_cdn.bv_val,
+                                               lc->conn->c_dn.bv_val,
                                                lc->bound_dn.bv_val ));
 #else /* !NEW_LOGGING */
                                Debug( LDAP_DEBUG_ARGS,
                                                "rw> bindDn: \"%s\" ->"
                                                " \"%s\"\n%s",
-                                               lc->conn->c_cdn.bv_val,
+                                               lc->conn->c_dn.bv_val,
                                                lc->bound_dn.bv_val, "" );
 #endif /* !NEW_LOGGING */
                                break;
@@ -288,8 +288,8 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op)
                        }
 #else /* !ENABLE_REWRITE */
                        struct berval bv;
-                       ldap_back_dn_massage( li, &lc->conn->c_cdn, &bv, 0, 1 );
-                       if ( bv.bv_val == lc->conn->c_cdn.bv_val )
+                       ldap_back_dn_massage( li, &lc->conn->c_dn, &bv, 0, 1 );
+                       if ( bv.bv_val == lc->conn->c_dn.bv_val )
                                ber_dupbv( &lc->bound_dn, &bv );
                        else
                                lc->bound_dn = bv;
index 66f820c979a0f269e3c28f4d119bd0a8c402ca79..8f17f60590917869eb9784313da395c6e2916e26 100644 (file)
@@ -275,27 +275,27 @@ init_one_conn(
        /*
         * If the connection dn is not null, an attempt to rewrite it is made
         */
-       if ( conn->c_cdn.bv_len != 0 ) {
+       if ( conn->c_dn.bv_len != 0 ) {
                
                /*
                 * Rewrite the bind dn if needed
                 */
                lsc->bound_dn.bv_val = NULL;
                switch ( rewrite_session( lt->rwinfo, "bindDn",
-                                       conn->c_cdn.bv_val, conn, 
+                                       conn->c_dn.bv_val, conn, 
                                        &lsc->bound_dn.bv_val ) ) {
                case REWRITE_REGEXEC_OK:
                        if ( lsc->bound_dn.bv_val == NULL ) {
-                               ber_dupbv( &lsc->bound_dn, &conn->c_cdn );
+                               ber_dupbv( &lsc->bound_dn, &conn->c_dn );
                        }
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
                                        "[rw] bindDn: \"%s\" -> \"%s\"\n",
-                                       conn->c_cdn.bv_val, lsc->bound_dn.bv_val ));
+                                       conn->c_dn.bv_val, lsc->bound_dn.bv_val ));
 #else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS,
                                        "rw> bindDn: \"%s\" -> \"%s\"\n",
-                                       conn->c_cdn.bv_val, lsc->bound_dn.bv_val, 0 );
+                                       conn->c_dn.bv_val, lsc->bound_dn.bv_val, 0 );
 #endif /* !NEW_LOGGING */
                        break;
                        
index ae877020b70893cc627f6a68177bee27697af5c1..43ba3dc4e4fe951f19601e3bac973da08adc280a 100644 (file)
@@ -322,7 +322,7 @@ conn_create(
                connection_state2str( c->c_conn_state ),
                c->c_sasl_bind_in_progress ? "S" : "",
                
-               c->c_cdn.bv_len ? c->c_cdn.bv_val : SLAPD_ANONYMOUS,
+               c->c_dn.bv_len ? c->c_dn.bv_val : SLAPD_ANONYMOUS,
                
                c->c_listener_url.bv_val,
                c->c_peer_domain.bv_val,
index 677d7dea1eeed6b18b7f4422f805153923e0deec..abd8ed182ac5cf580ea67c44b6db8e2018002c84 100644 (file)
@@ -497,11 +497,10 @@ do_bind(
                        if(edn.bv_len) {
                                conn->c_dn = edn;
                        } else {
-                               ber_dupbv( &conn->c_dn, &pdn );
+                               conn->c_dn = pdn;
+                               pdn.bv_val = NULL;
+                               pdn.bv_len = 0;
                        }
-                       conn->c_cdn = pdn;
-                       pdn.bv_val = NULL;
-                       pdn.bv_len = 0;
 
                        conn->c_ndn = ndn;
                        ndn.bv_val = NULL;
@@ -516,11 +515,11 @@ do_bind(
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
                                "do_bind: conn %d  v%d bind: \"%s\" to \"%s\" \n",
-                               conn->c_connid, version, conn->c_cdn.bv_val, conn->c_dn.bv_val ));
+                               conn->c_connid, version, dn.bv_val, conn->c_dn.bv_val ));
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "do_bind: v%d bind: \"%s\" to \"%s\"\n",
-                               version, conn->c_cdn.bv_val, conn->c_dn.bv_val );
+                               version, dn.bv_val, conn->c_dn.bv_val );
 #endif
 
                        ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
index 037f4c759b948818d4894bc4238dc4df6edb2574..0f4ce390dad14242e498e711b9ea3bd12e02aeb7 100644 (file)
@@ -417,8 +417,6 @@ long connection_init(
                c->c_dn.bv_len = 0;
                c->c_ndn.bv_val = NULL;
                c->c_ndn.bv_len = 0;
-               c->c_cdn.bv_val = NULL;
-               c->c_cdn.bv_len = 0;
                c->c_groups = NULL;
 
                c->c_listener_url.bv_val = NULL;
@@ -461,7 +459,6 @@ long connection_init(
     assert( c->c_authmech.bv_val == NULL );
     assert( c->c_dn.bv_val == NULL );
     assert( c->c_ndn.bv_val == NULL );
-    assert( c->c_cdn.bv_val == NULL );
     assert( c->c_groups == NULL );
     assert( c->c_listener_url.bv_val == NULL );
     assert( c->c_peer_domain.bv_val == NULL );
@@ -598,12 +595,6 @@ void connection2anonymous( Connection *c )
        }
        c->c_ndn.bv_len = 0;
 
-       if(c->c_cdn.bv_val != NULL) {
-               free(c->c_cdn.bv_val);
-               c->c_cdn.bv_val = NULL;
-       }
-       c->c_cdn.bv_len = 0;
-
        c->c_authz_backend = NULL;
        
        {
index f6009fee698a93314c2fd5e50cfc5dce2477acc6..fb8ab890a5311da067a5222d7b7b0f5643acfebf 100644 (file)
@@ -1550,7 +1550,6 @@ typedef struct slap_conn {
        int             c_sasl_bind_in_progress;        /* multi-op bind in progress */
        struct berval   c_sasl_bind_mech;                       /* mech in progress */
        struct berval   c_sasl_dn;      /* temporary storage */
-       struct berval   c_cdn;
 
        /* authorization backend */
        Backend *c_authz_backend;