From a2ca0b5e3cf2e1ac485f7046d67de9fc4e5171f9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 25 Aug 2006 06:41:37 +0000 Subject: r17821: changed ldb_search() and the ldbsearch command line utility to automatically work out the basedn when basedn==NULL. The basedn is fetched from the rootDSE defaultNamingContext value (if there is one) This means we don't have to have the defaultNamingContext logic in lots of places. It makes a lot of sense to me to have basedn==NULL mean "use the default, as given by the database" Note that explicitly specifing a basedn of '' is not the same thing, and will not trigger this code The baseDN is cached in a ldb opaque, so we only have to fetch it once (This used to be commit 5d1b66b68fc517ce684f75e466ed5f25e46857d5) --- source4/lib/ldb/include/ldb.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/lib/ldb/include') diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h index b07cdd964c..415eacbf61 100644 --- a/source4/lib/ldb/include/ldb.h +++ b/source4/lib/ldb/include/ldb.h @@ -822,6 +822,11 @@ struct ldb_context *ldb_init(void *mem_ctx); */ int ldb_connect(struct ldb_context *ldb, const char *url, unsigned int flags, const char *options[]); +/* + return an automatic baseDN from the defaultNamingContext of the rootDSE +*/ +const struct ldb_dn *ldb_auto_basedn(struct ldb_context *ldb); + /** Search the database -- cgit