Skip to content

sysusers: Preserve fields after empty quoted tokens - #2534

Open
ddy314 wants to merge 1 commit into
bootc-dev:mainfrom
ddy314:fix/sysusers-empty-quoted-fields
Open

ddy314 wants to merge 1 commit into
bootc-dev:mainfrom
ddy314:fix/sysusers-empty-quoted-fields

Conversation

@ddy314

@ddy314 ddy314 commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

An empty quoted column currently ends tokenization. For example, u service 123 "" /home/service /bin/sh loses 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:

  • The new regression test fails on the base revision and passes with the fix.
  • cargo test -p bootc-sysusers --locked: 13 tests passed.
  • cargo fmt --all -- --check.
  • cargo clippy -p bootc-sysusers --all-targets --locked --no-deps -- -D warnings passed. Including dependency linting encounters an existing collapsible_if warning in crates/utils/src/path.rs on Rust 1.96.

@bootc-bot
bootc-bot Bot requested a review from jeckersb October 3, 2026 07:03
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
ddy314 force-pushed the fix/sysusers-empty-quoted-fields branch from a19b433 to 1dfc9ed Compare October 3, 2026 07:05
@ddy314
ddy314 marked this pull request as ready for review October 3, 2026 07:06

This branch has not been deployed

No deployments
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.

1 participant