From 4a5cef7472880cec22028700a4337517a0672475 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Wed, 13 Apr 2005 00:01:53 +0000 Subject: [PATCH] fix access control when no backend could be found (might need work) --- servers/slapd/slapacl.c | 11 ++++++++++- servers/slapd/slapcommon.c | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/servers/slapd/slapacl.c b/servers/slapd/slapacl.c index d70c709c00..925127d057 100644 --- a/servers/slapd/slapacl.c +++ b/servers/slapd/slapacl.c @@ -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 || diff --git a/servers/slapd/slapcommon.c b/servers/slapd/slapcommon.c index 2eac187988..10a1548ec6 100644 --- a/servers/slapd/slapcommon.c +++ b/servers/slapd/slapcommon.c @@ -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 " -- 2.39.5