<feed xmlns='http://www.w3.org/2005/Atom'>
<title>cgitext.git/filter.c, branch master</title>
<subtitle>cgitext – CGI for Git extension</subtitle>
<id>https://sayag.it/cgitext.git/atom/filter.c?h=master</id>
<link rel='self' href='https://sayag.it/cgitext.git/atom/filter.c?h=master'/>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/'/>
<updated>2026-07-31T04:38:28Z</updated>
<entry>
<title>licensing: add author preambles where changes were done</title>
<updated>2026-07-31T04:38:28Z</updated>
<author>
<name>Saya Andy</name>
<email>saya.andy@posteo.com</email>
</author>
<published>2026-07-30T05:49:23Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=306fafc1d1d19c51d7ac24479f49c76272934ce5'/>
<id>urn:sha1:306fafc1d1d19c51d7ac24479f49c76272934ce5</id>
<content type='text'>
Add a copyright for changes done by me, also note in README the nature
of this repo
</content>
</entry>
<entry>
<title>ui-ci: let a ci-filter decide whether the tab is shown</title>
<updated>2026-07-30T05:27:31Z</updated>
<author>
<name>Saya Andy</name>
<email>saya.andy@posteo.com</email>
</author>
<published>2026-07-30T05:27:31Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=7162aef3344a4f4f2d7edd2f214d805bd744c20c'/>
<id>urn:sha1:7162aef3344a4f4f2d7edd2f214d805bd744c20c</id>
<content type='text'>
cgit cannot know whether the ref being viewed actually has a pipeline, so
the "ci" tab is offered for every ref and only reveals a missing one once
followed. Probing the ci system from cgit is not an option: the tab is
part of the page header, so it would mean a blocking request for every
page of every repository, cgit links no http client, and job pages are
usually not readable anonymously.

Add a ci filter instead, which receives the ref, whether it is a branch or
a tag, and the expanded url, and answers with its exit status. This keeps
credentials, timeouts and caching in a script, where they belong;
filters/ci-jenkins.sh demonstrates all three against Jenkins' REST API.

The verdict is memoized, so the filter runs once per request rather than
once for the tab and again for the redirect, and it governs the page as
well as the tab, so a hidden tab cannot be reached by typing the url.

Signed-off-by: Saya Andy &lt;saya.andy@posteo.com&gt;
</content>
</entry>
<entry>
<title>global: fix libc constness warnings</title>
<updated>2026-05-04T21:03:51Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-05-04T21:03:22Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=5a0f900569f421422bd7511a45c7346c7668e710'/>
<id>urn:sha1:5a0f900569f421422bd7511a45c7346c7668e710</id>
<content type='text'>
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>cgit: truncate all config values at the newline</title>
<updated>2026-05-04T16:28:27Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-05-04T16:13:13Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=ed05b1054df10a2fbc68000cfdd429daec03a456'/>
<id>urn:sha1:ed05b1054df10a2fbc68000cfdd429daec03a456</id>
<content type='text'>
These would be largely invalid anyway (save, I suppose, for Linux file
paths that technically can contain new lines).

The actual problem is that these get printed back out into cached -- and
trusted -- cgitrc files, and if the fields have newlines, the git-config
way of less trusted users configuring repos on a shared system can be
abused to inject newlines, which then can be used to smuggle global
options (including filters, which execute code) into the cached cgitrc.

So now, only ever duplicate up to the newline, when dealing with these
inputs.

Reported-by: Adrian Denkiewicz &lt;adrian@doyensec.com&gt;
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>fix building with clang</title>
<updated>2024-07-16T11:26:10Z</updated>
<author>
<name>Denis Pronin</name>
<email>dannftk@yandex.ru</email>
</author>
<published>2024-06-09T06:41:36Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=fb87de795b9f1b1e21825243716ff1156097adf2'/>
<id>urn:sha1:fb87de795b9f1b1e21825243716ff1156097adf2</id>
<content type='text'>
fix error that is given because of macro overlapping cgit_filter member:

../filter.c:388:10: error: no member named '__fprintf_chk' in
'struct cgit_filter'
  388 |         filter-&gt;fprintf(filter, f, prefix);
      |         ~~~~~~  ^
/usr/include/bits/stdio2.h:92:3: note: expanded from macro 'fprintf'
   92 |   __fprintf_chk (stream, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
      |   ^
1 error generated.

Signed-off-by: Denis Pronin &lt;dannftk@yandex.ru&gt;
Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</content>
</entry>
<entry>
<title>filter: pipe_fh should be local</title>
<updated>2017-10-14T14:13:07Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2017-10-14T14:13:07Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=fd069b4ca08cb46eb335a1434330b21fbaf84b9c'/>
<id>urn:sha1:fd069b4ca08cb46eb335a1434330b21fbaf84b9c</id>
<content type='text'>
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>filter: don't use dlsym unnecessarily</title>
<updated>2015-08-13T13:39:06Z</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2015-08-13T11:14:20Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=0c4d76755b98bb597279a1930bf4c69eca7dde62'/>
<id>urn:sha1:0c4d76755b98bb597279a1930bf4c69eca7dde62</id>
<content type='text'>
We only need to hook write() if Lua filter's are in use.  If support has
been disabled, remove the dependency on dlsym().

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
</content>
</entry>
<entry>
<title>Remove redundant includes</title>
<updated>2015-08-13T13:36:53Z</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2015-08-13T11:14:15Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=157f544ac2149a985b0f62e9381a759c0ae252ec'/>
<id>urn:sha1:157f544ac2149a985b0f62e9381a759c0ae252ec</id>
<content type='text'>
These are all included in git-compat-util.h (when necessary), which we
include in cgit.h.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
</content>
</entry>
<entry>
<title>Avoid non-ANSI function declarations</title>
<updated>2015-03-09T16:38:30Z</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2015-03-08T16:32:16Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=e3d3fffdd447cdb4551549faae65bae5353a2cab'/>
<id>urn:sha1:e3d3fffdd447cdb4551549faae65bae5353a2cab</id>
<content type='text'>
Sparse says things like:

	warning: non-ANSI function declaration of function 'calc_ttl'

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
</content>
</entry>
<entry>
<title>repolist: add owner-filter</title>
<updated>2014-12-24T02:08:20Z</updated>
<author>
<name>Chris Burroughs</name>
<email>chris.burroughs@gmail.com</email>
</author>
<published>2014-08-04T13:23:08Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=96ceb9a95a7a321209cff347fefd141a9fffc7ca'/>
<id>urn:sha1:96ceb9a95a7a321209cff347fefd141a9fffc7ca</id>
<content type='text'>
This allows custom links to be used for repository owners by
configuring a filter to be applied in the "Owner" column in the
repository list.
</content>
</entry>
</feed>
