From 7ca6247395c4fb838516e4b3ec917b8f7c1769e4 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 22 Mar 2010 21:48:25 +0000 Subject: [PATCH] check for NULL backend (ITS#6490) --- servers/slapd/overlays/dds.c | 6 ++++++ servers/slapd/overlays/pcache.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/servers/slapd/overlays/dds.c b/servers/slapd/overlays/dds.c index f434720933..e7a5cd8375 100644 --- a/servers/slapd/overlays/dds.c +++ b/servers/slapd/overlays/dds.c @@ -1821,6 +1821,12 @@ slap_exop_refresh( op->o_req_dn = op->o_req_ndn; op->o_bd = select_backend( &op->o_req_ndn, 0 ); + if ( op->o_bd == NULL ) { + send_ldap_error( op, rs, LDAP_NO_SUCH_OBJECT, + "no global superior knowledge" ); + goto done; + } + if ( !SLAP_DYNAMIC( op->o_bd ) ) { send_ldap_error( op, rs, LDAP_UNAVAILABLE_CRITICAL_EXTENSION, "backend does not support dynamic directory services" ); diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index 05f94e4268..78c6bed9ae 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -5111,6 +5111,10 @@ pcache_exop_query_delete( op->o_req_dn = op->o_req_ndn; op->o_bd = select_backend( &op->o_req_ndn, 0 ); + if ( op->o_bd == NULL ) { + send_ldap_error( op, rs, LDAP_NO_SUCH_OBJECT, + "no global superior knowledge" ); + } rs->sr_err = backend_check_restrictions( op, rs, (struct berval *)&pcache_exop_QUERY_DELETE ); if ( rs->sr_err != LDAP_SUCCESS ) { -- 2.39.5