]> git.ipfire.org Git - thirdparty/shadow.git/commit
Revert "strchriscntrl: reject C1 control bytes (0x80-0x9F)"
authorAlejandro Colomar <alx@kernel.org>
Wed, 25 Mar 2026 21:00:40 +0000 (22:00 +0100)
committerSerge Hallyn <serge@hallyn.com>
Wed, 1 Apr 2026 14:27:30 +0000 (09:27 -0500)
commitd71f3c33129f329aa3e9e7327edd084118cbc830
tree7caa6607c2a4b98237950deff0f3d54743c87243
parent6af798f7b704be7b850a2e2f4a01f245e21e1af0
Revert "strchriscntrl: reject C1 control bytes (0x80-0x9F)"

C1 control bytes are more complicated than that.  They're represented as
two bytes in UTF-8.

Commit 19d725da, 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: 19d725da (2026-03-13; "strchriscntrl: reject C1 control bytes (0x80-0x9F)")
Fixes: 19d725da (2026-03-13; "strchriscntrl: reject C1 control bytes (0x80-0x9F)")
Closes: <https://github.com/shadow-maint/shadow/issues/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>
lib/string/ctype/strchrisascii/strchriscntrl.h