From: Pierangelo Masarati Date: Fri, 1 Jul 2005 09:53:20 +0000 (+0000) Subject: more checks (ITS#3817) X-Git-Tag: OPENLDAP_AC_BP~472 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d5763640890ec04891b311e1252dea996da112ee;p=openldap more checks (ITS#3817) --- diff --git a/servers/slapd/overlays/glue.c b/servers/slapd/overlays/glue.c index fda3061d6c..6e4e0836a1 100644 --- a/servers/slapd/overlays/glue.c +++ b/servers/slapd/overlays/glue.c @@ -654,7 +654,7 @@ glue_tool_entry_put ( ) { BackendDB *be, b2; - int rc; + int rc = NOID; b2 = *b0; b2.bd_info = (BackendInfo *)glue_tool_inst( b0->bd_info ); @@ -665,18 +665,26 @@ glue_tool_entry_put ( return NOID; if (!glueBack) { - rc = be->be_entry_open (be, glueMode); - if (rc != 0) + if ( be->be_entry_open ) { + rc = be->be_entry_open (be, glueMode); + } + if (rc != 0) { return NOID; + } } else if (be != glueBack) { /* If this entry belongs in a different branch than the * previous one, close the current database and open the * new one. */ - glueBack->be_entry_close (glueBack); - rc = be->be_entry_open (be, glueMode); - if (rc != 0) + if ( glueBack->be_entry_close ) { + glueBack->be_entry_close (glueBack); + } + if ( be->be_entry_open ) { + rc = be->be_entry_open (be, glueMode); + } + if (rc != 0) { return NOID; + } } glueBack = be; return be->be_entry_put (be, e, text); @@ -854,7 +862,7 @@ glue_init() glue.on_bi.bi_op_search = glue_op_search; glue.on_bi.bi_op_modify = glue_op_func; glue.on_bi.bi_op_modrdn = glue_op_func; - glue.on_bi.bi_op_add = glue_op_func; + glue.on_bi.bi_op_add = glue_op_func; glue.on_bi.bi_op_delete = glue_op_func; glue.on_bi.bi_chk_referrals = glue_chk_referrals;