]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pytest:dsdb:passwords: guess ldaps and ldap hosts from each other
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 10 Dec 2025 22:07:33 +0000 (11:07 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Thu, 15 Jan 2026 01:48:37 +0000 (01:48 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12020

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source4/dsdb/tests/python/passwords.py

index d431486e06957f5ac4a1beb62f8e94174b9166ce..8f44aa2a081316dfb15cb338cd24f47d35ae34c6 100755 (executable)
@@ -1447,5 +1447,13 @@ if "://" not in host:
     else:
         host_ldaps = "ldaps://%s" % host
         host = "ldap://%s" % host
+elif host.startswith('ldap://'):
+    host_ldaps = f"ldaps://{host[7:]}"
+elif host.startswith('ldaps://'):
+    host_ldaps = host
+    host = f"ldap://{host[8:]}"
+else:
+    host_ldaps = None
+
 
 TestProgram(module=__name__, opts=subunitopts)