summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2005-07-26 09:17:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:30:04 -0500
commit768585b1dd3fcc2f2180528bd94e1fef4a6ead7b (patch)
tree90fd80a754dc0253574b4e0e39e01d6121a06213
parent18cf9ccba72264a38134246822d5bb62df091175 (diff)
downloadsamba-768585b1dd3fcc2f2180528bd94e1fef4a6ead7b.tar.gz
samba-768585b1dd3fcc2f2180528bd94e1fef4a6ead7b.tar.bz2
samba-768585b1dd3fcc2f2180528bd94e1fef4a6ead7b.zip
r8779: Add rdn module to makefile and headers
Search by distinguishedName as if searching by dn (This used to be commit 1d4046136255aead319ab08da229146dbd285b38)
-rw-r--r--source4/lib/ldb/Makefile.in2
-rw-r--r--source4/lib/ldb/include/ldb_private.h2
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_search.c3
3 files changed, 5 insertions, 2 deletions
diff --git a/source4/lib/ldb/Makefile.in b/source4/lib/ldb/Makefile.in
index 81e2b147d5..bbd2602ef7 100644
--- a/source4/lib/ldb/Makefile.in
+++ b/source4/lib/ldb/Makefile.in
@@ -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)
diff --git a/source4/lib/ldb/include/ldb_private.h b/source4/lib/ldb/include/ldb_private.h
index 0abf056db4..43e6a3ecba 100644
--- a/source4/lib/ldb/include/ldb_private.h
+++ b/source4/lib/ldb/include/ldb_private.h
@@ -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,
diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c
index 8e84cfa681..922d24b6eb 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_search.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_search.c
@@ -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);
}