fix(sidecar): refuse a plugin that names another server (D155) #15
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/refuse-foreign-plugin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by the phase 18 walk (§34.3 step 2). The org lead decided the sidecar should refuse and close rather than warn (D155). Merge together with Rust-Plugins#15: its second commit makes the plugin's backoff hold against a refusal, and without it a refused plugin redials about 250 times a second.
Why
[game].server_idwas a cross-check that logged aWARNand kept the plugin's id. On the walk rig, a plugin bug (Rust-Plugins#15, D154) parked beta's plugin in alpha's listener backlog. The moment alpha's plugin reloaded, alpha's sidecar accepted beta, and the website showed serveralphawith hostname "rg18 beta" and beta's wipe id. The only trace was nineWARNlines.What changes
game.rs: withserver_idset, the connection is closed on the first frame naming another server, before that frame reaches the store or the feed. Both ids are logged atERROR, with the likely cause (two servers dialing one game port). A blankserver_idchecks nothing, as before./healthreads the same handle, so it reportsplugin_connectedonly from that point too.app.rs: the warn-onlycheck_server_idis removed;game::servetakes the configured id.egg/with-sidecar.sh: once the plugin's config exists, itsServerIdis what the sidecar gets. The plugin readsRUSTLINK_SERVER_IDonly when it writes its first config (D150). Without this, a panel variable edited after the first boot would take the bridge down instead of "changing nothing", which is whatrust-link/INSTALL.mdpromises. The launcher prints one line saying which id it used and why. Tested inghcr.io/pterodactyl/games:rustacross four cases: first boot, an edited variable, a Carbon config, and an installer-shaped config.No wire-message shape changes, so
PROTOCOL_VERSIONstays 12. PROTOCOL.md's rule "the plugin's id is the authority; the sidecar warns" is amended in the phase 18 docs PR.Proof
cargo fmt,clippy -D warnings, and 66 tests including 3 new ones: the pure check, a foreign plugin refused over a real socket with nothing forwarded and no command channel, and the channel opening on a matching frame.ERROR refusing a plugin that names another server: this sidecar is 'alpha', the plugin says 'beta'…, took alpha's own plugin back, and the site still showed alpha as rg18 alpha with alpha's wipe. With Rust-Plugins#15, refusals ran every 5 s. A restarted sidecar was rejoined by its own plugin in 0.49 s.Merging releases v0.1.1 and triggers the installer's
bundle.yml.🤖 Generated with Claude Code
https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY