]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10025 slapo-dynlist: add option to disable filter support
authorHoward Chu <hyc@openldap.org>
Mon, 31 Jul 2023 17:43:30 +0000 (18:43 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 23 Jan 2024 18:46:21 +0000 (18:46 +0000)
doc/man/man5/slapo-dynlist.5
servers/slapd/overlays/dynlist.c

index 49a3d505d489e93c5821b7168711e8ac44a1f2de..7fe0f705058c0373d429f67fe2f38c0079571900 100644 (file)
@@ -134,6 +134,13 @@ character is also specified, then the member and memberOf values will be
 populated recursively, for nested groups. Note that currently nesting is
 only supported for Search operations, not Compares.
 
+.TP
+.B dynlist\-simple TRUE | FALSE
+This option downgrades to the behavior of the OpenLDAP 2.4 dynlist overlay.
+It disables memberOf processing, nested group support, and filter evaluation
+of dynamically generated values.
+The default is FALSE.
+
 .LP
 The dynlist overlay may be used with any backend, but it is mainly 
 intended for use with local storage backends.
index e0a28ad11492b463752f9fa94cd1c3585c542d9f..5c38b64f0ba54a6bcd95bf369a74dda456694130 100644 (file)
@@ -65,6 +65,7 @@ typedef struct dynlist_info_t {
 typedef struct dynlist_gen_t {
        dynlist_info_t  *dlg_dli;
        int                              dlg_memberOf;
+       int                              dlg_simple;
 } dynlist_gen_t;
 
 #define DYNLIST_USAGE \
@@ -1895,6 +1896,8 @@ dynlist_search( Operation *op, SlapReply *rs )
                userattrs = SLAP_USERATTRS( attrflags );
        }
 
+       if (dlg->dlg_simple)
+               goto simple;
        /* Find all groups in scope. For group expansion
         * we only need the groups within the search scope, but
         * for memberOf populating, we need all dyngroups.
@@ -2063,6 +2066,7 @@ dynlist_search( Operation *op, SlapReply *rs )
                                dynlist_nestlink( op, ds );
                }
        }
+simple:
 
        if ( dlg->dlg_dli || ds->ds_names != NULL ) {
                sc->sc_response = dynlist_search2resp;
@@ -2146,6 +2150,13 @@ static ConfigTable dlcfg[] = {
                3, 3, 0, ARG_MAGIC|DL_ATTRPAIR_COMPAT, dl_cfgen,
                        NULL, NULL, NULL },
 #endif
+       { "dynlist-simple", NULL, 0, 0, 0, ARG_OFFSET|ARG_ON_OFF,
+               (void *)offsetof(dynlist_gen_t, dlg_simple),
+               "( OLcfgOvAt:8.2 NAME 'olcDynListSimple' "
+                       "DESC 'Simple mode - disable features added since 2.4.' "
+                       "EQUALITY booleanMatch "
+                       "SYNTAX OMsBoolean SINGLE-VALUE )",
+                       NULL, NULL },
        { NULL, NULL, 0, 0, 0, ARG_IGNORED }
 };
 
@@ -2154,7 +2165,7 @@ static ConfigOCs dlocs[] = {
                "NAME ( 'olcDynListConfig' 'olcDynamicList' ) "
                "DESC 'Dynamic list configuration' "
                "SUP olcOverlayConfig "
-               "MAY olcDynListAttrSet )",
+               "MAY ( olcDynListAttrSet $ olcDynListSimple ) )",
                Cft_Overlay, dlcfg, NULL, NULL },
        { NULL, 0, NULL }
 };
@@ -2746,10 +2757,8 @@ dynlist_db_init(
                return 1;
        }
 
-       dlg = (dynlist_gen_t *)ch_malloc( sizeof( *dlg ));
+       dlg = (dynlist_gen_t *)ch_calloc( 1, sizeof( *dlg ));
        on->on_bi.bi_private = dlg;
-       dlg->dlg_dli = NULL;
-       dlg->dlg_memberOf = 0;
 
        return 0;
 }