<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/gitweb, branch v1.7.0.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.7.0.9</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.7.0.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2010-12-15T19:38:19Z</updated>
<entry>
<title>Git 1.7.0.9</title>
<updated>2010-12-15T19:38:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-12-15T19:38:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cb198b3b67feb2c0a6f22199ec14fa48d18ac1ce'/>
<id>urn:sha1:cb198b3b67feb2c0a6f22199ec14fa48d18ac1ce</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Git 1.6.6.3</title>
<updated>2010-12-15T19:32:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-12-15T19:32:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=abf411e28d9df669b0e690578a1eb95c0bd29847'/>
<id>urn:sha1:abf411e28d9df669b0e690578a1eb95c0bd29847</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Git 1.6.5.9</title>
<updated>2010-12-15T19:27:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-12-15T19:27:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ec82874ad47627a44b6b22a6645551a214293711'/>
<id>urn:sha1:ec82874ad47627a44b6b22a6645551a214293711</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gitweb: Introduce esc_attr to escape attributes of HTML elements</title>
<updated>2010-12-15T19:16:31Z</updated>
<author>
<name>Jakub Narebski</name>
<email>jnareb@gmail.com</email>
</author>
<published>2010-12-14T23:34:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3017ed62f47ce14a959e2d315c434d4980cf4243'/>
<id>urn:sha1:3017ed62f47ce14a959e2d315c434d4980cf4243</id>
<content type='text'>
It is needed only to escape attributes of handcrafted HTML elements,
and not those generated using CGI.pm subroutines / methods for HTML
generation.

While at it, add esc_url and esc_html where needed, and prefer to use
CGI.pm HTML generating methods than handcrafted HTML code.  Most of
those are probably unnecessary (could be exploited only by person with
write access to gitweb config, or at least access to the repository).

This fixes CVE-2010-3906

Reported-by: Emanuele Gentili &lt;e.gentili@tigersecurity.it&gt;
Helped-by: John 'Warthog9' Hawley &lt;warthog9@kernel.org&gt;
Helped-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Jakub Narebski &lt;jnareb@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gitweb: git_get_project_config requires only $git_dir, not also $project</title>
<updated>2010-03-31T17:57:04Z</updated>
<author>
<name>Jakub Narebski</name>
<email>jnareb@gmail.com</email>
</author>
<published>2010-03-27T19:26:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7a49c254cdaec6b15a6e2818e29fdb34fc6f7717'/>
<id>urn:sha1:7a49c254cdaec6b15a6e2818e29fdb34fc6f7717</id>
<content type='text'>
Fix overeager early return in git_get_project_config, introduced in 9be3614
(gitweb: Fix project-specific feature override behavior, 2010-03-01).  When
git_get_project_config is called from projects list page via
git_get_project_owner($path) etc., it is called with $git_dir defined (in
git_get_project_owner($path) etc.), but $project variable is not defined.
git_get_project_config doesn't use $project variable anyway.

Reported-by: Tobias Heinlein &lt;keytoaster@gentoo.org&gt;
Signed-off-by: Jakub Narebski &lt;jnareb@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jn/gitweb-config-error-die' into maint</title>
<updated>2010-03-05T06:27:12Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-03-05T06:27:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7d181222ea568ada9952f23a8f92b35bce161cc2'/>
<id>urn:sha1:7d181222ea568ada9952f23a8f92b35bce161cc2</id>
<content type='text'>
* jn/gitweb-config-error-die:
  gitweb: Die if there are parsing errors in config file
</content>
</entry>
<entry>
<title>gitweb: Fix project-specific feature override behavior</title>
<updated>2010-03-02T20:14:44Z</updated>
<author>
<name>Jakub Narebski</name>
<email>jnareb@gmail.com</email>
</author>
<published>2010-03-01T21:51:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9be3614eff36271d5f1cd460a568a219902cb044'/>
<id>urn:sha1:9be3614eff36271d5f1cd460a568a219902cb044</id>
<content type='text'>
This commit fixes a bug in processing project-specific override in
a situation when there is no project, e.g. for the projects list page.

When 'snapshot' feature had project specific config override enabled
by putting
  $feature{'snapshot'}{'override'} = 1;

(or equivalent) in $GITWEB_CONFIG, and when viewing toplevel gitweb
page, which means the projects list page (to be more exact this
happens for any project-less action), gitweb would put the following
Perl warnings in error log:

  gitweb.cgi: Use of uninitialized value $git_dir in concatenation (.) or string at gitweb.cgi line 2065.
  fatal: error processing config file(s)
  gitweb.cgi: Use of uninitialized value $git_dir in concatenation (.) or string at gitweb.cgi line 2221.
  gitweb.cgi: Use of uninitialized value $git_dir in concatenation (.) or string at gitweb.cgi line 2218.

