Skip to content

Handle locked user type suffix ('u!') and missing id field#10

Merged
cromerc merged 2 commits into
cromerc:masterfrom
andy-bower:locked-user-suffix
May 19, 2026
Merged

Handle locked user type suffix ('u!') and missing id field#10
cromerc merged 2 commits into
cromerc:masterfrom
andy-bower:locked-user-suffix

Conversation

@andy-bower
Copy link
Copy Markdown
Contributor

From the sysusers.d manpage:

Type u may be suffixed with an exclamation mark ("u!") to create a fully locked account.

This patch adds such support to opensysusers.

  1. split suffix from type.
  2. add 'locked' argument to add_user invocation.
  3. call usermod(8) in add_user to set account expiry to imply a locked account.

Note that useradd(8) ignores the -e option if a system account is being created so we need an extra command for this.

@perkelix
Copy link
Copy Markdown

@cromerc Could this be merged ASAP and a new release pushed out? Thanks.

@cromerc
Copy link
Copy Markdown
Owner

cromerc commented Apr 22, 2026

Sure, I will do so on friday.

Reported in Debian as: https://bugs.debian.org/1128803
where a minimal "g _ssh" declaration has been found in the
openssh-client package, breaking installations.

Fixes: cromerc#6
@andy-bower andy-bower changed the title Handle locked user type suffix ('u!') Handle locked user type suffix ('u!') and missing id field May 17, 2026
@andy-bower
Copy link
Copy Markdown
Contributor Author

I hope you don't mind but I also added a commit to fix #6 to this PR because it conflicts but is fairly trivial, so I thought it might be easier to handle together.

@andy-bower
Copy link
Copy Markdown
Contributor Author

A note on testing: the locked user patch has been in the Debian package as a patch for some time now so has been widely used and @sthibaul has tested the missing-id patch.

@cromerc cromerc merged commit 33fe56e into cromerc:master May 19, 2026
@cromerc
Copy link
Copy Markdown
Owner

cromerc commented May 19, 2026

Thanks for opening the PR, I have merged it and released 0.7.5 with your changes included.

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