src/{chfn,chsh,passwd}.c: Allow bad names (regression fix)#1671
Open
alejandro-colomar wants to merge 4 commits into
Open
src/{chfn,chsh,passwd}.c: Allow bad names (regression fix)#1671alejandro-colomar wants to merge 4 commits into
alejandro-colomar wants to merge 4 commits into
Conversation
... instead of an extern variable. This makes it easier to analyze which programs allow badnames and which don't. Signed-off-by: Alejandro Colomar <alx@kernel.org>
These programs don't add new users. Because they handle existing users, they should handle them with whatever names they already have, including bad names. A recent commit that added some username syntax validation blindly removed support for bad names in these programs. Fix that regression. Fixes: 326889c (2024-10-22; "Fix coverity unbound buffer issues") Signed-off-by: Alejandro Colomar <alx@kernel.org>
Other programs handling groups don't allow this. I believe this was only accidentally allowed. Fixes: a2cd3e9 (2019-10-04; "chkname.c, pwck.c, useradd.c, usermod.c, newusers.c: Allow names that do not conform to standards") Cc: ed <ed@s5h.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
We don't allow badnames in group names. Signed-off-by: Alejandro Colomar <alx@kernel.org>
7e3d8d7 to
aafefa1
Compare
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.
Also, pass the badname flag as a function parameter instead of an extern variable. This makes it easier to analyze which programs allow badnames and which don't.
Also, remove an inconsistent (and seemingly accidental) allowance of badnames in group names in newusers(8).
Fixes: 326889c (2024-10-22; "Fix coverity unbound buffer issues")
Fixes: a2cd3e9 (2019-10-04; "chkname.c, pwck.c, useradd.c, usermod.c, newusers.c: Allow names that do not conform to standards")
Cc: @MarcinDigitic , @edneville