AgeCommit message (Collapse)AuthorLines
Hold a scanned defbranch to a ref nameBryce Kwon-0/+11
The index stats the default branch below the repository to date it, and a scanned repository sets its own defbranch, which was not held to what a ref may hold, so one spelled as a path reached a file outside.
Pass over a notes ref that names no treeBryce Kwon-0/+20
A pusher can point refs/notes/commits or a signature notes ref at any object, and git dies loading one that is no tree, which ended every page of the repository, the dumb transport included. Such a ref now counts as absent.
Show an odd pushed date rather than die on itBryce Kwon-0/+39
A date past what the system holds, a zone that is no hhmm offset, or a date earlier than its own westward offset all made git die inside show_date, which took the summary, refs, log, commit and feed pages of the repository down. They are now clamped as git's own log clamps them.
Check the id before the page chrome resolves itBryce Kwon-0/+12
The chrome renders on an error page too, where the id had just been refused for using the wider revision syntax, and then looked it up anyway. A :/pattern id walks the whole history for a match.
Serve only the files a dumb clone asks forBryce Kwon-3/+7
The object path check let any run of safe characters through, so a spelling such as info//alternates or info/./alternates reached the alternates file the exact name was refused for. Only a loose object, a pack with its index and info/http-alternates are served now, and any other path is not found.
Give a repository without a path no ageBryce Kwon-0/+10
The index built its paths from a NULL repo.path, which the C library prints as "(null)", so it looked for refs under that name in the working directory.
Say why an oversized readme leaves about emptyBryce Kwon-0/+15
A readme past max-blob-size is never read, which left the about page with an empty block and no word of why.
Date a reftable repository on the indexBryce Kwon-0/+5
The idle column falls back on the mtime of the branch's loose ref or of packed-refs, and a reftable repository has neither, so its cell stayed empty. Git rewrites reftable/tables.list on every ref update.
Answer dumb-clone HEAD from the ref storeBryce Kwon-0/+26
A reftable repository keeps only a placeholder in its HEAD file, so a dumb clone was told HEAD named refs/heads/.invalid and checked nothing out. HEAD is now answered the way git's http-backend answers it.
Peel an annotated tag before looking for a readmeBryce Kwon-0/+14
Tag links carry the tag name as the head, so on any page reached from an annotated tag the about tab vanished and the about page redirected to the summary.
Encode repository urls and the feed branchBryce Kwon-0/+6
Links built from the repository url, among them the description link on the index and the Atom and refs links, wrote it as configured, so a name holding a space, '#' or '?' broke them. The feed link in the page head did the same with the branch, which turned a '+' into a space.
Leave readme out of what scan-path fixesBryce Kwon-0/+10
Answer 404 for any path below the about pageBryce Kwon-10/+21
The about page served every file beside the readme as a page of its own, through the about filter, and answered 200 for directories and missing files alike. Images it passed through came from the root of the default branch whatever the readme's own directory and ref. A readme on disk exposed its whole directory this way.
Name the right file and error in the scan logsBryce Kwon-0/+28
A failed stat logged the directory rather than the entry inside it, and a project list that failed to read printed strerror of the flag ferror returns, which names an unrelated error.
Skip an indented comment in the mimetype fileBryce Kwon-0/+6
Only a hash in the first column marked a comment, so an indented one was read as the type "#" for every word after it. The manual already describes comments by their first non-blank character.
Keep the error of a request that dies mid captureBryce Kwon-0/+29
The commit and diff pages collect each file's body before printing it, and a die in git while one was collected wrote the error page into that body, which was never sent, so the visitor got a page cut off mid table.
Gate a readme ending in a colon like a disk pathBryce Kwon-0/+10
trust-scan-config passed any readme holding a colon as a tracked file, while the parser takes one only when a path follows the colon, so a scanned repository could still name a file on disk outside itself. The two now share one test.
Keep a repository with an empty url ignoredBryce Kwon-1/+6
The field resets at the end of cgit_add_repo cleared the ignore flag that the empty url branch had just set, so such a repository was listed on the index and selectable with ?r=, where every link to it read the byte before its url.
Mark a page behind an auth filter privateBryce Kwon-0/+22
Only the login page carried a Cache-Control, so a page an auth filter had let a visitor see could be kept by a cache shared with the next visitor. The page also varies on the cookie that got them in.
End a request quietly when the client has goneBryce Kwon-0/+16
A write that failed with EPIPE on an uncached page died into an error page, which died again at exit when the page could not be sent either, and git logged a recursion warning on every dropped connection. A filter that exits early fails a write the same way, so the quiet exit is kept for writes that reach the client itself.
Leave a branch spelled like an option out of the switcherBryce Kwon-0/+7
Such a name is refused as a head before git could read it as an option, and the fallback branch already skips it, so the switcher offered a choice that led only to an error page.
Walk a path on the blob page from any commit the id namesBryce Kwon-0/+15
With both an id and a path the blob page handed back the raw object the id named, so a commit id gave the commit text itself, while the plain page looked the path up in that commit's tree. A tag is peeled to its commit on the way, and the README example of a pinned commit now uses a form the request checks accept.
Keep the query string across the about redirectsBryce Kwon-0/+13
The hop to the trailing-slash form of the about page, and the hop back to the summary of a repository without a readme, were built from the path alone, so a request for the about page of another branch landed on the default one. The query goes into the Location line as the client sent it, with any byte a header cannot carry percent-encoded.
Withhold the alternates file on the dumb transportBryce Kwon-0/+13
It lists object directories by their path on the server, which a client fetching over http can neither use nor needs to learn. The http-alternates file written for such clients still goes out.
Send a clone file with its size in whole batchesBryce Kwon-0/+15
The dumb transport read a pack four kilobytes at a time through stdio and sent it without a length, so a client could not tell a cut-off transfer from a complete one.
Gate html serving behind trust-scan-configBryce Kwon-3/+39
`enable-html-serving` makes the plain page send a repository file as text/html on the site's own origin, with no nosniff and no policy, so a scanned repository could switch it on from its git config or cgitrc without `trust-scan-config` and run script against every visitor. The warning for a key read from git config also named a null repository, because `repo->path` was set only after that file had been read.
Rename enable-trailers to enable-commit-trailersBryce Kwon-1/+1
Test the hardening passBryce Kwon-0/+471