/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2007 The OpenLDAP Foundation.
+ * Copyright 1998-2009 The OpenLDAP Foundation.
* Portions Copyright 1998-2003 Kurt D. Zeilenga.
* Portions Copyright 2003 IBM Corporation.
* All rights reserved.
break;
case SLAPINDEX:
- options = " [-c]\n\t[-g] [-n databasenumber | -b suffix] [attr ...] [-q]\n";
+ options = " [-c]\n\t[-g] [-n databasenumber | -b suffix] [attr ...] [-q] [-t]\n";
break;
case SLAPTEST:
switch( tool ) {
case SLAPADD:
- options = "b:cd:f:F:gj:l:n:o:qstuvw";
+ options = "b:cd:f:F:gj:l:n:o:qsS:uvw";
break;
case SLAPCAT:
break;
case SLAPTEST:
- options = "d:f:F:o:uv";
+ options = "d:f:F:o:Quv";
mode |= SLAP_TOOL_READMAIN | SLAP_TOOL_READONLY;
break;
break;
case SLAPINDEX:
- options = "b:cd:f:F:gn:o:qv";
+ options = "b:cd:f:F:gn:o:qtv";
mode |= SLAP_TOOL_READMAIN;
break;
dn_mode = SLAP_TOOL_LDAPDN_PRETTY;
break;
+ case 'Q':
+ quiet++;
+ slap_debug = 0;
+ break;
+
case 'q': /* turn on quick */
mode |= SLAP_TOOL_QUICK;
break;
realm = optarg;
break;
+ case 'S':
+ if ( lutil_atou( &csnsid, optarg )
+ || csnsid > SLAP_SYNC_SID_MAX )
+ {
+ usage( tool, progname );
+ }
+ break;
+
case 's': /* dump subtree */
if ( tool == SLAPADD )
mode |= SLAP_TOOL_NO_SCHEMA_CHECK;
}
if ( use_glue ) {
- rc = glue_sub_attach();
+ rc = glue_sub_attach( 0 );
if ( rc != 0 ) {
fprintf( stderr,
}
}
-void slap_tool_destroy( void )
+int slap_tool_destroy( void )
{
+ int rc = 0;
if ( !dryrun ) {
if ( need_shutdown ) {
- slap_shutdown( be );
+ if ( slap_shutdown( be ))
+ rc = EXIT_FAILURE;
}
- slap_destroy();
+ if ( slap_destroy())
+ rc = EXIT_FAILURE;
}
#ifdef SLAPD_MODULES
if ( slapMode == SLAP_SERVER_MODE ) {
if ( !BER_BVISNULL( &authcDN ) ) {
ch_free( authcDN.bv_val );
}
+
+ if ( ldiffp && ldiffp != &dummy ) {
+ ldif_close( ldiffp );
+ }
+ return rc;
}