Repository navigation
Serialize disabled shadow expiration as an empty field - #285
Open
vinsymoyya wants to merge 2 commits into
Open
vinsymoyya wants to merge 2 commits into
vinsymoyya wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Serialize the LDAP
shadowExpire = -1sentinel as an empty account-expiration field in the files cache, as required by shadow(5), instead of writing the literal-1. The map entry is left unchanged, and configured positive expiration dates retain their current output.Fixes #109.
Added a BytesIO regression for missing, disabled, and positive expiration values. On current main (
10fbf8a803f32c0007aa13d83179681a115299ac), the disabled case fails withroot:*::::::-1:; the fix emitsroot:*:::::::.Validation:
python3 -m pytest -q nss_cache/sources/ldapsource_test.py nss_cache/maps nss_cache/util/file_formats_test.py nss_cache/caches/files_test.py. No tests excluded from that run.expire=-1; missing and positive values pass before and after the fix.git diff --checkpass. The contribution guide's YAPF guidance predates the current Black workflow; the final test follows the file's existing Black style.Reference: https://man7.org/linux/man-pages/man5/shadow.5.html documents an empty account-expiration field as no expiration.