-
Notifications
You must be signed in to change notification settings - Fork 252
newusers: allow not passing a password #1341
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
base: master
Are you sure you want to change the base?
Conversation
|
For consistency with the handling of the rest of the fields, it seems appropriate, as we already keep the other fields intact if they're passed empty to newusers(8). What's the current behavior? Is it rejected, or is the password removed (so, passwordless user)? |
|
What's the current behavior? Is it rejected, or is the password
removed (so, passwordless user)?
It fails like this:
```
$ echo foobar:::::/tmp:/bin/bash | sudo newusers
No password has been supplied.
No password has been supplied.
No password has been supplied.
newusers: (user foobar) pam_chauthtok() failed, error:
Authentication token manipulation error
newusers: (line 1, user foobar) password not changed
```
The use entry *is* created in /etc/passwd, but the account cannot be
logged into because there is no password. root can sudo into it.
|
2e111f1 to
113a0ec
Compare
|
I have pushd an updated patch addressing your comments. Thanks for the review! |
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.
Sorry, can you explain exactly how you would use this to add subuids?
113a0ec to
118ccd3
Compare
|
On Mon, Aug 25, 2025 at 11:14:41AM -0700, Serge Hallyn wrote:
@hallyn commented on this pull request.
Sorry, can you explain exactly how you would use this to add subuids?
```
$ echo username:::::: | newusers
```
> @@ -107,8 +107,8 @@
</term>
<listitem>
<para>
- This field will be encrypted and used as the new value of the
- encrypted password.
+ If this field it not empty, it will be encrypted and used as the new
trivial typo: if this field *is* not empty
Thanks, fixed.
|
|
Oh, not a specific range. Got it. |
A possible use case for this is wanting to add subuid/subgid entries for an existing user. This change makes it possible to pass `username::::::` to newusers; the empty password will be ignored an everything else will be done. Currently this fails miserably, as PAM errors out on a empty password. Signed-off-by: Antonio Terceiro <[email protected]>
118ccd3 to
3488ce6
Compare
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. I'll leave it to Serge for the final decision.
A possible use case for this is wanting to add subuid/subgid entries for an existing user. This change makes it possible to pass
username::::::to newusers; the empty password will be ignored an everything else will be done. Currently this fails miserably, as PAM errors out on a empty password.