Skip to content

NAS-135898 / 25.04.2 / Add special case handling of user password disable. (by mgrimesix) #16512

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

Merged
merged 2 commits into from
May 16, 2025

Conversation

bugclerk
Copy link
Contributor

When user passwords are disabled the user can no longer manage password change requirements or any password policy restrictions. Under certain configurations, e.g. STIG, this can lead to the user account being disabled. We want to avoid this condition.

The fix for this is to special case the user shadow entry to disable all expiration type settings when the user has password authentication disabled.

The shadow entry for a password disabled user will be *:::::::. This will prevent the user getting disabled due to password requirements.

Also added a CI unit test.
Also fixed a small error in the unit test. Reporting info on an assert was missing some data.

This fixes the issue raised in NAS-135863

Original PR: #16508
Jira URL: https://ixsystems.atlassian.net/browse/NAS-135898

mgrimesix added 2 commits May 16, 2025 19:08
The shadow entry for a password disabled root will be '*:::::::'.
This is to avoid the root user getting disabled due to password requirements.

Also added a CI unit test.
Also fixed a small error in the unit test.  Reporting info on an assert was missing some data.

(cherry picked from commit fbd43aa)
@yocalebo yocalebo merged commit 8328259 into stable/fangtooth May 16, 2025
1 check passed
@yocalebo yocalebo deleted the NAS-135898-25.04.2 branch May 16, 2025 21:20
@bugclerk
Copy link
Contributor Author

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators May 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants