Skip to content

Commit

Permalink
pam/main-cli: Include pam error codes in error messages
Browse files Browse the repository at this point in the history
This makes the output of the golden files clearer and it makes explicit
the Pam status code that is returned.
  • Loading branch information
3v1n0 committed Jan 11, 2024
1 parent f1d7da3 commit f02106f
Show file tree
Hide file tree
Showing 16 changed files with 92 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ Gimme your password
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Gimme your password
Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down Expand Up @@ -165,8 +165,8 @@ Acct mgmt return: <nil>
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Gimme your password
Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ Enter your new password (3 days until mandatory)
>
>

Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down Expand Up @@ -234,8 +234,8 @@ Enter your new password (3 days until mandatory)
>
>

Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ Enter your new password
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Enter your new password
> *******
Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down Expand Up @@ -265,8 +265,8 @@ Acct mgmt return: <nil>
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Enter your new password
> *******
Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ Gimme your password
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Gimme your password
Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down Expand Up @@ -165,8 +165,8 @@ Acct mgmt return: <nil>
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Gimme your password
Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ Gimme your password
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Gimme your password
Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down Expand Up @@ -363,8 +363,8 @@ Acct mgmt return: <nil>
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Gimme your password
Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ Gimme your password



Auth return: The return value should be ignored by PAM dispatch:
Acct mgmt return: The return value should be ignored by PAM dispatch
Auth error (25): The return value should be ignored by PAM dispatch:
AcctMgmt error (25): The return value should be ignored by PAM dispatch
>
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Expand Down Expand Up @@ -258,7 +258,7 @@ Acct mgmt return: The return value should be ignored by PAM dispatch



Auth return: The return value should be ignored by PAM dispatch:
Acct mgmt return: The return value should be ignored by PAM dispatch
Auth error (25): The return value should be ignored by PAM dispatch:
AcctMgmt error (25): The return value should be ignored by PAM dispatch
>
────────────────────────────────────────────────────────────────────────────────
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ Gimme your password
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Gimme your password
Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down Expand Up @@ -231,8 +231,8 @@ Acct mgmt return: <nil>
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Gimme your password
Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ Enter your one time credential
Enter your one time credential
> temporary pass00

Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down Expand Up @@ -299,8 +299,8 @@ Acct mgmt return: <nil>
Enter your one time credential
> temporary pass00

Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ Unlock your phone +33… or accept request on web interface:

────────────────────────────────────────────────────────────────────────────────
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down Expand Up @@ -329,8 +329,8 @@ Acct mgmt return: <nil>

────────────────────────────────────────────────────────────────────────────────
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down Expand Up @@ -362,8 +362,8 @@ Acct mgmt return: <nil>

────────────────────────────────────────────────────────────────────────────────
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down Expand Up @@ -395,8 +395,8 @@ Acct mgmt return: <nil>

────────────────────────────────────────────────────────────────────────────────
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down Expand Up @@ -428,8 +428,8 @@ Acct mgmt return: <nil>

────────────────────────────────────────────────────────────────────────────────
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ Enter the following code after flashing the address: 1337
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀


Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down Expand Up @@ -317,8 +317,8 @@ Enter the following code after flashing the address: 1337
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀


Auth return: <nil>
Acct mgmt return: <nil>
Auth success
AcctMgmt success
>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ invalid password, should be goodpass
Gimme your password
>
PAM ERROR: invalid password, should be goodpass
Auth return: Authentication failure: invalid password, should be goodpass
Acct mgmt return: The return value should be ignored by PAM dispatch
Auth error (7): Authentication failure: invalid password, should be goodpass
AcctMgmt error (25): The return value should be ignored by PAM dispatch
>


Expand Down Expand Up @@ -299,8 +299,8 @@ Acct mgmt return: The return value should be ignored by PAM dispatch
Gimme your password
>
PAM ERROR: invalid password, should be goodpass
Auth return: Authentication failure: invalid password, should be goodpass
Acct mgmt return: The return value should be ignored by PAM dispatch
Auth error (7): Authentication failure: invalid password, should be goodpass
AcctMgmt error (25): The return value should be ignored by PAM dispatch
>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Username: user-unexistent

PAM ERROR: can't select broker: rpc error: code = Unknown desc = can't start authentication tran
saction: user "user-unexistent" does not exist
Auth return: System error: can't select broker: rpc error: code = Unknown desc = can't start aut
Auth error (4): System error: can't select broker: rpc error: code = Unknown desc = can't start
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Select your provider
Expand Down Expand Up @@ -161,5 +161,5 @@ Auth return: System error: can't select broker: rpc error: code = Unknown desc =

PAM ERROR: can't select broker: rpc error: code = Unknown desc = can't start authentication tran
saction: user "user-unexistent" does not exist
Auth return: System error: can't select broker: rpc error: code = Unknown desc = can't start aut
Auth error (4): System error: can't select broker: rpc error: code = Unknown desc = can't start
────────────────────────────────────────────────────────────────────────────────
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ Username: user-local-broker



Auth return: The return value should be ignored by PAM dispatch:
Acct mgmt return: The return value should be ignored by PAM dispatch
Auth error (25): The return value should be ignored by PAM dispatch:
AcctMgmt error (25): The return value should be ignored by PAM dispatch
>
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Expand Down Expand Up @@ -159,7 +159,7 @@ Acct mgmt return: The return value should be ignored by PAM dispatch



Auth return: The return value should be ignored by PAM dispatch:
Acct mgmt return: The return value should be ignored by PAM dispatch
Auth error (25): The return value should be ignored by PAM dispatch:
AcctMgmt error (25): The return value should be ignored by PAM dispatch
>
────────────────────────────────────────────────────────────────────────────────
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ Gimme your password
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Gimme your password
PAM ERROR: cancel requested
Auth return: Critical error - immediate abort: cancel requested
Acct mgmt return: The return value should be ignored by PAM dispatch
Auth error (26): Critical error - immediate abort: cancel requested
AcctMgmt error (25): The return value should be ignored by PAM dispatch
>


Expand Down Expand Up @@ -166,8 +166,8 @@ Acct mgmt return: The return value should be ignored by PAM dispatch
> ./pam_authd socket=/tmp/pam-cli-tests.sock
Gimme your password
PAM ERROR: cancel requested
Auth return: Critical error - immediate abort: cancel requested
Acct mgmt return: The return value should be ignored by PAM dispatch
Auth error (26): Critical error - immediate abort: cancel requested
AcctMgmt error (25): The return value should be ignored by PAM dispatch
>


Expand Down
Loading

0 comments on commit f02106f

Please sign in to comment.