summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/common/ldb_dn.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c
index bd42bd5f18..f11ccf35d7 100644
--- a/source4/lib/ldb/common/ldb_dn.c
+++ b/source4/lib/ldb/common/ldb_dn.c
@@ -873,6 +873,22 @@ char *ldb_dn_get_extended_linearized(void *mem_ctx, struct ldb_dn *dn, int mode)
return p;
}
+/*
+ filter out all but an acceptable list of extended DN components
+ */
+void ldb_dn_extended_filter(struct ldb_dn *dn, const char * const *accept)
+{
+ int i;
+ for (i=0; i<dn->ext_comp_num; i++) {
+ if (!ldb_attr_in_list(accept, dn->ext_components[i].name)) {
+ memmove(&dn->ext_components[i],
+ &dn->ext_components[i+1],
+ (dn->ext_comp_num-(i+1))*sizeof(dn->ext_components[0]));
+ dn->ext_comp_num--;
+ i--;
+ }
+ }
+}
char *ldb_dn_alloc_linearized(void *mem_ctx, struct ldb_dn *dn)