-
Notifications
You must be signed in to change notification settings - Fork 556
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
modif: Forbid control chars in names and restrict hostname #5708
Merged
Conversation
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
glitsj16
approved these changes
Mar 4, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
merged, thanks! |
kmk3
added a commit
to kmk3/firejail
that referenced
this pull request
Mar 21, 2023
The "invalid_name" function claims to "allow strict ASCII letters and numbers". However, it uses isalnum(3) and isdigit(3), which may take the current locale into account and thus return 1 for non-ASCII characters. So add the following functions: * ascii_isalnum * ascii_isalpha * ascii_isdigit * ascii_isxdigit And use them in "invalid_name" so that it actually uses strictly ASCII in its comparisons. Added on commit b4ffaa2 ("merges; more on cleaning up esc chars", 2023-02-14). Relates to netblue30#5578. Kind of relates to netblue30#5708.
kmk3
added a commit
to kmk3/firejail
that referenced
this pull request
Mar 21, 2023
The "invalid_name" function claims to "allow strict ASCII letters and numbers". However, it uses isalnum(3) and isdigit(3), which may take the current locale into account and thus return 1 for non-ASCII characters. So add the following functions: * ascii_isalnum * ascii_isalpha * ascii_isdigit * ascii_isxdigit And use them in "invalid_name" so that it actually uses strictly ASCII in its comparisons. Added on commit b4ffaa2 ("merges; more on cleaning up esc chars", 2023-02-14). Relates to netblue30#5578. Kind of relates to netblue30#5708.
kmk3
added a commit
to kmk3/firejail
that referenced
this pull request
Mar 21, 2023
The "invalid_name" function claims to "allow strict ASCII letters and numbers". However, it uses isalnum(3) and isdigit(3), which may take the current locale into account and thus return 1 for non-ASCII characters. So add the following functions: * ascii_isalnum * ascii_isalpha * ascii_isdigit * ascii_isxdigit And use them in "invalid_name" so that it actually uses strictly ASCII in its comparisons. Added on commit b4ffaa2 ("merges; more on cleaning up esc chars", 2023-02-14). Relates to netblue30#5578. Kind of relates to netblue30#5708.
kmk3
added a commit
to kmk3/firejail
that referenced
this pull request
Mar 21, 2023
The "invalid_name" function claims to "allow strict ASCII letters and numbers". However, it uses isalnum(3) and isdigit(3), which may take the current locale into account and thus return 1 for non-ASCII characters. So add the following functions: * ascii_isalnum * ascii_isalpha * ascii_isdigit * ascii_islower * ascii_isupper * ascii_isxdigit And use the applicable ones in "invalid_name" so that it actually uses strictly ASCII in its comparisons. Added on commit b4ffaa2 ("merges; more on cleaning up esc chars", 2023-02-14). Relates to netblue30#5578. Kind of relates to netblue30#5708.
kmk3
added a commit
to kmk3/firejail
that referenced
this pull request
Jun 14, 2023
The `invalid_name` function does not allow control characters. Added on commit d349a2f ("Forbid control chars in names", 2023-03-03) / PR netblue30#5708.
kmk3
added a commit
to kmk3/firejail
that referenced
this pull request
Jun 14, 2023
Changes: * Use only `invalid_name` to check the name and hostname instead of ad-hoc checks * Standardize empty/invalid error messages for name/hostname Note: This makes the hostname validation less strict, though it still forbids control characters and only numbers. Relates to netblue30#5578 netblue30#5708. See also commit b4ffaa2 ("merges; more on cleaning up esc chars", 2023-02-14).
kmk3
added a commit
to kmk3/firejail
that referenced
this pull request
Jun 14, 2023
Note that the sandbox name may also be set through the "join-or-start" option. Relates to netblue30#5578 netblue30#5708.
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.
Forbid control characters in names and filenames. #5613.
Syntax for hostnames from https://en.wikipedia.org/wiki/Hostname#Syntax