r4744: until we decide what to do about attribute aliasing (see my recent
authorAndrew Tridgell <tridge@samba.org>
Sat, 15 Jan 2005 02:54:53 +0000 (02:54 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:08:49 +0000 (13:08 -0500)
samba-technical posting), this is an interim solution that makes us
work pretty much like w2k3 does.
(This used to be commit 789325145651f2f6fc8716aa4bced83a2eb31994)

source4/lib/ldb/ldb_tdb/ldb_search.c

index 536d1ac00528a053482b899dba0c50c03cd06a1f..f813841edb03b4a081f4a17d8fb0bd8c454393bd 100644 (file)
@@ -150,12 +150,13 @@ static struct ldb_message *ltdb_pull_attrs(struct ldb_module *module,
                        continue;
                }
 
-               if (ldb_attr_cmp(attrs[i], "dn") == 0) {
+               if (ldb_attr_cmp(attrs[i], "dn") == 0 ||
+                   ldb_attr_cmp(attrs[i], "distinguishedName") == 0) {
                        struct ldb_message_element el2;
                        struct ldb_val val;
 
                        el2.flags = 0;
-                       el2.name = talloc_strdup(ret, "dn");
+                       el2.name = talloc_strdup(ret, attrs[i]);
                        if (!el2.name) {
                                talloc_free(ret);
                                return NULL;                            
@@ -501,7 +502,8 @@ int ltdb_search(struct ldb_module *module, const char *base,
        }
 
        if (tree->operation == LDB_OP_SIMPLE && 
-           ldb_attr_cmp(tree->u.simple.attr, "dn") == 0 &&
+           (ldb_attr_cmp(tree->u.simple.attr, "dn") == 0 ||
+            ldb_attr_cmp(tree->u.simple.attr, "distinguishedName") == 0) &&
            !ltdb_has_wildcard(module, tree->u.simple.attr, &tree->u.simple.value)) {
                /* yay! its a nice simple one */
                ret = ltdb_search_dn(module, tree->u.simple.value.data, attrs, res);