-
Notifications
You must be signed in to change notification settings - Fork 239
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
please consider giving a dedicated exit value for "invalid user name" #1103
Comments
I think adduser(8) should not attempt to check the validity of names. Why not patch useradd(8) to do the checks you want? |
|
Could you clarify why adduser(8) needs to be able to tell that useradd(8) deemed the name too bad? Why is it not enough to let useradd(8) fail and print to stderr, and then just fail from adduser(8) too? What does adduser(8) do different when useradd(8) fails due to ENOMEM, from when it fails due to badname?
|
adduser might want to be friendly and give a friendly error message. "use --badname" is misleading since adduser's options are named differently. |
How about adding a --badname option for compatibility, as an alias to whatever option you have? |
…ames Wrappers like adduser(8) want to do their own stuff if the login name is bad. For that, they need to be able to differentiate such an error. Closes: <shadow-maint#1103> Suggested-by: Chris Hofstaedtler <zeha@debian.org> Cc: Marc 'Zugschlus' Haber <mh+githubvisible@zugschlus.de> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Thank you very much for considering this on your side. Do you want me to contribute docs? At least the man page needs adaption. |
You're welcome. :-)
Sure, feel free to send a patch/PR to my branch here: https://github.com/alejandro-colomar/shadow/tree/badname. I can then squash it in the PR (crediting you, of course). |
@Zugschlus I assume you'll take it from here, ok? |
Depends on what else there is to do. |
You said something about contributing docs. I guess you'll check if the implementation does what you wanted, incl. for groupadd. I'll deal with the Debian side once it's in master, or when we want to run with a draft patch. Feel free to ping me tho! |
…ames Wrappers like adduser(8) want to do their own stuff if the login name is bad. For that, they need to be able to differentiate such an error. Closes: <shadow-maint#1103> Suggested-by: Chris Hofstaedtler <zeha@debian.org> Cc: Marc 'Zugschlus' Haber <mh+githubvisible@zugschlus.de> Signed-off-by: Alejandro Colomar <alx@kernel.org>
…ames Wrappers like adduser(8) want to do their own stuff if the login name is bad. For that, they need to be able to differentiate such an error. Closes: <shadow-maint#1103> Suggested-by: Chris Hofstaedtler <zeha@debian.org> Cc: Marc 'Zugschlus' Haber <mh+githubvisible@zugschlus.de> Signed-off-by: Alejandro Colomar <alx@kernel.org>
…ames Wrappers like adduser(8) want to do their own stuff if the login name is bad. For that, they need to be able to differentiate such an error. Closes: <shadow-maint#1103> Suggested-by: Chris Hofstaedtler <zeha@debian.org> Cc: Marc 'Zugschlus' Haber <mh+githubvisible@zugschlus.de> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Debian has a wrapper around
useradd
calledadduser
, which controls a lot of the default policy on Debian etc. It also has its own idea on which usernames are allowable. Theadduser
maintainer requested the following feature, IMO a sensible request.I hope upstream is open for this feature.
Quoting the feature request in full:
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1074306
The text was updated successfully, but these errors were encountered: