Skip to content

GITLAWB_GIT_BIN is honored only on the smart-HTTP path; issues, ipfs and repos hardcode "git" #421

Description

@PierrunoYT

git_bin is configurable and threaded through AppState, but only the smart-HTTP path uses it. Three other call sites hardcode the binary name and resolve it through PATH.

Sites

Honors the configured binary:

  • git/smart_http.rs:107, :427, :618, :676 — all Command::new(git_bin)

Hardcodes "git":

  • git/issues.rs:15, :50, :67, :92, :113, :124, :184, :205, :210, :215
  • api/ipfs.rs:2549, :2607
  • api/repos.rs:3070, :7815

Why it matters

An operator who sets the knob gets it on some paths and not others, with no indication that the split exists. The plausible reasons for setting it — pinning a specific Git version, pointing at a wrapper, or using a hardened install outside PATH — all break silently when half the node ignores it. A version pin that holds for push but not for issue storage is arguably worse than no pin, because it looks like it worked.

There is no correctness difference when the configured value happens to equal the PATH-resolved git, which is presumably why this has not surfaced.

Fix direction

Thread git_bin through the remaining call sites. git/issues.rs currently takes only repo_path, so its signatures need the binary passed in — that is the bulk of the change.

Worth adding a test that asserts no Command::new("git") string literal survives outside #[cfg(test)], since the split re-opens easily. A grep-based test is unglamorous but is the thing that actually holds this closed.

Validation status

Verified by grep over the crate and by reading the call sites. Not verified by running the node against a non-PATH Git binary.


Found during an external audit pass. Duplicate-checked against open and closed issues; no existing coverage found, but the search used a limited keyword set.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bugDefect fix — wrong or unsafe behaviorsev:mediumDegraded but workaround existssubsystem:apiNode REST API request/response surfacesubsystem:peersPeer announce, discovery, and registrysubsystem:replicationMirror, replica, and cross-node syncsubsystem:storageBlob/object store, Arweave, IPFS, archives

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions