AgeCommit message (Collapse)AuthorLines
Leave readme out of what scan-path fixesBryce Kwon-3/+15
Name the log link that enable-index-links addsBryce Kwon-3/+12
The manual has named the commit page since it was written in 2008, a year after the index started linking the log instead.
Give readme headings anchors like GitHub'sBryce Kwon-10/+58
A readme's links to its own sections, as in a table of contents, had nothing on the page to land on.
Keep underscores inside words out of emphasisBryce Kwon-4/+15
Let character references through to the browserBryce Kwon-2/+26
Decoding them here instead would mean carrying every named reference HTML defines, while the browser already knows them all.
Honour backslash escapes in readmesBryce Kwon-1/+12
Link the urls and addresses in angle bracketsBryce Kwon-1/+26
Keep a wrapped list item in its listBryce Kwon-8/+29
The item's second line became a paragraph of its own and the items after it a new list, so an ordered list started counting again.
Let a table cut a paragraph shortBryce Kwon-2/+18
A table written right under a line of text came out as more of the paragraph, pipes and all.
Run a paragraph's lines together like GitHubBryce Kwon-13/+43
GitHub shows a single newline in a markdown file as a space, and roff fills the lines of a man page the same way, so text wrapped in the source came out ragged on the about page.
Leave images and badges out of rendered readmesBryce Kwon-27/+35
A relative image loaded from below the about page, which answers 404 now, and a remote one had every visitor's browser call a third party. A badge also came out as a link to its own image, wrapped in stray brackets.
Lead a readme's relative links into the treeBryce Kwon-11/+114
A browser resolved them against the about page, where nothing lives now that the page answers 404 below itself. They resolve the way GitHub resolves a readme's links instead, from the readme's directory and on the branch it was read from.
Trim readme lines in linear timeBryce Kwon-2/+36
The heading pattern backtracked over a run of spaces in cubic time and the cell trim in quadratic time, so one crafted line in a readme could hold a request for half an hour, well inside the size cap. The heading rule now also keeps a sharp that ends a word, as in "# C#".
Hand the about filter the tree url its links needBryce Kwon-43/+122
With nothing below the about page, a readme's relative links have to be written against the tree, and only cgit knows how this site spells the url of a tree page and which ref the readme was read from. Both reach the filter already escaped for a url, built by the same writer as cgit's own links.
Answer 404 for any path below the about pageBryce Kwon-135/+44
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.
Keep the age hook's directory group writableBryce Kwon-2/+31
The hook forced a 022 umask, so in a repository shared with a group the first pusher owned info/web and every other member's push failed to write the age file there.
Keep the cache hook's rm errors from pushersBryce Kwon-4/+38
Only the exit status was hidden, so a pusher without write access to the cache root saw a permission error per cached page, against what the hook's own comment promised.
Trim avatar addresses in linear timeBryce Kwon-2/+36
The trim pattern backtracked over a run of spaces inside an address, which a commit can carry, and a log page runs the filter for every row. Forty thousand spaces took two seconds per row.
Refuse every repository when auth-file loses reposBryce Kwon-11/+27
A repos file the filter could not open read as listing nothing, so a permission slip or a mistyped path made every protected repository public. A line naming a repository with no groups was skipped the same way, where auth-inline's empty list denies everyone.
Put then on its own line in the release buildBryce Kwon-3/+6
Indent continuation lines with one tabBryce Kwon-7/+7
Share the max-blob-size check and its refusalBryce Kwon-27/+48
Five copies of the test and four of the error page had to agree by hand. The new check pins the four refusals, which no test covered.
Mark the parameters callbacks leave unusedBryce Kwon-6/+6
With these and the two changes before them, cgit builds under git's DEVELOPER=1 settings, which also annotate their own callbacks this way.
Pass callbacks to git by addressBryce Kwon-8/+20
ISO C has no conversion between a function pointer and void *, so the callbacks handed through git's data pointers and the write found by dlsym stopped the pedantic half of a DEVELOPER=1 build.
Keep string literals behind const pointersBryce Kwon-59/+53
Git's DEVELOPER=1 build turns on -Wwrite-strings as an error, and the literals stored through plain char pointers failed cgit's own objects there. The exec filter's argv takes the cast execvp needs once, the way git's run-command does.
Remove what the version removal left behindBryce Kwon-6/+2
Stop the stats page after its error pageBryce Kwon-11/+12
A walk that failed to prepare printed an error page and then went on to print the statistics page after it, where the log and the feed return. No request reaches that failure today, since the walk is only limited by a range or an order the page never asks for.
Read and write slot keys and pages in fullBryce Kwon-3/+7
xread and xwrite may move fewer bytes than asked. A short write of the key left a slot that could never match, a short read of it reported a collision, and a page write that moved nothing looped for ever.
Stop the sendfile loop at the end of a short slotBryce Kwon-0/+4
sendfile returns zero at the end of the file, and the loop only ended once the offset reached the size recorded when the slot was opened, so a slot cut shorter in between spun the request forever. Only Linux builds this path. A stand-in header type checked it here.
Name the right file and error in the scan logsBryce Kwon-2/+31
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.
Keep the charset off types that only spell xmlBryce Kwon-2/+29
Matching xml anywhere in the type also caught the Office formats, whose names hold openxmlformats, so a .docx went out with a UTF-8 charset.
Skip an indented comment in the mimetype fileBryce Kwon-3/+7
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.
Cache every branch page under cache-dynamic-ttlBryce Kwon-8/+21
The dynamic ttl only applied when the url named a branch with h=, so the log, tree and refs of the default branch, which never carry one, fell back to cache-summary-ttl. The manual already gives each ttl the scope the code now uses.
Keep date-format=local-local from failing pagesBryce Kwon-7/+27
The guard took local as a name that may carry the -local suffix, but git reads local only as a whole alias of default-local and dies on anything after it, so that one value turned every page into a 500.
Keep the error of a request that dies mid captureBryce Kwon-1/+32
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-7/+28
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-2/+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.
Keep the version numbers off the pagesBryce Kwon-14/+7
The generator meta, the footer and the patch signature named the exact cgit and git versions on every response, which only helps someone matching a site against an advisory. The shipped server configs already hide the server's own version for the same reason, and `cgit --version` still answers on the host.
Mark a page behind an auth filter privateBryce Kwon-14/+42
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.
Pin the advisory classes with tests and name an empty authorBryce Kwon-6/+120
Each class behind cgit's published advisories now has a check against the current code, from a newline in a file name to shell syntax handed to a filter. The feed also treated an ident with an empty name and an empty address as present and wrote an empty person, which Atom forbids.
End a request quietly when the client has goneBryce Kwon-4/+50
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.
Send a charset only with a text typeBryce Kwon-15/+19
Archives, packs and the HEAD file went out as octet-stream or gzip with a UTF-8 charset on the end, since only the blob page cleared it. The headers now decide from the type itself, so the two places that cleared the charset by hand no longer need to.
Word the blob size and binary errors alikeBryce Kwon-11/+7
The four pages that refuse a blob over max-blob-size each said it in their own way, two of them in lower case, and the blame page ended its binary notice with a full stop no other error carries.
Leave a branch spelled like an option out of the switcherBryce Kwon-0/+11
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.
Replace the stray bytes of text that is not UTF-8Bryce Kwon-43/+99
A commit whose encoding header names something iconv cannot convert, or whose text is labelled UTF-8 without being it, reached a page declared UTF-8 with its bytes untouched. The atom feed already replaced them, so its UTF-8 reader moves to shared.c and every ident, subject, message and tag text passes through it.
Walk a path on the blob page from any commit the id namesBryce Kwon-8/+29
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-12/+68
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/+21
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.
Limit rawdiff to the requested pathBryce Kwon-13/+35
The diff and patch pages honour the path in the url, which the parameter table documents for every page, but rawdiff never handed it to git and answered with the whole diff.
Send a clone file with its size in whole batchesBryce Kwon-4/+33
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.