]> git.sur5r.net Git - openldap/commitdiff
deal with the case a pseudorootn is not defined
authorPierangelo Masarati <ando@openldap.org>
Sat, 1 Oct 2005 18:31:14 +0000 (18:31 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 1 Oct 2005 18:31:14 +0000 (18:31 +0000)
servers/slapd/back-meta/conn.c

index 303c4e61474b9112d6798a0272454de20a9dd150..1d0a548958edfb671cdfe210ab6b75f2e0805a1a 100644 (file)
@@ -351,8 +351,16 @@ retry:;
         */
 
        if ( ispriv ) {
-               ber_dupbv( &msc->msc_cred, &mt->mt_pseudorootpw );
-               ber_dupbv( &msc->msc_bound_ndn, &mt->mt_pseudorootdn );
+               if ( !BER_BVISNULL( &mt->mt_pseudorootdn ) ) {
+                       ber_dupbv( &msc->msc_bound_ndn, &mt->mt_pseudorootdn );
+                       if ( !BER_BVISNULL( &mt->mt_pseudorootpw ) ) {
+                               ber_dupbv( &msc->msc_cred, &mt->mt_pseudorootpw );
+                       }
+
+               } else {
+                       ber_str2bv( "", 0, 1, &msc->msc_bound_ndn );
+               }
+
                LDAP_BACK_CONN_ISPRIV_SET( msc );
 
        } else {