]> git.sur5r.net Git - openldap/commitdiff
Apply ldbm bind() change to bdb2 code.
authorKurt Zeilenga <kurt@openldap.org>
Tue, 2 Mar 1999 20:42:29 +0000 (20:42 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 2 Mar 1999 20:42:29 +0000 (20:42 +0000)
servers/slapd/back-bdb2/bind.c

index 5110515455e5b41890cae272066b2e29745d3169..7e759c5cde81dfbe9894b4c49672d8e07fe91cb6 100644 (file)
@@ -118,20 +118,17 @@ bdb2i_back_bind_internal(
                        /* stop front end from sending result */
                        rc = 1;
                        goto return_results;
-               } else if ( be_isroot_pw( be, dn, cred ) ) {
+               }
+
+               if ( be_isroot_pw( be, dn, cred ) ) {
                        /* front end will send result */
+                       if( *edn != NULL ) free( *edn );
                        *edn = ch_strdup( be_root_dn( be ) );
                        rc = 0;
                        goto return_results;
                }
 
                if ( (a = attr_find( e->e_attrs, "userpassword" )) == NULL ) {
-                       if ( be_isroot_pw( be, dn, cred ) ) {
-                               /* front end will send result */
-                               *edn = ch_strdup( be_root_dn( be ) );
-                               rc = 0;
-                               goto return_results;
-                       }
                        send_ldap_result( conn, op, LDAP_INAPPROPRIATE_AUTH,
                            NULL, NULL );
                        rc = 1;
@@ -140,12 +137,6 @@ bdb2i_back_bind_internal(
 
                if ( crypted_value_find( a->a_vals, cred, a->a_syntax, 0, cred ) != 0 )
                {
-                       if ( be_isroot_pw( be, dn, cred ) ) {
-                               /* front end will send result */
-                               *edn = ch_strdup( be_root_dn( be ) );
-                               rc = 0;
-                               goto return_results;
-                       }
                        send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS,
                                NULL, NULL );
                        rc = 1;