From 4bfb3f37cb4541f0998041becd99395db6065f9e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 22 Sep 2013 23:40:12 +0200 Subject: [PATCH 1/2] dsdb/tests/ldap: fix test_ldapServiceName against w2k8r2 Bug: https://bugzilla.samba.org/show_bug.cgi?id=10193 Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett (cherry picked from commit ca173923a3937a9ed08f71bfd4ba177a6aeeaeba) --- source4/dsdb/tests/python/ldap.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py index 5ca4c26..d1dd065 100755 --- a/source4/dsdb/tests/python/ldap.py +++ b/source4/dsdb/tests/python/ldap.py @@ -2879,12 +2879,16 @@ class BaseDnTests(samba.tests.TestCase): def test_ldapServiceName(self): """Testing the ldap service name in rootDSE""" res = self.ldb.search("", scope=SCOPE_BASE, - attrs=["ldapServiceName", "dNSHostName"]) + attrs=["ldapServiceName", "dnsHostName"]) self.assertEquals(len(res), 1) + self.assertTrue("ldapServiceName" in res[0]) + self.assertTrue("dnsHostName" in res[0]) - (hostname, _, dns_domainname) = res[0]["dNSHostName"][0].partition(".") - self.assertTrue(":%s$@%s" % (hostname, dns_domainname.upper()) - in res[0]["ldapServiceName"][0]) + (hostname, _, dns_domainname) = res[0]["dnsHostName"][0].partition(".") + + given = res[0]["ldapServiceName"][0] + expected = "%s:%s$@%s" % (dns_domainname.lower(), hostname.lower(), dns_domainname.upper()) + self.assertEquals(given, expected) if not "://" in host: if os.path.isfile(host): -- 1.7.9.5 From 2aeac42995f9e1163688b45573a4ea757578e225 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 25 Sep 2013 00:49:19 +0200 Subject: [PATCH 2/2] s4:dsdb/rootdse: report 'dnsHostName' instead of 'dNSHostName' The attribute on the RootDSE object is called 'dnsHostName' instead of 'dNSHostName' (which is used in the schema and on all other directory objects). Bug: https://bugzilla.samba.org/show_bug.cgi?id=10193 Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett (cherry picked from commit 295b4de7215f3326f9a403973547eb6ed4339f9b) --- source4/dsdb/samdb/ldb_modules/rootdse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source4/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c index eaf6451..167201e 100644 --- a/source4/dsdb/samdb/ldb_modules/rootdse.c +++ b/source4/dsdb/samdb/ldb_modules/rootdse.c @@ -270,7 +270,7 @@ static int rootdse_add_dynamic(struct ldb_module *module, struct ldb_message *ms if (ret == LDB_SUCCESS) { const char *hostname = ldb_msg_find_attr_as_string(res->msgs[0], "dNSHostName", NULL); if (hostname != NULL) { - if (ldb_msg_add_string(msg, "dNSHostName", hostname)) { + if (ldb_msg_add_string(msg, "dnsHostName", hostname)) { goto failed; } } -- 1.7.9.5