Skip to content

Conversation

@terceiro
Copy link

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.

@alejandro-colomar
Copy link
Collaborator

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)?

@terceiro
Copy link
Author

terceiro commented Aug 25, 2025 via email

@terceiro terceiro force-pushed the newusers-empty-password branch from 2e111f1 to 113a0ec Compare August 25, 2025 16:32
@terceiro
Copy link
Author

I have pushd an updated patch addressing your comments. Thanks for the review!

@alejandro-colomar
Copy link
Collaborator

What I'm wondering is if we might be breaking someone by doing this.

So, could someone be doing this and relying on the fact that the user is unable to login, and maybe later enable the users manually?

As I said, I think it's okay.

Cc: @hallyn, @ikerexxe

Copy link
Member

@hallyn hallyn left a 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?

@terceiro terceiro force-pushed the newusers-empty-password branch from 113a0ec to 118ccd3 Compare August 25, 2025 18:39
@terceiro
Copy link
Author

terceiro commented Aug 25, 2025 via email

@hallyn
Copy link
Member

hallyn commented Aug 25, 2025

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]>
@terceiro terceiro force-pushed the newusers-empty-password branch from 118ccd3 to 3488ce6 Compare August 26, 2025 12:12
Copy link
Collaborator

@alejandro-colomar alejandro-colomar left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants