]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/config.c
Moved unbind processing into connection_destroy. unbind handler is not needed.
[openldap] / servers / slapd / config.c
index 873f2d16c23a411e3c7dad2304142cf976bc5c2c..e4d67fedde2e219a18faf43cd42232ae397fc327 100644 (file)
@@ -222,7 +222,7 @@ read_config( char *fname )
                                char *dn = ch_strdup( cargv[1] );
                                (void) dn_normalize( dn );
                                charray_add( &be->be_suffix, dn );
-                               (void) dn_upcase( dn );
+                               (void) str2upper( dn );
                                charray_add( &be->be_nsuffix, dn );
                                free( dn );
                        }
@@ -240,7 +240,7 @@ read_config( char *fname )
                                Debug( LDAP_DEBUG_ANY,
 "%s: line %d: depth line must appear inside a database definition (ignored)\n",
                                    fname, lineno, 0 );
-                       } else if ((i = atoi(cargv[i])) < 0) {
+                       } else if ((i = atoi(cargv[1])) < 0) {
                                Debug( LDAP_DEBUG_ANY,
 "%s: line %d: depth must be positive (ignored)\n",
                                    fname, lineno, 0 );
@@ -264,7 +264,16 @@ read_config( char *fname )
                                    fname, lineno, 0 );
                        } else {
                                be->be_root_dn = ch_strdup( cargv[1] );
-                               be->be_root_ndn = dn_normalize_case( ch_strdup( cargv[1] ) );
+                               be->be_root_ndn = ch_strdup( cargv[1] );
+
+                               if( dn_normalize_case( be->be_root_ndn ) == NULL ) {
+                                       free( be->be_root_dn );
+                                       free( be->be_root_ndn );
+                                       Debug( LDAP_DEBUG_ANY,
+"%s: line %d: rootdn DN is invalid\n",
+                                          fname, lineno, 0 );
+                                       return( 1 );
+                               }
                        }
 
                /* set super-secret magic database password */
@@ -465,7 +474,12 @@ read_config( char *fname )
                                    fname, lineno, 0 );
                        } else {
                                be->be_update_ndn = ch_strdup( cargv[1] );
-                               (void) dn_normalize_case( be->be_update_ndn );
+                               if( dn_normalize_case( be->be_update_ndn ) == NULL ) {
+                                       Debug( LDAP_DEBUG_ANY,
+"%s: line %d: updatedn DN is invalid\n",
+                                           fname, lineno, 0 );
+                                       return 1;
+                               }
                        }
 
                } else if ( strcasecmp( cargv[0], "updateref" ) == 0 ) {
@@ -631,6 +645,12 @@ read_config( char *fname )
                                                      cargv[1] );
                        if ( rc )
                                return rc;
+               } else if ( !strcasecmp( cargv[0], "TLSVerifyClient" ) ) {
+                       rc = ldap_pvt_tls_set_option( NULL,
+                                                     LDAP_OPT_X_TLS_REQUIRE_CERT,
+                                                     cargv[1] );
+                       if ( rc )
+                               return rc;
 
 #endif