Revert "strchriscntrl: reject C1 control bytes (0x80-0x9F)"#1602
Open
alejandro-colomar wants to merge 1 commit intoshadow-maint:masterfrom
Open
Revert "strchriscntrl: reject C1 control bytes (0x80-0x9F)"#1602alejandro-colomar wants to merge 1 commit intoshadow-maint:masterfrom
alejandro-colomar wants to merge 1 commit intoshadow-maint:masterfrom
Conversation
C1 control bytes are more complicated than that. They're represented as two bytes in UTF-8. Commit 19d725d, has issues, rejecting otherwise valid UTF-8 multi-byte characters. We could in theory do correct parsing of UTF, possibly parsing the multi-byte sequences, or translating to wchar_t. However, that would complicate the source code well beyond what I'd be comfortable with. Instead, let's revert this, and claim no intention to support UTF-8. If an admin uses a UTF-8 locale while reading /etc/passwd, that's their own fault. Reverts: 19d725d (2026-03-13; "strchriscntrl: reject C1 control bytes (0x80-0x9F)") Fixes: 19d725d (2026-03-13; "strchriscntrl: reject C1 control bytes (0x80-0x9F)") Closes: <shadow-maint#1598> Reported-by: Mantas Mikulėnas <grawity@gmail.com> Cc: KhaelK-Praetorian <khael.kugler@praetorian.com> Cc: Tobias Stoeckmann <tobias@stoeckmann.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
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.
C1 control bytes are more complicated than that. They're represented as two bytes in UTF-8.
Commit 19d725d, has issues, rejecting otherwise valid UTF-8 multi-byte characters.
We could in theory do correct parsing of UTF, possibly parsing the multi-byte sequences, or translating to wchar_t. However, that would complicate the source code well beyond what I'd be comfortable with.
Instead, let's revert this, and claim no intention to support UTF-8. If an admin uses a UTF-8 locale while reading /etc/passwd, that's their own fault.
Reverts: 19d725d (2026-03-13; "strchriscntrl: reject C1 control bytes (0x80-0x9F)")
Fixes: 19d725d (2026-03-13; "strchriscntrl: reject C1 control bytes (0x80-0x9F)")
Closes: #1598
Reported-by: @grawity
Cc: @KhaelK138
Cc: @stoeckmann