[PATCH] Add second authentication to make sure we're not locked out
Andreas Schneider
asn at samba.org
Thu Feb 22 16:33:39 UTC 2018
Hi,
attached is a patch for the pam_winbind test to make sure we're not locked out
after trying to authenticate with an invalid password.
Please review and if OK push if possible.
Thanks,
Andreas
--
Andreas Schneider GPG-ID: CC014E3D
Samba Team asn at samba.org
www.samba.org
-------------- next part --------------
>From ce966759f164ed4ab0aaa7f4429d2bd0eee8f21a Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Thu, 22 Feb 2018 17:30:36 +0100
Subject: [PATCH] tests: Authenticate again so make sure we are not locked out
Signed-off-by: Andreas Schneider <asn at samba.org>
---
python/samba/tests/pam_winbind.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/python/samba/tests/pam_winbind.py b/python/samba/tests/pam_winbind.py
index 1054e86dc9d..30fa375d054 100644
--- a/python/samba/tests/pam_winbind.py
+++ b/python/samba/tests/pam_winbind.py
@@ -44,3 +44,16 @@ class SimplePamTests(samba.tests.TestCase):
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
self.assertTrue(res != None)
+
+ # check that we are not locked out with just one failed login
+ def test_authenticate_two(self):
+ domain = os.environ["DOMAIN"]
+ username = os.environ["USERNAME"]
+ password = os.environ["PASSWORD"]
+ unix_username = "%s/%s" % (domain, username)
+ expected_rc = 0 # PAM_SUCCESS
+
+ tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
+ res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
+
+ self.assertTrue(res != None)
--
2.16.1
More information about the samba-technical
mailing list