Skip to content

[Chore][Common] Correct Windows user list separator parsing#18413

Closed
hiSandog wants to merge 1 commit into
apache:devfrom
hiSandog:fix/small-cleanup-20260712
Closed

[Chore][Common] Correct Windows user list separator parsing#18413
hiSandog wants to merge 1 commit into
apache:devfrom
hiSandog:fix/small-cleanup-20260712

Conversation

@hiSandog

Copy link
Copy Markdown
Contributor

Was this PR generated or assisted by AI?

YES. Codex assisted with identifying the indexing bug, implementing the fix, and adding the regression test.

Purpose of the pull request

The Windows net user parser checks charAt(i) inside a loop over j. A line that starts with a hyphen can therefore be misclassified as the all-hyphen separator, causing header text to be returned as usernames. The parser also needs to handle the CRLF output preserved by ShellExecutor.

Brief change log

  • Check each separator character using the loop index.
  • Split command output on platform-independent line boundaries.
  • Extract the parser for package-level testing and add a CRLF regression case.

Verify this pull request

This change added tests and can be verified as follows:

  • Added OSUtilsTest coverage for a non-separator hyphenated line followed by a CRLF-delimited Windows user list.
  • git diff --check passes.
  • The parser fixture was independently exercised locally and returned alice and bob.
  • Maven tests were not run locally because no Java runtime is installed in the environment.

@hiSandog hiSandog force-pushed the fix/small-cleanup-20260712 branch from e245114 to 2f87e20 Compare July 12, 2026 06:58
@hiSandog hiSandog changed the title [Fix][Common] Correct Windows user list separator parsing [Chore][Common] Correct Windows user list separator parsing Jul 12, 2026
@SbloodyS

Copy link
Copy Markdown
Member

As the official document said, we only support MacOS and Linux, and there is no plan to support Windows.

@SbloodyS SbloodyS closed this Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants