diff options
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/simple_ldap_map.c | 18 | ||||
-rwxr-xr-x | testprogs/ejs/ldap.js | 22 |
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 + " |