mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 00:29:35 -05:00
Add -s option to slapadd to disable schema checking
This commit is contained in:
parent
3d3fe8fe83
commit
c51a71e5c2
3 changed files with 18 additions and 12 deletions
|
|
@ -1514,6 +1514,7 @@ LDAP_SLAPD_V (int) slapMode;
|
|||
#define SLAP_TOOL_READMAIN 0x0200
|
||||
#define SLAP_TOOL_READONLY 0x0400
|
||||
#define SLAP_TOOL_QUICK 0x0800
|
||||
#define SLAP_TOOL_NO_SCHEMA_CHECK 0x1000
|
||||
|
||||
#define SB_TLS_DEFAULT (-1)
|
||||
#define SB_TLS_OFF 0
|
||||
|
|
|
|||
|
|
@ -193,16 +193,18 @@ slapadd( int argc, char **argv )
|
|||
/* check schema */
|
||||
op->o_bd = be;
|
||||
|
||||
rc = entry_schema_check( op, e, NULL, manage,
|
||||
&text, textbuf, textlen );
|
||||
if ( (slapMode & SLAP_TOOL_NO_SCHEMA_CHECK) == 0) {
|
||||
rc = entry_schema_check( op, e, NULL, manage,
|
||||
&text, textbuf, textlen );
|
||||
|
||||
if( rc != LDAP_SUCCESS ) {
|
||||
fprintf( stderr, "%s: dn=\"%s\" (line=%d): (%d) %s\n",
|
||||
progname, e->e_dn, lineno, rc, text );
|
||||
rc = EXIT_FAILURE;
|
||||
entry_free( e );
|
||||
if( continuemode ) continue;
|
||||
break;
|
||||
if( rc != LDAP_SUCCESS ) {
|
||||
fprintf( stderr, "%s: dn=\"%s\" (line=%d): (%d) %s\n",
|
||||
progname, e->e_dn, lineno, rc, text );
|
||||
rc = EXIT_FAILURE;
|
||||
entry_free( e );
|
||||
if( continuemode ) continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ usage( int tool, const char *progname )
|
|||
|
||||
case SLAPADD:
|
||||
options = " [-c]\n\t[-g] [-n databasenumber | -b suffix]\n"
|
||||
"\t[-l ldiffile] [-q] [-u] [-w]\n";
|
||||
"\t[-l ldiffile] [-q] [-u] [-s] [-w]\n";
|
||||
break;
|
||||
|
||||
case SLAPAUTH:
|
||||
|
|
@ -211,7 +211,7 @@ slap_tool_init(
|
|||
|
||||
switch( tool ) {
|
||||
case SLAPADD:
|
||||
options = "b:cd:f:F:gl:n:qtuvw";
|
||||
options = "b:cd:f:F:gl:n:qstuvw";
|
||||
break;
|
||||
|
||||
case SLAPCAT:
|
||||
|
|
@ -344,7 +344,10 @@ slap_tool_init(
|
|||
break;
|
||||
|
||||
case 's': /* dump subtree */
|
||||
subtree = strdup( optarg );
|
||||
if ( tool == SLAPADD )
|
||||
mode |= SLAP_TOOL_NO_SCHEMA_CHECK;
|
||||
else if ( tool == SLAPCAT )
|
||||
subtree = strdup( optarg );
|
||||
break;
|
||||
|
||||
case 't': /* turn on truncate */
|
||||
|
|
|
|||
Loading…
Reference in a new issue