/* make sure the DN is valid */
if( dn_normalize( e->e_ndn ) == NULL ) {
- fprintf( stderr, "%s: bad dn=\"%s\" (line=%d)\n",
+ fprintf( stderr, "%s: invalid dn=\"%s\" (line=%d)\n",
progname, e->e_dn, lineno );
rc = EXIT_FAILURE;
entry_free( e );
break;
}
- /* make sure the DN is valid */
+ /* make sure the DN is not empty */
if( e->e_ndn == '\0' ) {
fprintf( stderr, "%s: empty dn=\"%s\" (line=%d)\n",
progname, e->e_dn, lineno );
break;
}
+ /* check backend */
+ if( select_backend( e->e_ndn ) != be ) {
+ fprintf( stderr, "%s: database not configured to "
+ "hold dn=\"%s\" (line=%d)\n",
+ progname, e->e_dn, lineno );
+ rc = EXIT_FAILURE;
+ entry_free( e );
+ if( continuemode ) continue;
+ break;
+ }
+
if( !noschemacheck ) {
/* check schema */
const char *text;
if( continuemode ) continue;
break;
}
-
- /* check backend */
- if( select_backend( e->e_ndn ) != be ) {
- fprintf( stderr, "%s: database not configured to hold dn=\"%s\" (line=%d)\n",
- progname, e->e_dn, lineno );
- rc = EXIT_FAILURE;
- entry_free( e );
- if( continuemode ) continue;
- break;
- }
}
id = be->be_entry_put( be, e );