Skip to content

Set up Linux development environment - #1

Merged
brainx merged 1 commit into
mainfrom
cursor/setup-linux-dev-env-92e7
Jul 20, 2026
Merged

Set up Linux development environment#1
brainx merged 1 commit into
mainfrom
cursor/setup-linux-dev-env-92e7

Conversation

@brainx

@brainx brainx commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Summary

The repo's documented build path (scripts/build-macos.sh, make build, CI) targets macOS/Homebrew, but the cloud dev VM is Linux. This PR adds a Linux build path and developer documentation so the project builds, runs, and tests on Linux without modifying any vintage source.

  • scripts/build-linux.sh — mirrors build-macos.sh using system libraries (libssl-dev, libpcre3-dev (PCRE1), libncurses-dev, zlib1g-dev). Adds the -fcommon flag required by modern GCC/Clang for the legacy global declarations, generates Src/Makefile from Makefile.in, builds, and installs bin/mixmaster + bin/mixremailer.
  • AGENTS.md## Cursor Cloud specific instructions documenting the Linux build, run/test commands, and non-obvious runtime gotchas (no MTA on VM, pool batching, self-addressed loopback, expired 2007 sample keys).

No existing code was changed.

Verification

Built both binaries and ran a full end-to-end anonymous-remailer flow: client encrypts a message → remailer decrypts the hop → final mail delivered with the recovered plaintext and anonymizing disclaimer.

mixmaster_e2e_demo.mp4

Mixmaster ncurses client menu

Delivered anonymous mail (final hop output):

final_delivered_mail.eml

  • ./scripts/build-linux.sh — builds bin/mixmaster + bin/mixremailer
  • MIXPATH="$PWD/Mix" ./bin/mixremailer -M — CI smoke test, exit 0 (auto-generates RSA key)
  • cc -DHAVE_SETENV -include string.h Src/tests/test-parse_yearmonthday.c && ./a.out — prints OK.

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

Co-authored-by: BrainX <brainx@users.noreply.github.com>
@brainx
brainx marked this pull request as ready for review July 20, 2026 23:52
@cursor

cursor Bot commented Jul 20, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@brainx
brainx merged commit 7756250 into main Jul 20, 2026
1 check passed
brainx added a commit that referenced this pull request Jul 26, 2026
The daily-summary loop clamped its start index with a ternary whose result was
discarded:

    for ((i = (today - havestats) / SECONDSPERDAY) > 79 ? 79 : i; i >= 1; i--)

What executed was the bare assignment, so i took the unbounded day count and
indexed msg[7][80] and pool[2][80] past their ends. havestats is updated outside
the `today - then < 80 * SECONDSPERDAY` guard that protects the array writes
(three sites), so any stats.log or id.log record older than 80 days puts the
index out of range.

Reachable unauthenticated: a mail with `Subject: remailer-stats` classifies as
REM_KIND_STATS and dispatches straight into stats(). Without a sanitizer the
process does not fault -- it formats the out-of-bounds stack words into the reply
and mails them to whoever asked, which for a remailer is the worst available
failure mode.

Confirmed with AddressSanitizer before the fix:

    ERROR: AddressSanitizer: stack-buffer-overflow READ of size 4
        #0 stats stats.c:220
        #1 remailer_dispatch remailer_dispatch.c:136
      [1088, 3328) 'msg' <== Memory access at offset 3328 overflows this variable

and in the delivered reply: 431 lines instead of ~100, with leaked stack values
in the Postings column (583045632, 583045584, -188923520). After the fix the same
input is ASan-clean and the reply is 110 lines with exactly 79 daily rows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
brainx added a commit that referenced this pull request Jul 26, 2026
The daily-summary loop clamped its start index with a ternary whose result was
discarded:

    for ((i = (today - havestats) / SECONDSPERDAY) > 79 ? 79 : i; i >= 1; i--)

What executed was the bare assignment, so i took the unbounded day count and
indexed msg[7][80] and pool[2][80] past their ends. havestats is updated outside
the `today - then < 80 * SECONDSPERDAY` guard that protects the array writes
(three sites), so any stats.log or id.log record older than 80 days puts the
index out of range.

Reachable unauthenticated: a mail with `Subject: remailer-stats` classifies as
REM_KIND_STATS and dispatches straight into stats(). Without a sanitizer the
process does not fault -- it formats the out-of-bounds stack words into the reply
and mails them to whoever asked, which for a remailer is the worst available
failure mode.

Confirmed with AddressSanitizer before the fix:

    ERROR: AddressSanitizer: stack-buffer-overflow READ of size 4
        #0 stats stats.c:220
        #1 remailer_dispatch remailer_dispatch.c:136
      [1088, 3328) 'msg' <== Memory access at offset 3328 overflows this variable

and in the delivered reply: 431 lines instead of ~100, with leaked stack values
in the Postings column (583045632, 583045584, -188923520). After the fix the same
input is ASan-clean and the reply is 110 lines with exactly 79 daily rows.
@brainx
brainx deleted the cursor/setup-linux-dev-env-92e7 branch July 26, 2026 00:38
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