From: Douglas Bagnall Date: Wed, 10 Dec 2025 22:07:33 +0000 (+1300) Subject: pytest:dsdb:passwords: guess ldaps and ldap hosts from each other X-Git-Tag: tdb-1.4.15~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d588c7969ee7586d2f76cb1a66b542c63fe7d154;p=thirdparty%2Fsamba.git pytest:dsdb:passwords: guess ldaps and ldap hosts from each other BUG: https://bugzilla.samba.org/show_bug.cgi?id=12020 Signed-off-by: Douglas Bagnall Reviewed-by: Gary Lockyer --- diff --git a/source4/dsdb/tests/python/passwords.py b/source4/dsdb/tests/python/passwords.py index d431486e069..8f44aa2a081 100755 --- a/source4/dsdb/tests/python/passwords.py +++ b/source4/dsdb/tests/python/passwords.py @@ -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)