Skip to content

shadow: support account expiration date - #72

Open
Mic92 wants to merge 1 commit into
nikstur:mainfrom
Mic92:shadow-expire
Open

Mic92 wants to merge 1 commit into
nikstur:mainfrom
Mic92:shadow-expire

Conversation

@Mic92

@Mic92 Mic92 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

NixOS exposes users.users..expires, which the legacy perl activation script writes into the 8th shadow field so that pam_unix refuses logins after that date. Userborn silently ignored it, so expired accounts kept working. This was a bit surprising because we were using this mechanism to log out students after some deadline.

Accept expires (YYYY-MM-DD) in the config and write it as days since epoch. Omitting it clears the field, keeping the config the single source of truth for managed users.

NixOS exposes users.users.<name>.expires, which the legacy perl
activation script writes into the 8th shadow field so that pam_unix
refuses logins after that date. Userborn silently ignored it, so
expired accounts kept working.

Accept `expires` (YYYY-MM-DD) in the config and write it as days since
epoch. Omitting it clears the field, keeping the config the single
source of truth for managed users.
Mic92 added a commit to TUM-DSE/nixpkgs that referenced this pull request Sep 13, 2026
…nges

Userborn ignored `expires`, so accounts past their expiration date could
still log in, unlike with the perl activation script. It also hardcoded
the dynamic allocation range instead of following
security.loginDefs.settings.{UID,GID}_{MIN,MAX}.

Bump to a fork carrying both upstream PRs until they are released:
- nikstur/userborn#72 (expires)
- nikstur/userborn#61 (normalUidRange/normalGidRange)
Mic92 added a commit to TUM-DSE/nixpkgs that referenced this pull request Sep 17, 2026
…nges

Userborn ignored `expires`, so accounts past their expiration date could
still log in, unlike with the perl activation script. It also hardcoded
the dynamic allocation range instead of following
security.loginDefs.settings.{UID,GID}_{MIN,MAX}.

Bump to a fork carrying both upstream PRs until they are released:
- nikstur/userborn#72 (expires)
- nikstur/userborn#61 (normalUidRange/normalGidRange)
Mic92 added a commit to TUM-DSE/nixpkgs that referenced this pull request Sep 22, 2026
…nges

Userborn ignored `expires`, so accounts past their expiration date could
still log in, unlike with the perl activation script. It also hardcoded
the dynamic allocation range instead of following
security.loginDefs.settings.{UID,GID}_{MIN,MAX}.

Bump to a fork carrying both upstream PRs until they are released:
- nikstur/userborn#72 (expires)
- nikstur/userborn#61 (normalUidRange/normalGidRange)
@r-vdp

r-vdp commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

@nikstur this looks good to me and addresses one of the main remaining blockers to make userborn the default in nixos.
You think we could merge this so that we can wire it up in nixos once we have a userborn release with this change included?

Mic92 added a commit to TUM-DSE/nixpkgs that referenced this pull request Oct 15, 2026
…nges

Userborn ignored `expires`, so accounts past their expiration date could
still log in, unlike with the perl activation script. It also hardcoded
the dynamic allocation range instead of following
security.loginDefs.settings.{UID,GID}_{MIN,MAX}.

Bump to a fork carrying both upstream PRs until they are released:
- nikstur/userborn#72 (expires)
- nikstur/userborn#61 (normalUidRange/normalGidRange)
Mic92 added a commit to TUM-DSE/nixpkgs that referenced this pull request Oct 21, 2026
…nges

Userborn ignored `expires`, so accounts past their expiration date could
still log in, unlike with the perl activation script. It also hardcoded
the dynamic allocation range instead of following
security.loginDefs.settings.{UID,GID}_{MIN,MAX}.

Bump to a fork carrying both upstream PRs until they are released:
- nikstur/userborn#72 (expires)
- nikstur/userborn#61 (normalUidRange/normalGidRange)
Mic92 added a commit to TUM-DSE/nixpkgs that referenced this pull request Oct 24, 2026
…nges

Userborn ignored `expires`, so accounts past their expiration date could
still log in, unlike with the perl activation script. It also hardcoded
the dynamic allocation range instead of following
security.loginDefs.settings.{UID,GID}_{MIN,MAX}.

Bump to a fork carrying both upstream PRs until they are released:
- nikstur/userborn#72 (expires)
- nikstur/userborn#61 (normalUidRange/normalGidRange)
Mic92 added a commit to TUM-DSE/nixpkgs that referenced this pull request Nov 7, 2026
…nges

Userborn ignored `expires`, so accounts past their expiration date could
still log in, unlike with the perl activation script. It also hardcoded
the dynamic allocation range instead of following
security.loginDefs.settings.{UID,GID}_{MIN,MAX}.

Bump to a fork carrying both upstream PRs until they are released:
- nikstur/userborn#72 (expires)
- nikstur/userborn#61 (normalUidRange/normalGidRange)
Mic92 added a commit to TUM-DSE/nixpkgs that referenced this pull request Nov 11, 2026
…nges

Userborn ignored `expires`, so accounts past their expiration date could
still log in, unlike with the perl activation script. It also hardcoded
the dynamic allocation range instead of following
security.loginDefs.settings.{UID,GID}_{MIN,MAX}.

Bump to a fork carrying both upstream PRs until they are released:
- nikstur/userborn#72 (expires)
- nikstur/userborn#61 (normalUidRange/normalGidRange)
Mic92 added a commit to TUM-DSE/nixpkgs that referenced this pull request Nov 16, 2026
…nges

Userborn ignored `expires`, so accounts past their expiration date could
still log in, unlike with the perl activation script. It also hardcoded
the dynamic allocation range instead of following
security.loginDefs.settings.{UID,GID}_{MIN,MAX}.

Bump to a fork carrying both upstream PRs until they are released:
- nikstur/userborn#72 (expires)
- nikstur/userborn#61 (normalUidRange/normalGidRange)
Mic92 added a commit to TUM-DSE/nixpkgs that referenced this pull request Nov 19, 2026
…nges

Userborn ignored `expires`, so accounts past their expiration date could
still log in, unlike with the perl activation script. It also hardcoded
the dynamic allocation range instead of following
security.loginDefs.settings.{UID,GID}_{MIN,MAX}.

Bump to a fork carrying both upstream PRs until they are released:
- nikstur/userborn#72 (expires)
- nikstur/userborn#61 (normalUidRange/normalGidRange)
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.

2 participants