Skip to content

fakeserver, conformance, nntp-fakeserver: fixes from the v0.14.0 review - #18

Open
go-while wants to merge 1 commit into
mainfrom
review-fixes-v0.14
Open

go-while wants to merge 1 commit into
mainfrom
review-fixes-v0.14

Conversation

@go-while

Copy link
Copy Markdown
Owner

Fixes for 8 findings of four independent reviews of v0.14.0 (Haiku 5.5, Sonnet 5.5, Sol, Terra), each checked against the code. Each fix has a test that fails on v0.14.0 and passes here. The 64 KiB line cap (all four reviewers' hardening finding) is a separate PR.

# Finding Fix Test
1 Store: a POST naming a generated group panicked in the connection goroutine (Store.AddArticle) and ended the whole test process 441 "... is a generated group" before anything is filed (Store.firstGenerated) TestStorePostGeneratedGroup
2 Store: POST called override() a second time; OverrideTimes was used twice per POST, and with Times 1 a refused POST then read the client's next commands as an article decide on the reply written (c.last), as IHAVE in PeerHandler does TestStorePostOverrideTimes
3 nntp-fakeserver raw Then: "inflate" used compress/flate, which holds a Z_PARTIAL_FLUSH command back until more input comes internal/inflate through a pipe, closed when the handler returns TestRawInflatePartialFlush
4 conformance: with Options.User, a server that lists READER only after AUTHINFO had its reader checks skipped before ready() could log in the early Needs skip waits when User is set; every check with Needs calls ready(), which logs in, rereads CAPABILITIES and tests Needs TestRunNeedsAfterLogin
5 conformance: farNumber capped at 2^31-1 even when the group's high is at or above it, so the 423 probes could name an existing article above high when high >= 2^31-1 TestParseHelpers
6 Store: the AUTHINFO value was re-joined from strings.Fields ("p q" never matched, "p\tq" matched "p q") the rest of the line after the subcommand and one separator, byte for byte (cutWord) TestStoreAuthPasswordVerbatim
7 conformance: checkOverLine sliced the OVERVIEW.FMT name by its lower-cased length; a name that grows when lower-cased (U+023A) panicked (recovered as a "panic:" Fail) the error quotes the lower-cased name TestCheckOverLineFoldingName
8 Peer: the verb was split at one space only ("check\t" was 500, "CHECK " kept a space in the id) cutWord, argument trimmed (AUTHINFO values kept verbatim) TestPeerVerbSplit

Not changed (checked, by the real-vs-noise bar): Peer with User and no Pass accepts any PASS (documented "no password"), generators running under Store.mu (only with 100k-article OVERs), nntp-conformance's documented no-verify STARTTLS without -ca, mailrec argv with a newline.

gofmt, go vet ./... and go test ./... -race -count=1 pass.

🤖 Generated with Claude Code

Four independent reviews (Haiku, Sonnet, Sol, Terra) of v0.14.0; each fix
has a test that fails before it.

- fakeserver Store: a POST naming a generated group panicked in the
  connection goroutine and ended the test process; it now gets 441
  before anything is filed.
- fakeserver Store: POST looked up its override a second time, so
  OverrideTimes was used twice per POST and a refused POST (Times 1) then
  read the client's next commands as an article; it now decides on the
  reply written.
- fakeserver Store: the AUTHINFO value is the rest of the line byte for
  byte, not re-joined from fields ("p  q" never matched, "p\tq" matched
  "p q").
- fakeserver Peer: the verb is split at any space or tab and the argument
  trimmed ("check\t<id>" was 500, "CHECK  <id>" kept a space in the id).
- nntp-fakeserver raw "inflate": internal/inflate instead of
  compress/flate, which held a Z_PARTIAL_FLUSH command back.
- conformance: with Options.User, a missing Needs capability no longer
  skips the check before its ready() logged in and read CAPABILITIES
  again.
- conformance: farNumber stays above high when high is 2^31-1 or more.
- conformance: checkOverLine no longer slices the OVERVIEW.FMT name by its
  lower-cased length (a panic for names like U+023A).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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