r8779: Add rdn module to makefile and headers
authorSimo Sorce <idra@samba.org>
Tue, 26 Jul 2005 09:17:46 +0000 (09:17 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:30:04 +0000 (13:30 -0500)
Search by distinguishedName as if searching by dn
(This used to be commit 1d4046136255aead319ab08da229146dbd285b38)

source4/lib/ldb/Makefile.in
source4/lib/ldb/include/ldb_private.h
source4/lib/ldb/ldb_tdb/ldb_search.c

index 81e2b147d584111e1690af645a3541250747efaa..bbd2602ef7457f6f61c804026d5e7a7fb3fab833 100644 (file)
@@ -55,7 +55,7 @@ COMMON_OBJ=common/ldb.o common/ldb_ldif.o \
           common/ldb_dn.o common/ldb_match.o common/ldb_attributes.o \
           common/attrib_handlers.o
 
-MODULES_OBJ=modules/timestamps.o modules/schema.o
+MODULES_OBJ=modules/timestamps.o modules/schema.o modules/rdn_name.o
 
 OBJS =  $(MODULES_OBJ) $(COMMON_OBJ) $(LDB_TDB_OBJ) $(TDB_OBJ) $(TALLOC_OBJ) $(LDB_LDAP_OBJ) $(LDB_SQLITE3_OBJ)
 
index 0abf056db446ccc2751d1aff19ac55005f5ebdaa..43e6a3ecba229f572ddb8643355a63946d36dc00 100644 (file)
@@ -171,6 +171,8 @@ int lsqlite3_connect(struct ldb_context *ldb,
                     const char *options[]);
 struct ldb_module *timestamps_module_init(struct ldb_context *ldb, const char *options[]);
 struct ldb_module *schema_module_init(struct ldb_context *ldb, const char *options[]);
+struct ldb_module *rdn_name_module_init(struct ldb_context *ldb, const char *options[]);
+
 
 int ldb_match_msg(struct ldb_context *ldb, 
                  struct ldb_message *msg,
index 8e84cfa681dd996339c53d75e7a6564563bbe51d..922d24b6ebdfcf6df5a7e701331eedf603024812 100644 (file)
@@ -464,7 +464,8 @@ int ltdb_search_bytree(struct ldb_module *module, const char *base,
        /* it is important that we handle dn queries this way, and not
           via a full db search, otherwise ldb is horribly slow */
        if (tree->operation == LDB_OP_EQUALITY &&
-           ldb_attr_cmp(tree->u.equality.attr, "dn") == 0) {
+           (ldb_attr_cmp(tree->u.equality.attr, "dn") == 0 ||
+            ldb_attr_cmp(tree->u.equality.attr, "distinguishedName") == 0)) {
                return ltdb_search_dn(module, tree->u.equality.value.data, attrs, res);
        }