1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

tests/pam_winbind.py: allow upn names to be used in USERNAME with an empty DOMAIN value

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14124

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
Stefan Metzmacher 2019-09-20 08:13:28 +02:00 committed by Günther Deschner
parent cd3ffaabb5
commit 653e904858
3 changed files with 16 additions and 4 deletions

View File

@ -26,7 +26,10 @@ class SimplePamTests(samba.tests.TestCase):
domain = os.environ["DOMAIN"]
username = os.environ["USERNAME"]
password = os.environ["PASSWORD"]
unix_username = "%s/%s" % (domain, username)
if domain != "":
unix_username = "%s/%s" % (domain, username)
else:
unix_username = "%s" % username
expected_rc = 0 # PAM_SUCCESS
tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
@ -41,7 +44,10 @@ class SimplePamTests(samba.tests.TestCase):
domain = os.environ["DOMAIN"]
username = os.environ["USERNAME"]
password = "WrongPassword"
unix_username = "%s/%s" % (domain, username)
if domain != "":
unix_username = "%s/%s" % (domain, username)
else:
unix_username = "%s" % username
expected_rc = 7 # PAM_AUTH_ERR
tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)

View File

@ -27,7 +27,10 @@ class PamChauthtokTests(samba.tests.TestCase):
username = os.environ["USERNAME"]
password = os.environ["PASSWORD"]
newpassword = os.environ["NEWPASSWORD"]
unix_username = "%s/%s" % (domain, username)
if domain != "":
unix_username = "%s/%s" % (domain, username)
else:
unix_username = "%s" % username
expected_rc = 0 # PAM_SUCCESS
tc = pypamtest.TestCase(pypamtest.PAMTEST_CHAUTHTOK, expected_rc)

View File

@ -27,7 +27,10 @@ class PasswordExpirePamTests(samba.tests.TestCase):
username = os.environ["USERNAME"]
password = os.environ["PASSWORD"]
warn_pwd_expire = int(os.environ["WARN_PWD_EXPIRE"])
unix_username = "%s/%s" % (domain, username)
if domain != "":
unix_username = "%s/%s" % (domain, username)
else:
unix_username = "%s" % username
expected_rc = 0 # PAM_SUCCESS
tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)