Repository navigation
sysusers: Preserve fields after empty quoted tokens - #2534
Merged
Merged
Conversation
An empty quoted field still consumes a column. Preserve the remaining input and treat empty optional fields as absent, so home and shell values are not silently dropped. Keep rejecting empty user/group names. Signed-off-by: Natsu <139412824+ddy314@users.noreply.github.com>
ddy314
force-pushed
the
fix/sysusers-empty-quoted-fields
branch
from
October 3, 2026 07:05
a19b433 to
1dfc9ed
Compare
ddy314
marked this pull request as ready for review
October 3, 2026 07:06
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Empty quoted entry types now bypass parse validation and are silently ignored.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Fixes sysusers tokenization so empty quoted optional fields do not discard subsequent columns.
Changes:
- Distinguishes exhausted input from empty quoted tokens.
- Treats empty optional fields as absent.
- Adds regression coverage for empty fields and names.
| File | Description |
|---|---|
crates/sysusers/src/lib.rs |
Updates token parsing and adds regression tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| } else { | ||
| Some((first, rest)) | ||
| } | ||
| Some((first, rest)) |
Collaborator
There was a problem hiding this comment.
This seems valid and insightful, albeit obscure. Can be a followup.
cgwalters
approved these changes
Oct 5, 2026
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.

An empty quoted column currently ends tokenization. For example,
u service 123 "" /home/service /bin/shloses both the home directory and shell.Distinguish an empty quoted token from exhausted input, and treat empty optional fields as absent while continuing to parse the remaining columns. Empty user and group names remain errors.
Validation:
cargo test -p bootc-sysusers --locked: 13 tests passed.cargo fmt --all -- --check.cargo clippy -p bootc-sysusers --all-targets --locked --no-deps -- -D warningspassed. Including dependency linting encounters an existingcollapsible_ifwarning incrates/utils/src/path.rson Rust 1.96.