r10895: allow 'dn=string' searches to work again. Windows doesn't allow these,
authorAndrew Tridgell <tridge@samba.org>
Tue, 11 Oct 2005 12:25:55 +0000 (12:25 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:39:41 +0000 (13:39 -0500)
but they are so very useful for things like dn=@MODULES that I think
its worth supporting them
(This used to be commit e2e3193a98b0f81c7bdb02c98db375ca0449022a)

source4/lib/ldb/common/ldb_match.c

index 78e4304f6c6df8fc74eca6ec40d0b50b0e34f742..14031a6dd1a7827e47986e9a1ac19f0b60cf9cdb 100644 (file)
@@ -151,13 +151,8 @@ static int ldb_match_equality(struct ldb_context *ldb,
        struct ldb_dn *valuedn;
        int ret;
 
-       /* catch the old method of dn matching */
-       if (ldb_attr_cmp(tree->u.equality.attr, "dn") == 0) {
-               ldb_debug(ldb, LDB_DEBUG_FATAL, "attempt to match on 'dn' - should use distinguishedName");
-               return 0;
-       }
-
-       if (ldb_attr_cmp(tree->u.equality.attr, "distinguishedName") == 0) {
+       if (ldb_attr_cmp(tree->u.equality.attr, "dn") == 0 ||
+           ldb_attr_cmp(tree->u.equality.attr, "distinguishedName") == 0) {
                valuedn = ldb_dn_explode_casefold(ldb, tree->u.equality.value.data);
                if (valuedn == NULL) {
                        return 0;