]> git.sur5r.net Git - openldap/commitdiff
fix access control when no backend could be found (might need work)
authorPierangelo Masarati <ando@openldap.org>
Wed, 13 Apr 2005 00:01:53 +0000 (00:01 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 13 Apr 2005 00:01:53 +0000 (00:01 +0000)
servers/slapd/slapacl.c
servers/slapd/slapcommon.c

index d70c709c0066541b902f65ff6d53cbb89e6b50b8..925127d0570a05b99c53f33b62b4e455459785a7 100644 (file)
@@ -222,9 +222,18 @@ slapacl( int argc, char **argv )
                op->o_bd = frontendDB;
        }
 
-       if ( !dryrun && be ) {
+       if ( !dryrun ) {
                ID      id;
 
+               if ( be == NULL ) {
+                       fprintf( stderr, "%s: no target database "
+                               "has been found for baseDN=\"%s\"; "
+                               "you may try with \"-u\" (dry run).\n",
+                               baseDN.bv_val, progname );
+                       rc = 1;
+                       goto destroy;
+               }
+
                if ( !be->be_entry_open ||
                        !be->be_entry_close ||
                        !be->be_dn2id_get ||
index 2eac18798855ca4b26ee1d008ddf6166b64740d4..10a1548ec65dc8520b34022e7ad390e7585ebacf 100644 (file)
@@ -576,7 +576,7 @@ startup:;
        mal_leaktrace(1);
 #endif
 
-       if ( !dryrun && slap_startup( be ) ) {
+       if ( !dryrun && be && slap_startup( be ) ) {
                switch ( tool ) {
                case SLAPTEST:
                        fprintf( stderr, "slap_startup failed "