Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow @ symbol in user for ssh connections #129

Merged
merged 2 commits into from
Dec 8, 2023
Merged

Conversation

oneirocosm
Copy link
Member

Issue #127 raised the issue that user in (user@host) was previously not allowed to contain @ symbols. This change modifies the regex to allow it.

Note that this does not interfere with the previous sudo@ prefix since this can still be parsed separately. As host is not allowed to contain an @ symbol, we allow any number of @ symbols as part of the user.

Previously, the @ symbol was only used as a way to either:
- separate the user from the host
- separate "sudo" from the user

This change expands this to allow the username part of
sudo@username@host or username@host to contain any number of @ symbols
in addition to the ones previously allowed. Host is not allowed to
contain an @ symbol as per the usual definition.
Moved the dash in the regex pattern to the end to make it explicitly
clear that it isn't part of a range.

Removed the hostNameRe regex as it is unused.
@sawka sawka merged commit 87bf3f7 into main Dec 8, 2023
1 check passed
@oneirocosm oneirocosm deleted the allow-at-in-username-regex branch February 15, 2024 20:56
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.

None yet

2 participants