mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-02-05 13:40:08 +08:00
Reorder DN check
This commit is contained in:
parent
efe39c999f
commit
b2e776cfe7
@ -59,7 +59,7 @@ main( int argc, char **argv )
|
|||||||
|
|
||||||
/* make sure the DN is valid */
|
/* make sure the DN is valid */
|
||||||
if( dn_normalize( e->e_ndn ) == NULL ) {
|
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 );
|
progname, e->e_dn, lineno );
|
||||||
rc = EXIT_FAILURE;
|
rc = EXIT_FAILURE;
|
||||||
entry_free( e );
|
entry_free( e );
|
||||||
@ -67,7 +67,7 @@ main( int argc, char **argv )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make sure the DN is valid */
|
/* make sure the DN is not empty */
|
||||||
if( e->e_ndn == '\0' ) {
|
if( e->e_ndn == '\0' ) {
|
||||||
fprintf( stderr, "%s: empty dn=\"%s\" (line=%d)\n",
|
fprintf( stderr, "%s: empty dn=\"%s\" (line=%d)\n",
|
||||||
progname, e->e_dn, lineno );
|
progname, e->e_dn, lineno );
|
||||||
@ -77,6 +77,17 @@ main( int argc, char **argv )
|
|||||||
break;
|
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 ) {
|
if( !noschemacheck ) {
|
||||||
/* check schema */
|
/* check schema */
|
||||||
const char *text;
|
const char *text;
|
||||||
@ -88,16 +99,6 @@ main( int argc, char **argv )
|
|||||||
if( continuemode ) continue;
|
if( continuemode ) continue;
|
||||||
break;
|
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 );
|
id = be->be_entry_put( be, e );
|
||||||
|
Loading…
Reference in New Issue
Block a user