From f4b22a2f215f6f80558d9e4075c9de306c8b9953 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 16:22:53 +0200 Subject: Adding debian version 1.5.2-6+deb12u1. Signed-off-by: Daniel Baumann --- debian/tests/pam-test.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 debian/tests/pam-test.py (limited to 'debian/tests/pam-test.py') diff --git a/debian/tests/pam-test.py b/debian/tests/pam-test.py new file mode 100644 index 0000000..0024ca5 --- /dev/null +++ b/debian/tests/pam-test.py @@ -0,0 +1,33 @@ +#!/usr/bin/python3 +# Copyright 2023, Sam Hartman +# This code may be redistributed under the same terms as Linux Pam +# itself, or at your pution, under the GNU General Public License, +# version 3. + + +import PAM + +def conversation(auth, queries, userdata): + results = [] + for prompt, type in queries: + if type == PAM.PAM_PROMPT_ECHO_OFF: + results.append(('ThisLongPasswordIsHardCoded', 0)) + else: results.append(('',0)) + return results +# set a password + +auth = PAM.pam() +auth.start('passwd') +auth.set_item(PAM.PAM_USER, 'pam_test') +auth.set_item(PAM.PAM_CONV, conversation) +auth.chauthtok() + +# Now authenticate and session +auth = PAM.pam() +auth.start('login') +auth.set_item(PAM.PAM_USER, 'pam_test') +auth.set_item(PAM.PAM_CONV, conversation) +auth.authenticate() +auth.acct_mgmt() +auth.open_session() +auth.close_session() -- cgit v1.2.3