pam_access: fix user_match() for fully qualified domain usernames#980
Open
aks170990 wants to merge 1 commit into
Open
pam_access: fix user_match() for fully qualified domain usernames#980aks170990 wants to merge 1 commit into
aks170990 wants to merge 1 commit into
Conversation
When a username contains '@' (e.g. "administrator@example.com"), the user_match() function incorrectly interprets it as the legacy"user@host" syntax defined in access.conf(5). It splits the token at '@', then tries to match just "administrator" against the full username "administrator@example.com", which fails. This is a problem for systems joined to Active Directory or IPA domains where SSSD is configured with use_fully_qualified_names=True, producing usernames in the "user@domain" format. Fix this by attempting an exact string_match() of the full token (including '@') against the login username BEFORE falling back to the user@host split. If the token matches the username as-is, there is no need to parse it as user@host. The user@host legacy behavior is preserved as a fallback. Resolves: linux-pam#979
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a username contains '@' (e.g. "administrator@example.com"), the user_match() function incorrectly interprets it as the legacy"user@host" syntax defined in access.conf(5). It splits the token at '@', then tries to match just "administrator" against the full username "administrator@example.com", which fails.
This is a problem for systems joined to Active Directory or IPA domains where SSSD is configured with use_fully_qualified_names=True, producing usernames in the "user@domain" format.
Fix this by attempting an exact string_match() of the full token (including '@') against the login username BEFORE falling back to the user@host split. If the token matches the username as-is, there is no need to parse it as user@host.
The user@host legacy behavior is preserved as a fallback.
Resolves: #979