Request helper: refuse an upload directory of another user, and the body writes of registry.trb #293
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Split from #288 (criterion 3, the owner half) and two spots of the same hardening in
compiler/src/cli/registry.trb, which #288's PR leaves alone while #279 edits that file.Goal.
requestrefuses a<work>/uploadthat belongs to another user, with a message naming the path and the reason, before anything is written into it and before itschmod; and no registry command writes into that directory or prints a registry's raw bytes before the checks of #288 ran.Why it is split.
std/fshas no owner query:Metadatacarries kind, size, modification time and permissions, andstd/osonly the process's own effective user id (Posix.effectiveUserIdentifier). The owner needs a new native (st_uid), and under the two-commit rule (compiler/CONTRIBUTING.md, "Two commits for a breaking change") its use in the compiler can be pushed only after the seed knows it. MeanwhileuploadDirectory(#288) refuses a symbolic link and anything that is not a directory, and thechmodto0700that follows fails for every user but root on a directory they do not own, so nothing is written there.Acceptance criteria
File(a method, std naming; not by changing the signature of the existingfileMetadatanative, which the seed's compiler reaches), implemented inruntime/for POSIX, answering unsupported where there is no owner id (Windows, the browser), entered in the natives manifest with the table regenerated; a std test and a runtime test.uploadDirectoryrefuses a directory whose owner is not the effective user, also for root; the owner comparison is a separate function with a unit test.registry.trbwrites the bodies oftorb ownerandtorb yank(member.json,step-up.json,yank.json) only afteruploadDirectorychecked the directory, andprintOwnerprints a non-JSON answer throughprintableinstead ofreply.body.trim().torb login,torb owner,torb yankandpublishstay green.Seed. Yes: a new native (two commits, seed refresh between them). Depends on #288 and #279.
[loop:torbscript] intake: in scope (author orion, split from #288), not a duplicate, no collision with a design record. Refined by its author already (goal, criteria, seed impact: a new native under the two-commit rule, size: two commits). Depends on #288 and #279 (both have open PRs) and on a published seed for its second commit. next: waiting (PRs of #288 and #279) until 2026-10-10T04:00:00Z
[loop:torbscript] claim refine by session:loop-torbscript-20261026-1044 until 2026-10-26T11:56:08Z
[loop:torbscript] refine: #288 (PR #294) and #279 (PR #292) have both merged, so the dependencies are gone; the criteria were checked against
main(uploadDirectoryincompiler/src/package/upload.trbhas no owner check yet;registry.trbstill writesmember.json,step-up.jsonandyank.jsonbeforerequestreachesuploadDirectory, andprintOwnerstill printsreply.body.trim()). The criteria hold, but the item is an epic: commit 1 and commit 2 are separated by a seed refresh (owner's step), so they cannot land as one PR. Steps:File.owner, #496 (loop+ready; seed: new native, commit 1)uploadDirectoryrefuses a directory of another user (comparison in its own function with a unit test), also for root;registry.trbcallsuploadDirectorybefore it writesmember.json,step-up.jsonandyank.json;printOwnerprints a non-JSON answer throughprintable; loopback tests oftorb login,torb owner,torb yank,publishstay green. Theregistry.trbandprintablepart needs no new native and may be split off as its own step earlier if the loop picks it up.[loop:torbscript] decided by the loop: step 1 is split off now because it does not depend on anything unmerged; this issue stays without
ready(epic) until step 1 has landed and a seed containingFile.owneris published, then step 2 is filed. No owner question: a new native under the two-commit rule is a technical choice; the seed refresh itself stays Torben's.next: waiting (step 1 #496, then the owner's seed refresh). Worker usage ~60k tokens.