forked from ubuntu/authd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pam/model: Initialize user only after we've got the brokers list
One of the races we were facing (mostly in native model) is that we could end up in a situation in which we receive an authd error on getting the brokers list *after* that the user selection view is already shown, leading to racy golden files ordering. This is because what it could happen is: - We start in parallel: -> User selection -> UI Layouts -> Available brokers fetching Now let's "imagine" that the brokers fetching fails (as when we've not the permissions to read it, as for being not root). If the user selection result arrives first, then we end up showing the user selection UI (that is blocking in the native model) and only then we handle the AvailableBrokers result (the error). If the broker selection arrives first, we show first the error instead. Now, this kind of approach made sense when we had no errors during this phases, to get the user name as early as possible, but since we're now doing various permissions checks in the broker, it's better to always go in order instead of performing such operations in parallel, so now: - UI Layouts -> Available brokers fetching - User selection starts Blocking as soon as we've a failure, as highlighted by the new golden files.
- Loading branch information
Showing
5 changed files
with
39 additions
and
12 deletions.
There are no files selected for viewing
12 changes: 9 additions & 3 deletions
12
...stNativeAuthenticate/golden/deny_authentication_if_current_user_is_not_considered_as_root
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK} force_native_client=true | ||
Username: | ||
PAM Error Message: could not get current available brokers: permission denied: this action is on | ||
ly allowed for root users. Current user is XXXX | ||
PAM Authenticate() for user "" exited with error (PAM exit code: 4): System error | ||
acct=incomplete | ||
PAM AcctMgmt() exited with error (PAM exit code: 25): The return value should be ignored by PAM | ||
dispatch | ||
> | ||
──────────────────────────────────────────────────────────────────────────────── | ||
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK} force_native_client=true | ||
Username: | ||
PAM Error Message: could not get current available brokers: permission denied: this action is on | ||
ly allowed for root users. Current user is XXXX | ||
PAM Authenticate() for user "" exited with error (PAM exit code: 4): System error | ||
acct=incomplete | ||
PAM AcctMgmt() exited with error (PAM exit code: 25): The return value should be ignored by PAM | ||
dispatch | ||
> | ||
> | ||
──────────────────────────────────────────────────────────────────────────────── | ||
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK} force_native_client=true | ||
Username: | ||
PAM Error Message: could not get current available brokers: permission denied: this action is on | ||
ly allowed for root users. Current user is XXXX | ||
PAM Authenticate() for user "" exited with error (PAM exit code: 4): System error | ||
acct=incomplete | ||
PAM AcctMgmt() exited with error (PAM exit code: 25): The return value should be ignored by PAM | ||
dispatch | ||
> | ||
> | ||
──────────────────────────────────────────────────────────────────────────────── |
12 changes: 9 additions & 3 deletions
12
...eAuthTok/golden/prevent_change_password_if_current_user_is_not_root_as_can't_authenticate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
> ./pam_authd passwd socket=${AUTHD_TESTS_CLI_AUTHTOK_TESTS_SOCK} force_native_client=true | ||
Username: | ||
PAM Error Message: could not get current available brokers: permission denied: this action is on | ||
ly allowed for root users. Current user is XXXX | ||
PAM ChangeAuthTok() for user "" exited with error (PAM exit code: 4): System error | ||
acct=incomplete | ||
PAM AcctMgmt() exited with error (PAM exit code: 25): The return value should be ignored by PAM | ||
dispatch | ||
> | ||
──────────────────────────────────────────────────────────────────────────────── | ||
> ./pam_authd passwd socket=${AUTHD_TESTS_CLI_AUTHTOK_TESTS_SOCK} force_native_client=true | ||
Username: | ||
PAM Error Message: could not get current available brokers: permission denied: this action is on | ||
ly allowed for root users. Current user is XXXX | ||
PAM ChangeAuthTok() for user "" exited with error (PAM exit code: 4): System error | ||
acct=incomplete | ||
PAM AcctMgmt() exited with error (PAM exit code: 25): The return value should be ignored by PAM | ||
dispatch | ||
> | ||
> | ||
──────────────────────────────────────────────────────────────────────────────── | ||
> ./pam_authd passwd socket=${AUTHD_TESTS_CLI_AUTHTOK_TESTS_SOCK} force_native_client=true | ||
Username: | ||
PAM Error Message: could not get current available brokers: permission denied: this action is on | ||
ly allowed for root users. Current user is XXXX | ||
PAM ChangeAuthTok() for user "" exited with error (PAM exit code: 4): System error | ||
acct=incomplete | ||
PAM AcctMgmt() exited with error (PAM exit code: 25): The return value should be ignored by PAM | ||
dispatch | ||
> | ||
> | ||
──────────────────────────────────────────────────────────────────────────────── |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters