diff options
author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2021-03-30 16:00:56 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2021-04-07 09:18:30 +0000 |
commit | 7679995b95c9d572a2e94213f5f55e3641844422 (patch) | |
tree | 7f4b21bae5a3a34080464bb2c7b8bbc1e027dd81 /auth | |
parent | 6b57583830007f745360a5dcab9760a66fd3ad0e (diff) | |
download | samba-7679995b95c9d572a2e94213f5f55e3641844422.tar.gz |
auth/credentials: Add test for binding with a 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 | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/auth/credentials/tests/bind.py b/auth/credentials/tests/bind.py index b26be4f0f79..191eb49ca1b 100755 --- a/auth/credentials/tests/bind.py +++ b/auth/credentials/tests/bind.py @@ -54,6 +54,7 @@ creds_user2 = create_credential(lp, creds) creds_user3 = create_credential(lp, creds) creds_user4 = create_credential(lp, creds) creds_user5 = create_credential(lp, creds) +creds_user6 = create_credential(lp, creds) class BindTests(samba.tests.TestCase): @@ -211,6 +212,14 @@ unicodePwd:: """ + base64.b64encode(u"\"P@ssw0rd\"".encode('utf-16-le')).decode( self.fail("Failed to connect with user account SID") res = ldb_user5.search(base="", expression="", scope=SCOPE_BASE, attrs=["*"]) + # do a simple bind and search with the canonical name + creds_user6.set_bind_dn(user_dn.canonical_str()) + creds_user6.set_password(self.password) + print("BindTest with: " + creds_user6.get_bind_dn()) + ldb_user6 = samba.tests.connect_samdb(host, credentials=creds_user6, + lp=lp, ldap_only=True) + res = ldb_user6.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) |