From 159ca7ca1c1911f85cd2c3ed8c423e96e679dc29 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Tue, 1 Oct 2024 18:22:07 +0200 Subject: [PATCH] authentication: detect a password change request If a password is expired the user might be prompted to renew the password immediately. This patch adds a detection for this case and returns a dedicated error code. --- sssd_test_framework/utils/authentication.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sssd_test_framework/utils/authentication.py b/sssd_test_framework/utils/authentication.py index c7f1ac0..00c669b 100644 --- a/sssd_test_framework/utils/authentication.py +++ b/sssd_test_framework/utils/authentication.py @@ -247,6 +247,7 @@ def password_with_output(self, username: str, password: str) -> tuple[int, int, -re $prompt {{exitmsg "Password authentication successful" 0}} "Authentication failure" {{exitmsg "Authentication failure" 1}} "su: Permission denied" {{exitmsg "Permission denied" 2}} + "Current Password:" {{exitmsg "Password change requested" 3 }} timeout {{exitmsg "Unexpected output" 201}} eof {{exitmsg "Unexpected end of file" 202}} }} @@ -650,6 +651,7 @@ def password_with_output(self, username: str, password: str) -> tuple[int, int, -re $prompt {{exitmsg "Password authentication successful" 0}} "{username}@localhost: Permission denied" {{exitmsg "Authentication failure" 1}} "Connection closed by * port *" {{exitmsg "Connection closed" 2}} + "Current Password:" {{exitmsg "Password change requested" 3 }} timeout {{exitmsg "Unexpected output" 201}} eof {{exitmsg "Unexpected end of file" 202}} }}