The problem is in the following fragment of code:

  # path to the current git repository
  our $git_dir;
  $git_dir = "$projectroot/$project" if $project;

  # list of supported snapshot formats
  our @snapshot_fmts = gitweb_get_feature('snapshot');
  @snapshot_fmts = filter_snapshot_fmts(@snapshot_fmts);

For the toplevel gitweb page, which is the list of projects, $project is not
defined, therefore neither is $git_dir.  gitweb_get_feature() subroutine
calls git_get_project_config() if project specific override is turned
on... but we don't have project here.

Those errors mentioned above occur in the following fragment of code in
git_get_project_config():

  	# get config
  	if (!defined $config_file ||
  	    $config_file ne "$git_dir/config") {
  		%config = git_parse_project_config('gitweb');
  		$config_file = "$git_dir/config";
  	}

git_parse_project_config() calls git_cmd() which has '--git-dir='.$git_dir

There are (at least) three possible solutions:
1. Harden gitweb_get_feature() so that it doesn't call
   git_get_project_config() if $project (and therefore $git_dir) is not
   defined; there is no project for project specific config.
2. Harden git_get_project_config() like you did in your fix, returning early
   if $git_dir is not defined.
3. Harden git_cmd() so that it doesn't add "--git-dir=$git_dir" if $git_dir
   is not defined, and change git_get_project_config() so that it doesn't
   even try to access $git_dir if it is not defined.

This commit implements both 1.) and 2.), i.e. gitweb_get_feature() doesn't
call project-specific override if $git_dir is not defined (if there is no
project), and git_get_project_config() returns early if $git_dir is not
defined.

Add a test for this bug to t/t9500-gitweb-standalone-no-errors.sh test.

Reported-by: Eli Barzilay &lt;eli@barzilay.org&gt;
Signed-off-by: Jakub Narebski &lt;jnareb@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gitweb multiple project roots documentation</title>
<updated>2010-03-02T20:14:20Z</updated>
<author>
<name>Sylvain Rabot</name>
<email>sylvain@abstraction.fr</email>
</author>
<published>2010-03-02T00:04:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=964ad928d65b8bdf15bee4a662629824a0b3a0e7'/>
<id>urn:sha1:964ad928d65b8bdf15bee4a662629824a0b3a0e7</id>
<content type='text'>
This commit adds in the gitweb/README file a description of how to use gitweb
with several project roots using apache virtualhost rewrite rules.

Signed-off-by: Sylvain Rabot &lt;sylvain@abstraction.fr&gt;
Acked-by: Jakub Narebski &lt;jnareb@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gitweb: Die if there are parsing errors in config file</title>
<updated>2010-02-15T02:50:22Z</updated>
<author>
<name>Jakub Narebski</name>
<email>jnareb@gmail.com</email>
</author>
<published>2010-02-14T21:46:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e6e592db4c0099a6412aed6e868769535900f112'/>
<id>urn:sha1:e6e592db4c0099a6412aed6e868769535900f112</id>
<content type='text'>
Otherwise the errors can propagate, and show in damnest places, and
you would spend your time chasing ghosts instead of debugging real
problem (yes, it is from personal experience).

This follows (parts of) advice in `perldoc -f do` documentation.

This required restructoring code a bit, so we die only if we are reading
(executing) config file.  As a side effect $GITWEB_CONFIG_SYSTEM is always
available, even when we use $GITWEB_CONFIG.

Signed-off-by: Jakub Narebski &lt;jnareb@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gitweb: Simplify (and fix) chop_str</title>
<updated>2010-02-04T01:14:00Z</updated>
<author>
<name>John 'Warthog9' Hawley</name>
<email>warthog9@kernel.org</email>
</author>
<published>2010-02-03T11:28:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=57017b3e1554b169f3db52a7f8da4e359d043ca8'/>
<id>urn:sha1:57017b3e1554b169f3db52a7f8da4e359d043ca8</id>
<content type='text'>
The chop_str subroutine is meant to be used on strings (such as commit
description / title) *before* HTML escaping, which means before
applying esc_html or equivalent.

Therefore get rid of the failed attempt to always remove full HTML
entities (like e.g. &amp;amp; or &amp;nbsp;).  It is not necessary (HTML
entities gets added later), and it can cause chop_str to chop a string
incorrectly.

Specifically:

     API &amp; protocol: support option to force written data immediately to disk

from http://git.kernel.org/?p=daemon/distsrv/chunkd.git;a=commit;h=3b02f749df2cb1288f345a689d85e7061f507e54

The short version of the title gets chopped to

     API ...

where it should be

     API &amp; protocol: support option to force written data...

Noticed-by: John 'Warthog9' Hawley &lt;warthog9@kernel.org&gt;
Signed-off-by: John 'Warthog9' Hawley &lt;warthog9@kernel.org&gt;
Signed-off-by: Jakub Narebski &lt;jnareb@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
