Skip to content

pam_access: fix user_match() for fully qualified domain usernames#980

Open
aks170990 wants to merge 1 commit into
linux-pam:masterfrom
aks170990:fqdn-username
Open

pam_access: fix user_match() for fully qualified domain usernames#980
aks170990 wants to merge 1 commit into
linux-pam:masterfrom
aks170990:fqdn-username

Conversation

@aks170990
Copy link
Copy Markdown

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pam_access.so doesn't work with fully_qualified format username@domain in access.conf file & denies access.

1 participant