]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/add.c
Fix prev commit, overlay config was broken
[openldap] / servers / slapd / add.c
index 2945064004b5ad29777b793293a1abb222854d0e..92f6759aea4780fd17e2f8be50c7ea0757c758b0 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2004 The OpenLDAP Foundation.
+ * Copyright 1998-2005 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -220,14 +220,18 @@ fe_op_add( Operation *op, SlapReply *rs )
                if ( !rs->sr_ref ) rs->sr_ref = default_referral;
                if ( rs->sr_ref ) {
                        rs->sr_err = LDAP_REFERRAL;
+                       op->o_bd = frontendDB;
                        send_ldap_result( op, rs );
+                       op->o_bd = NULL;
 
                        if ( rs->sr_ref != default_referral ) {
                                ber_bvarray_free( rs->sr_ref );
                        }
                } else {
+                       op->o_bd = frontendDB;
                        send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
                                "no global superior knowledge" );
+                       op->o_bd = NULL;
                }
                goto done;
        }
@@ -583,6 +587,8 @@ slap_mods2entry(
                tail = &attr->a_next;
        }
 
+       *text = NULL;
+
        return LDAP_SUCCESS;
 }