]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/slapcommon.c
ITS#7256 Set backend for operation.
[openldap] / servers / slapd / slapcommon.c
index 153310f2916b262c2374bc19c4d187c67b9bf579..01a49554ebc3cc06daf23c4c4a0f55138ace5d72 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2013 The OpenLDAP Foundation.
+ * Copyright 1998-2014 The OpenLDAP Foundation.
  * Portions Copyright 1998-2003 Kurt D. Zeilenga.
  * Portions Copyright 2003 IBM Corporation.
  * All rights reserved.
@@ -786,6 +786,11 @@ slap_tool_init(
                ber_memfree( nbase.bv_val );
                BER_BVZERO( &nbase );
 
+               if( be == NULL ) {
+                       fprintf( stderr, "%s: slap_init no backend for \"%s\"\n",
+                               progname, base.bv_val );
+                       exit( EXIT_FAILURE );
+               }
                switch ( tool ) {
                case SLAPACL:
                        goto startup;
@@ -794,11 +799,6 @@ slap_tool_init(
                        break;
                }
 
-               if( be == NULL ) {
-                       fprintf( stderr, "%s: slap_init no backend for \"%s\"\n",
-                               progname, base.bv_val );
-                       exit( EXIT_FAILURE );
-               }
                /* If the named base is a glue master, operate on the
                 * entire context
                 */