Skip to content

ps2client: Fix fsclient transfer errors, bounds and cleanup - #30

Merged
fjtrujy merged 1 commit into
masterfrom
fix/fsclient-transfer-safety
Oct 31, 2026
Merged

fjtrujy merged 1 commit into
masterfrom
fix/fsclient-transfer-safety

Conversation

@fjtrujy

@fjtrujy fjtrujy commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Correct the remote destination file descriptor check in fsclient_copyto.
  • Validate ps2netfs path lengths and read response sizes before using buffers.
  • Handle partial reads/writes, unexpected EOF, and file closure on error paths.
  • Truncate overwritten local and remote destination files.
  • Correct PS2HOSTNAME= matching and missing copy arguments.
  • Add a native C fake-ps2netfs loopback test (tests/fsclient_smoke.c) covering short reads, short writes, and oversized responses.

Plain C / compatibility

Validation

  • make all check: passed on macOS (five C smoke checks, three new C transfer checks).
  • git diff --check: passed.
  • Real PS2/ps2netfs transfer testing remains recommended before merge.

@fjtrujy
fjtrujy force-pushed the fix/fsclient-transfer-safety branch from 7c077b4 to 7462176 Compare October 31, 2026 14:43
@fjtrujy
fjtrujy changed the base branch from master to test/plain-c-infrastructure October 31, 2026 14:43
@fjtrujy
fjtrujy force-pushed the test/plain-c-infrastructure branch from 65c91f8 to ffb9919 Compare October 31, 2026 14:45
@fjtrujy
fjtrujy force-pushed the fix/fsclient-transfer-safety branch from 7462176 to 1f6079a Compare October 31, 2026 14:45
@fjtrujy
fjtrujy force-pushed the test/plain-c-infrastructure branch from ffb9919 to fad5fd3 Compare October 31, 2026 14:46
@fjtrujy
fjtrujy force-pushed the fix/fsclient-transfer-safety branch 2 times, most recently from 7dc5d29 to 5cfe7f5 Compare October 31, 2026 15:06
@fjtrujy
fjtrujy changed the base branch from test/plain-c-infrastructure to master October 31, 2026 15:06
Reject malformed ps2netfs replies and oversized paths, retry partial copies, truncate destinations, and close descriptors on all outcomes. Cover short reads/writes and invalid replies with a native C loopback server. No Python runtime or tests are required.
@fjtrujy
fjtrujy force-pushed the fix/fsclient-transfer-safety branch from 5cfe7f5 to e2dacba Compare October 31, 2026 15:19
@fjtrujy
fjtrujy merged commit 4930a6c into master Oct 31, 2026
12 of 13 checks passed
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