summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_ldap/ldb_ldap.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2005-06-14 19:15:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:11 -0500
commit9189833a8753a723a8b8d0af9c8b096571b06a84 (patch)
treed20481827bb51e1d2a6cddb2a7bcb64ff653b7a7 /source4/lib/ldb/ldb_ldap/ldb_ldap.c
parent056d63c62f3793fda0d3049a2f98cef435c9003e (diff)
downloadsamba-9189833a8753a723a8b8d0af9c8b096571b06a84.tar.gz
samba-9189833a8753a723a8b8d0af9c8b096571b06a84.tar.bz2
samba-9189833a8753a723a8b8d0af9c8b096571b06a84.zip
r7582: Better way to have a fast path searching for a specific DN.
Old way was ugly and had a bug, you couldn't add an attribute named dn or distinguishedName and search for it, tdb would change that search in a dn search. This makes it also possible to search by dn against an ldap server as the old method was not supported by ldap syntaxes. sss (This used to be commit a614466dec2484a0d39bdfae53da822cfcf80926)
Diffstat (limited to 'source4/lib/ldb/ldb_ldap/ldb_ldap.c')
-rw-r--r--source4/lib/ldb/ldb_ldap/ldb_ldap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/lib/ldb/ldb_ldap/ldb_ldap.c b/source4/lib/ldb/ldb_ldap/ldb_ldap.c
index fceaf02196..b3d8fcc1a5 100644
--- a/source4/lib/ldb/ldb_ldap/ldb_ldap.c
+++ b/source4/lib/ldb/ldb_ldap/ldb_ldap.c
@@ -196,6 +196,10 @@ static int lldb_search(struct ldb_module *module, const char *base,
base = "";
}
+ if (expression == NULL || expression[0] == '\0') {
+ expression = "objectClass=*";
+ }
+
lldb->last_rc = ldap_search_s(lldb->ldap, base, (int)scope,
expression,
discard_const_p(char *, attrs),