]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldap/add.c
Sync with HEAD
[openldap] / servers / slapd / back-ldap / add.c
index eb272c76628fa067c9f8f489fc96d056725be588..96a9c3b94d089b216d1810a44f701a9abaf6ef71 100644 (file)
@@ -54,6 +54,7 @@ ldap_back_add(
 
        lc = ldap_back_getconn( op, rs, LDAP_BACK_SENDERR );
        if ( !lc || !ldap_back_dobind( lc, op, rs, LDAP_BACK_SENDERR ) ) {
+               lc = NULL;
                goto cleanup;
        }
 
@@ -68,7 +69,8 @@ ldap_back_add(
 
        isupdate = be_shadow_update( op );
        for ( i = 0, a = op->oq_add.rs_e->e_attrs; a; a = a->a_next ) {
-               if ( !isupdate && a->a_desc->ad_type->sat_no_user_mod  ) {
+               if ( !isupdate && !get_manageDIT( op ) && a->a_desc->ad_type->sat_no_user_mod  )
+               {
                        continue;
                }
 
@@ -116,6 +118,10 @@ cleanup:
                ch_free( attrs );
        }
 
+       if ( lc ) {
+               ldap_back_release_conn( op, rs, lc );
+       }
+
        Debug( LDAP_DEBUG_ARGS, "<== ldap_back_add(\"%s\"): %d\n",
                        op->o_req_dn.bv_val, rs->sr_err, 0 );