]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/dynlist.c
More accesslog updates
[openldap] / servers / slapd / overlays / dynlist.c
index 1daf77fd05ec3f56d8c0f672376fca4e155996b2..3615ab16dfb240dc2d21f91d21dbb8b6abe72b89 100644 (file)
 /* FIXME: the code differs if SLAP_OPATTRS is defined or not;
  * SLAP_OPATTRS is not defined in 2.2 yet, while this overlay
  * expects HEAD code at least later than August 6, 2004. */
+/* FIXME: slap_anlist_no_attrs was introduced in 2.3; here it
+ * is anticipated to allow using this overlay with 2.2. */
+
+#if LDAP_VENDOR_VERSION_MINOR != X && LDAP_VENDOR_VERSION_MINOR < 3
+static AttributeName anlist_no_attrs[] = {
+       { BER_BVC( LDAP_NO_ATTRS ), NULL, 0, NULL },
+       { BER_BVNULL, NULL, 0, NULL }
+};
+
+static AttributeName *slap_anlist_no_attrs = anlist_no_attrs;
+#endif
 
 typedef struct dynlist_info {
        ObjectClass             *dli_oc;
@@ -211,7 +222,7 @@ dynlist_sc_update( Operation *op, SlapReply *rs )
 
                /* test access to attribute */
                for ( i = 0; !BER_BVISNULL( &a->a_vals[i] ); i++ )
-                       /* jst count */ ;
+                       /* just count */ ;
 
                vals = op->o_tmpalloc( ( i + 1 ) * sizeof( struct berval ), op->o_tmpmemctx );
                if ( a->a_nvals != a->a_vals ) {
@@ -275,7 +286,7 @@ dynlist_send_entry( Operation *op, SlapReply *rs )
        Attribute       *a;
        slap_callback   cb;
        Operation       o = *op;
-       SlapReply       r = *rs;
+       SlapReply       r = { REP_SEARCH };
        struct berval   *url;
        Entry           *e;
        int             e_flags;
@@ -300,6 +311,7 @@ dynlist_send_entry( Operation *op, SlapReply *rs )
        cb.sc_next = NULL;
 
        o.o_callback = &cb;
+       o.ors_deref = LDAP_DEREF_NEVER;
        o.ors_limit = NULL;
        o.ors_tlimit = SLAP_NO_LIMIT;
        o.ors_slimit = SLAP_NO_LIMIT;
@@ -516,6 +528,7 @@ dynlist_compare( Operation *op, SlapReply *rs )
        }
 
        o.ors_scope = LDAP_SCOPE_BASE;
+       o.ors_deref = LDAP_DEREF_NEVER;
        an[0].an_name = op->orc_ava->aa_desc->ad_cname;
        an[0].an_desc = op->orc_ava->aa_desc;
        BER_BVZERO( &an[1].an_name );
@@ -676,18 +689,17 @@ dynlist_db_open(
 {
        slap_overinst   *on = (slap_overinst *) be->bd_info;
        dynlist_info    *dli = (dynlist_info *)on->on_bi.bi_private;
-       int             rc = 0;
        ber_len_t       len;
        char            *ptr;
 
        if ( dli->dli_oc == NULL ) {
                fprintf( stderr, "dynlist_db_open(): missing \"dynlist-oc <ObjectClass>\"\n" );
-               rc = -1;
+               return -1;
        }
 
        if ( dli->dli_ad == NULL ) {
                fprintf( stderr, "dynlist_db_open(): missing \"dynlist-ad <AttributeDescription>\"\n" );
-               rc = -1;
+               return -1;
        }
 
        len = STRLENOF( "(!(objectClass=" "))" )
@@ -702,7 +714,7 @@ dynlist_db_open(
        ptr = lutil_strcopy( ptr, "))" );
        dli->dli_default_filter.bv_len = ptr - dli->dli_default_filter.bv_val;
 
-       return rc;
+       return 0;
 }
 
 static int