]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/slapcommon.c
Fix rev 1.266, was creating {0}config entry prematurely.
[openldap] / servers / slapd / slapcommon.c
index 188d4c73e5c6e1064a6ef200937443a21febe6a1..1a6a043ccfa7a4b3e96296b969157ae10198bdcb 100644 (file)
@@ -241,7 +241,7 @@ slap_tool_init(
 
        switch( tool ) {
        case SLAPADD:
-               options = "b:cd:f:F:gj:l:n:o:qstuvw";
+               options = "b:cd:f:F:gj:l:n:o:qsS:tuvw";
                break;
 
        case SLAPCAT:
@@ -255,7 +255,7 @@ slap_tool_init(
                break;
 
        case SLAPTEST:
-               options = "d:f:F:o:uv";
+               options = "d:f:F:o:Quv";
                mode |= SLAP_TOOL_READMAIN | SLAP_TOOL_READONLY;
                break;
 
@@ -371,6 +371,11 @@ slap_tool_init(
                        dn_mode = SLAP_TOOL_LDAPDN_PRETTY;
                        break;
 
+               case 'Q':
+                       quiet++;
+                       slap_debug = 0;
+                       break;
+
                case 'q':       /* turn on quick */
                        mode |= SLAP_TOOL_QUICK;
                        break;
@@ -379,6 +384,14 @@ slap_tool_init(
                        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;
@@ -755,4 +768,8 @@ void slap_tool_destroy( void )
        if ( !BER_BVISNULL( &authcDN ) ) {
                ch_free( authcDN.bv_val );
        }
+
+       if ( ldiffp && ldiffp != &dummy ) {
+               ldif_close( ldiffp );
+       }
 }