cleanup spec
[platform/upstream/git.git] / packaging / git-prevent_xss-default.diff
1 From: Jakub Narebski <jnareb@...il.com>
2 Subject: [PATCH] gitweb: Enable $prevent_xss by default
3
4 This fixes issue CVE-2011-2186 originally reported in
5 https://launchpad.net/bugs/777804
6
7 Reported-by: dave b <db.pub.mail@...il.com>
8 Signed-off-by: Jakub Narebski <jnareb@...il.com>
9 ---
10  git-instaweb.sh    |    4 ++++
11  gitweb/README      |    5 +++--
12  gitweb/gitweb.perl |    2 +-
13  3 files changed, 8 insertions(+), 3 deletions(-)
14
15 --- a/git-instaweb.sh
16 +++ b/git-instaweb.sh
17 @@ -583,6 +583,10 @@
18  our \$git_temp = "$fqgitdir/gitweb/tmp";
19  our \$projects_list = \$projectroot;
20  
21 +# we can trust our own repository, so disable XSS prevention
22 +# to enable some extra features
23 +our \$prevent_xss = 0;
24 +
25  \$feature{'remote_heads'}{'default'} = [1];
26  EOF
27  }
28 --- a/gitweb/gitweb.perl
29 +++ b/gitweb/gitweb.perl
30 @@ -170,7 +170,7 @@
31  
32  # Disables features that would allow repository owners to inject script into
33  # the gitweb domain.
34 -our $prevent_xss = 0;
35 +our $prevent_xss = 1;
36  
37  # Path to the highlight executable to use (must be the one from
38  # http://www.andre-simon.de due to assumptions about parameters and output).