Repository navigation
tools: phone-ssh: layer explicit endpoints onto shared connections - #57
Conversation
|
Thanks, this is a careful change. I compared it with main's version for every combination of One problem before I merge: with the explicit options and ssh exits 255 and nothing runs. It works with Smaller: please add the three variables to the usage comment at the top, and a sentence in CONTRIBUTING next to |
…#93) CONTRIBUTING's shared-driver rule asked for identical objects, which a per-SoC flag tested inside a shared function can't give (kernel #57); a per-function diff that shows only the new SoC's path changing is the evidence there, and per-SoC data reaches fallback-compatible boards too. husky's UFS plan said Tensor G4's host data has no suspend hook; kernel #83 adds one, and husky binds that data through its fallback compatible. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
Checking in on this one, since it's small and stands on its own: the only thing left from my 10-26 comment is the control path being too long for a Unix socket once connection sharing is on. Dropping For the flame set (#55, #56, #58, #59): no rush, but main has moved a lot since 10-27, so each will need a rebase. Version numbers have also moved: omamobile-shell 0.2.33 to 0.2.39 are taken by open PRs, so #55 would need 0.2.40 (or whatever is free when it lands), and omamobile-firstboot is at 0.1.3 in #97. #58 still needs the CONTRIBUTING §3.1 entry for flame (LUN, the four sectors, the attribute bit and CRCs), the GPT rollback, the slot flags before and after, and the way back. If you'd rather I close #17 now that it's split into these, say so. |
Retain sharing, --fresh and --stop while supporting a scoped USB endpoint, identity and strict known-hosts file. Isolate shared masters by their explicit identity and host-key context. Fake-SSH fixtures cover default compatibility, argv, sharing and fresh connections; no phone is contacted. Co-Authored-By: Codex <noreply@openai.com>
A 24-hex policy context plus OpenSSH %C makes the temporary master socket exceed Linux sun_path under /run/user/1000. Shorten the policy context to 12 hex characters and retain %C so effective HostName and Port changes in ssh_config still select different masters. Default connections keep their upstream control path. The length regression reproduced 111 bytes before this fix and now passes at 99 and 105 bytes, including the temporary 17-byte suffix. A real OpenSSH -G fixture also verifies host/port alias isolation without opening a connection. Document the three explicit options in the usage comment and beside sharing in CONTRIBUTING. Co-Authored-By: Codex <noreply@openai.com>
fcdbabe to
bd104a3
Compare
|
Thanks, this is exactly the fix. The 12-character policy hash keeps Since every Pixel 7 Pro session goes through this script, I also compared main and your head with none of the new variables set. I tried plain, The usage comment, the CONTRIBUTING line and the title are all in as well. Merging now, thank you. |
…erekross#57) OMAMOBILE_SSH_HOST (user@host), OMAMOBILE_SSH_KEY (an identity file, with IdentitiesOnly) and OMAMOBILE_SSH_KNOWN_HOSTS (strict host-key checking against that file) let a contributor reach a phone that isn't at root@172.16.42.1 with the default trust-on-every-boot options. With any of them set, a shared connection's control path adds a 12-character hash of the target, the resolved identity and known-hosts paths and their contents, so a different key, a rotated key or a changed host key never reuses another master; %C stays for the effective host and port. The path plus OpenSSH's 17-byte temporary suffix fits the 107-byte Unix socket limit (99 bytes under /run/user/1000, 105 with the longest UID), and tests/phone-ssh checks it. Without sharing, explicit options force a new connection even when the user's ssh_config shares globally. With none of the variables set, the ssh options are unchanged (only their order moved; `ssh -G` output identical for plain, --fresh and --stop, with and without OMAMOBILE_SSH_SHARE), and so is the default control path.
What and why
Add explicit
OMAMOBILE_SSH_HOST,OMAMOBILE_SSH_KEYandOMAMOBILE_SSH_KNOWN_HOSTSoptions totools/phone-ssh, preserving main's shared connections,--freshand--stop. Explicit identities and known-hosts policies get separate connection masters; known-host filenames are quoted for OpenSSH's parser.Address the review by shortening the custom policy hash to 12 hex characters. Keep
%Cso changes to the effective SSH host or port still select a separate master. Under/run/user/1000, OpenSSH's 17-byte temporary suffix previously made the path 111 bytes, exceeding Linux's 107-byte limit. It is now 99 bytes, or 105 with the longest decimal UID runtime path. Default connections retain main's control path.Document the variables in the usage comment and CONTRIBUTING beside
OMAMOBILE_SSH_SHARE. Rebased onto maina6034a5. This PR can merge independently of the flame work.Validation
tests/phone-ssh: the socket-length regression reproduced 111 bytes before the fix and passes at 99/105 bytes afterward. A real OpenSSH-Gfixture verifies alias host/port changes select separate masters without opening a connection. Sharing, fresh/stop, policy isolation and path tests pass.tests/all: passed in the Linux test container. Optional Docker provisioning, AOSP image, GPG local-build and root-image cases skipped because fixtures or tools were unavailable.shellcheck tools/phone-ssh tests/phone-ssh,tools/pr-check origin/mainandgit diff --check: passed.bd104a3: policy,tests/alland every package suite passed. No package files changed.