diff options
author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2021-03-30 16:01:44 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2021-04-07 09:18:30 +0000 |
commit | 7c2b26a431daa29db99344632d0eda21139a558e (patch) | |
tree | 25205a4730a802012ffa1b09b53a184ea86f8186 /auth | |
parent | 7679995b95c9d572a2e94213f5f55e3641844422 (diff) | |
download | samba-7c2b26a431daa29db99344632d0eda21139a558e.tar.gz |
auth/credentials: Add test for binding with an extended canonical name
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'auth')
-rwxr-xr-x | auth/credentials/tests/bind.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/auth/credentials/tests/bind.py b/auth/credentials/tests/bind.py index 191eb49ca1b..0c79df4d187 100755 --- a/auth/credentials/tests/bind.py +++ b/auth/credentials/tests/bind.py @@ -55,6 +55,7 @@ creds_user3 = create_credential(lp, creds) creds_user4 = create_credential(lp, creds) creds_user5 = create_credential(lp, creds) creds_user6 = create_credential(lp, creds) +creds_user7 = create_credential(lp, creds) class BindTests(samba.tests.TestCase): @@ -220,6 +221,17 @@ unicodePwd:: """ + base64.b64encode(u"\"P@ssw0rd\"".encode('utf-16-le')).decode( lp=lp, ldap_only=True) res = ldb_user6.search(base="", expression="", scope=SCOPE_BASE, attrs=["*"]) + # do a simple bind and search with the extended canonical name + creds_user7.set_bind_dn(user_dn.canonical_ex_str()) + creds_user7.set_password(self.password) + print("BindTest with: " + creds_user7.get_bind_dn()) + try: + ldb_user7 = samba.tests.connect_samdb(host, credentials=creds_user7, + lp=lp, ldap_only=True) + except: + self.fail("Failed to connect with extended canonical name") + res = ldb_user7.search(base="", expression="", scope=SCOPE_BASE, attrs=["*"]) + def test_user_account_bind_no_domain(self): # create user self.ldb.newuser(username=self.username, password=self.password) |