gosalyn: Case 2 design ruling after r11, the sync's askpass helper, fixed argv with followRedirects=false and credential.helper reset, LC_ALL=C, exact Username and Password prompts for the host and user, no userinfo, slot path not fd 3 (row 222, megavolt-0060, dewey-0765, gosalyn-0068, a304dad94)
This commit is contained in:
1 parent
8614ba87cc
commit
75fb3e10e3
1 file changed
+25
-6
@@ -30,6 +30,22 @@ forgery question (mos-1097 item 2, #430) is unchanged, and so is the Console por
|
||||
re-pin, but it is still there. The C2-13a brief carries this when Sage re-briefs it into the installer
|
||||
row (I2, Vikunja #432).
|
||||
|
||||
## Ruling after r11: the sync's askpass helper (row 222)
|
||||
|
||||
Before building C2-03a, Megavolt compared 7.2's `GIT_ASKPASS` helper with row 199's credential helper
|
||||
(megavolt-0060, asked by sage-1487). As written, 7.2 left three gaps. git's default
|
||||
`http.followRedirects=initial` follows a 302 to another host. A helper that prints the token answers any
|
||||
prompt, with no host check. And git asks askpass for the username too, so the token went out as the
|
||||
username. Dewey (dewey-0765) and I (gosalyn-0068) accepted the fix, and Sage ruled it into the C2-03a brief
|
||||
(a304dad94).
|
||||
|
||||
The argv is `SAFE`, then `-c protocol.https.allow=always`, `-c http.followRedirects=false` and
|
||||
`-c credential.helper=`, then `-C <mirror>`. The env adds `LC_ALL=C`, because the helper matches git's
|
||||
prompt text and git translates that text. The helper answers only the exact Username and Password
|
||||
prompts for the configured host and user, and exits 1 on anything else. The URL carries no userinfo. The
|
||||
helper reads the slot path, so the bus never holds the value, and that is why it doesn't use row 199's
|
||||
fd 3. Section 7.2 says so.
|
||||
|
||||
## Changes from r10
|
||||
|
||||
Webby returned r10 with B1-B3 and N1-N5 (webby-0036, `agents/webby/work/case2-r10/REVIEW.md` at
|
||||
@@ -932,9 +948,11 @@ for the agents than in Obsidian. A full-path link avoids that (N4, 1.3).
|
||||
### 7.2 Sync (bus side)
|
||||
|
||||
One function, `syncCommand(kind, url)`, builds every fetch (and later push). Its argv is `SAFE`
|
||||
(`git.mjs:7-9`), then exactly `-c protocol.https.allow=always`, then `-C <mirror>`, then the command with
|
||||
the URL as an argument. Its env is `gitEnv()` plus `GIT_ASKPASS` naming a helper script outside the
|
||||
mirror, which reads the slot file and prints the token. The token is never in the URL, the mirror's
|
||||
(`git.mjs:7-9`), then `-c protocol.https.allow=always`, `-c http.followRedirects=false` and
|
||||
`-c credential.helper=`, then `-C <mirror>`, then the command with the URL as an argument. Its env is
|
||||
`gitEnv()` plus `LC_ALL=C` and `GIT_ASKPASS` naming a helper script outside the mirror, which reads the
|
||||
slot file. The helper answers only the exact Username and Password prompts for the configured host and
|
||||
user and exits 1 on anything else (ruling after r11). The URL carries no userinfo. The token is never in the URL, the mirror's
|
||||
config, argv, logs or replies (CONSTITUTION gate 13). The URL must be `https://`. Tests reach a local bare
|
||||
repo only through a module parameter that replaces `syncCommand`. No business file field or bus verb can
|
||||
reach that parameter.
|
||||
@@ -957,9 +975,10 @@ more than 60 seconds old.
|
||||
Later (C2-03b, with C2-02): push of bus commits, the push race retried once, `unpushed`, and
|
||||
`library-remote-invalid` refusals of bus writes (B9).
|
||||
|
||||
Tests (C2-03a): `syncCommand` argv equals `SAFE` plus exactly one `protocol.https.allow=always` and no
|
||||
other `protocol.*` key. Its env holds `GIT_ASKPASS` pointing outside the mirror, and the helper prints
|
||||
the slot file's content. A search of argv, the mirror's config and the run log finds no token. Against
|
||||
Tests (C2-03a): `syncCommand` argv equals `SAFE` plus the fixed sequence above, with no other
|
||||
`protocol.*` key. Its env holds `LC_ALL=C` and `GIT_ASKPASS` pointing outside the mirror. The helper
|
||||
prints the user for the username prompt and the slot file's content for the password prompt, and
|
||||
refuses a wrong host, a wrong port and another user. A 302 to another host fails the fetch. A search of argv, the mirror's config and the run log finds no token. Against
|
||||
a bare repo: fast-forward, R-problems recorded without holding the head, `library-diverged` kept until
|
||||
`--accept`, a failed fetch kept serving. A mutant that sets `protocol.allow=always` fails the argv test.
|
||||
|
||||
|
||||
Reference in new issue
Block a user