<feed xmlns='http://www.w3.org/2005/Atom'>
<title>cgit/filter.c, branch v1.3.1</title>
<subtitle>A hyperfast web frontend for git repositories written in C.</subtitle>
<id>https://git.zx2c4.com/cgit/atom/filter.c?h=v1.3.1</id>
<link rel='self' href='https://git.zx2c4.com/cgit/atom/filter.c?h=v1.3.1'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/cgit/'/>
<updated>2026-05-04T21:03:51Z</updated>
<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://git.zx2c4.com/cgit/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://git.zx2c4.com/cgit/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://git.zx2c4.com/cgit/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://git.zx2c4.com/cgit/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://git.zx2c4.com/cgit/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://git.zx2c4.com/cgit/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://git.zx2c4.com/cgit/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://git.zx2c4.com/cgit/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>
<entry>
<title>remove trailing whitespaces from source files</title>
<updated>2014-04-17T10:55:09Z</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2014-04-17T09:55:46Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/cgit/commit/?id=b431282c91deea24916578395d88084261410968'/>
<id>urn:sha1:b431282c91deea24916578395d88084261410968</id>
<content type='text'>
</content>
</entry>
<entry>
<title>filter: don't forget to reap the auth filter</title>
<updated>2014-01-17T12:53:02Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2014-01-17T12:53:02Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/cgit/commit/?id=9786f4613da38cb263e76263370d7816a9347149'/>
<id>urn:sha1:9786f4613da38cb263e76263370d7816a9347149</id>
<content type='text'>
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
</feed>
