]> git.sur5r.net Git - openldap/commitdiff
ITS#3426, copy group ACL cache to saved Op
authorHoward Chu <hyc@openldap.org>
Thu, 9 Dec 2004 08:14:57 +0000 (08:14 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 9 Dec 2004 08:14:57 +0000 (08:14 +0000)
servers/slapd/overlays/syncprov.c

index 9c44dc66a883b94c2e39bb2a9ae75af0acd8409f..246509174898c4e1d1f0a9f6447f495b5ae22ffb 100644 (file)
@@ -1501,6 +1501,7 @@ syncprov_detach_op( Operation *op, syncops *so )
        int i, alen = 0;
        size_t size;
        char *ptr;
+       GroupAssertion *g1, *g2;
 
        /* count the search attrs */
        for (i=0; op->ors_attrs && !BER_BVISNULL( &op->ors_attrs[i].an_name ); i++) {
@@ -1544,6 +1545,16 @@ syncprov_detach_op( Operation *op, syncops *so )
        op2->o_callback = NULL;
        so->s_op = op2;
 
+       /* Copy any cached group ACLs individually */
+       op2->o_groups = NULL;
+       for ( g1=op->o_groups; g1; g1=g1->ga_next ) {
+               g2 = ch_malloc( sizeof(GroupAssertion) + g1->ga_len );
+               *g2 = *g1;
+               strcpy( g2->ga_ndn, g1->ga_ndn );
+               g2->ga_next = op2->o_groups;
+               op2->o_groups = g2;
+       }
+
        /* Increment number of ops so that idletimeout ignores us */
        ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
        op->o_conn->c_n_ops_executing++;