Skip to content

Commit

Permalink
authentication: detect a password change request
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sumit-bose authored and pbrezina committed Oct 2, 2024
1 parent 3c40cf3 commit 159ca7c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sssd_test_framework/utils/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
}}
Expand Down Expand Up @@ -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}}
}}
Expand Down

0 comments on commit 159ca7c

Please sign in to comment.