summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-11-27 04:43:20 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:46:20 +0100
commit470043bf7ae038e590a011e90bbf610c76d53767 (patch)
tree0635a646b4b06024124b52b83cf4ff203bbcad13
parentc4d7646f294df54d6b5e7a3ac236dfa4e861c501 (diff)
downloadsamba-470043bf7ae038e590a011e90bbf610c76d53767.tar.gz
samba-470043bf7ae038e590a011e90bbf610c76d53767.tar.bz2
samba-470043bf7ae038e590a011e90bbf610c76d53767.zip
r26140: Add a new test for searches by distinguieshedName and dn, and
implement these in the simple ldap mapping module. We still don't pass this test, because we must get linked attributes into OpenLDAP. Andrew Bartlett (This used to be commit d41f34e979bb119f71ab3cc2fdb3c08e4b92849c)
-rw-r--r--source4/dsdb/samdb/ldb_modules/simple_ldap_map.c18
-rwxr-xr-xtestprogs/ejs/ldap.js22
2 files changed, 40 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
index 2b8b07f0b4..7efcccc9ff 100644
--- a/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
+++ b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
@@ -376,6 +376,15 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
}
},
{
+ .local_name = "dn",
+ .type = MAP_RENAME,
+ .u = {
+ .rename = {
+ .remote_name = "entryDN"
+ }
+ }
+ },
+ {
.local_name = "groupType",
.type = MAP_CONVERT,
.u = {
@@ -525,6 +534,15 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
}
},
{
+ .local_name = "dn",
+ .type = MAP_RENAME,
+ .u = {
+ .rename = {
+ .remote_name = "entryDN"
+ }
+ }
+ },
+ {
.local_name = "groupType",
.type = MAP_CONVERT,
.u = {
diff --git a/testprogs/ejs/ldap.js b/testprogs/ejs/ldap.js
index ddf5d814f5..40ce404890 100755
--- a/testprogs/ejs/ldap.js
+++ b/testprogs/ejs/ldap.js
@@ -230,6 +230,28 @@ member: cn=ldaptestuser3,cn=users," + base_dn + "
assert(res.msgs[0].cn == "ldaptestUSER3");
assert(res.msgs[0].name == "ldaptestUSER3");
+ println("Testing ldb.search for (dn=CN=ldaptestUSER3,CN=Users," + base_dn + ")");
+ var res = ldb.search("(dn=CN=ldaptestUSER3,CN=Users," + base_dn + ")");
+ if (res.error != 0 || res.msgs.length != 1) {
+ println("Could not find (dn=CN=ldaptestUSER3,CN=Users," + base_dn + ")");
+ assert(res.error == 0);
+ assert(res.msgs.length == 1);
+ }
+ assert(res.msgs[0].dn == ("CN=ldaptestUSER3,CN=Users," + base_dn));
+ assert(res.msgs[0].cn == "ldaptestUSER3");
+ assert(res.msgs[0].name == "ldaptestUSER3");
+
+ println("Testing ldb.search for (distinguishedName=CN=ldaptestUSER3,CN=Users," + base_dn + ")");
+ var res = ldb.search("(distinguishedName=CN=ldaptestUSER3,CN=Users," + base_dn + ")");
+ if (res.error != 0 || res.msgs.length != 1) {
+ println("Could not find (dn=CN=ldaptestUSER3,CN=Users," + base_dn + ")");
+ assert(res.error == 0);
+ assert(res.msgs.length == 1);
+ }
+ assert(res.msgs[0].dn == ("CN=ldaptestUSER3,CN=Users," + base_dn));
+ assert(res.msgs[0].cn == "ldaptestUSER3");
+ assert(res.msgs[0].name == "ldaptestUSER3");
+
// ensure we cannot add it again
ok = ldb.add("
dn: cn=ldaptestuser3,cn=userS," + base_dn + "