]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Git 1.7.3.4 v1.7.3.4
authorJunio C Hamano <gitster@pobox.com>
Wed, 15 Dec 2010 19:47:40 +0000 (11:47 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Dec 2010 19:47:40 +0000 (11:47 -0800)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1  2 
Documentation/RelNotes/1.7.3.4.txt
GIT-VERSION-GEN
gitweb/gitweb.perl

index c2a46a2e96b9b5c415282dfaca39092d06067c86,0000000000000000000000000000000000000000..e57f7c176db85e3bd40862fd091ecab835c601f5
mode 100644,000000..100644
--- /dev/null
@@@ -1,42 -1,0 +1,45 @@@
 +Git v1.7.3.4 Release Notes
 +==========================
 +
 +Fixes since v1.7.3.3
 +--------------------
 +
 + * Smart HTTP transport used to incorrectly retry redirected POST
 +   request with GET request.
 +
 + * "git apply" did not correctly handle patches that only change modes
 +   if told to apply while stripping leading paths with -p option.
 +
 + * "git apply" can deal with patches with timezone formatted with a
 +   colon between the hours and minutes part (e.g. "-08:00" instead of
 +   "-0800").
 +
 + * "git checkout" removed an untracked file "foo" from the working
 +   tree when switching to a branch that contains a tracked path
 +   "foo/bar".  Prevent this, just like the case where the conflicting
 +   path were "foo" (c752e7f..7980872d).
 +
 + * "git cherry-pick" or "git revert" refused to work when a path that
 +   would be modified by the operation was stat-dirty without a real
 +   difference in the contents of the file.
 +
 + * "git diff --check" reported an incorrect line number for added
 +   blank lines at the end of file.
 +
 + * "git imap-send" failed to build under NO_OPENSSL.
 +
 + * Setting log.decorate configuration variable to "0" or "1" to mean
 +   "false" or "true" did not work.
 +
 + * "git push" over dumb HTTP protocol did not work against WebDAV
 +   servers that did not terminate a collection name with a slash.
 +
 + * "git tag -v" did not work with GPG signatures in rfc1991 mode.
 +
 + * The post-receive-email sample hook was accidentally broken in 1.7.3.3
 +   update.
 +
++ * "gitweb" can sometimes be tricked into parrotting a filename argument
++   given in a request without properly quoting.
++
 +Other minor fixes and documentation updates are also included.
diff --combined GIT-VERSION-GEN
index 702306acd2c10d1cbe04c26bf3b89bafadb256f7,ec4c49a90daacc11072f8285e5879378156c22a8..d40b287e5a91b29d0807a84077d8f6a89e073159
@@@ -1,7 -1,7 +1,7 @@@
  #!/bin/sh
  
  GVF=GIT-VERSION-FILE
- DEF_VER=v1.7.3.3
 -DEF_VER=v1.7.2.5
++DEF_VER=v1.7.3.4
  
  LF='
  '
diff --combined gitweb/gitweb.perl
index e645d4a821f7eab28911f508923abd3e9a9dc53b,8b8ab2960793d591bcd8bf572e882339b9674a04..53253c622d54f4ce68993e4b9695a0d98d60d043
@@@ -7,7 -7,6 +7,7 @@@
  #
  # This program is licensed under the GPLv2
  
 +use 5.008;
  use strict;
  use warnings;
  use CGI qw(:standard :escapeHTML -nosticky);
@@@ -233,29 -232,6 +233,29 @@@ our %avatar_size = 
  # Leave it undefined (or set to 'undef') to turn off load checking.
  our $maxload = 300;
  
 +# configuration for 'highlight' (http://www.andre-simon.de/)
 +# match by basename
 +our %highlight_basename = (
 +      #'Program' => 'py',
 +      #'Library' => 'py',
 +      'SConstruct' => 'py', # SCons equivalent of Makefile
 +      'Makefile' => 'make',
 +);
 +# match by extension
 +our %highlight_ext = (
 +      # main extensions, defining name of syntax;
 +      # see files in /usr/share/highlight/langDefs/ directory
 +      map { $_ => $_ }
 +              qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl),
 +      # alternate extensions, see /etc/highlight/filetypes.conf
 +      'h' => 'c',
 +      map { $_ => 'cpp' } qw(cxx c++ cc),
 +      map { $_ => 'php' } qw(php3 php4),
 +      map { $_ => 'pl'  } qw(perl pm), # perhaps also 'cgi'
 +      'mak' => 'make',
 +      map { $_ => 'xml' } qw(xhtml html htm),
 +);
 +
  # You define site-wide feature defaults here; override them with
  # $GITWEB_CONFIG as necessary.
  our %feature = (
@@@ -1061,12 -1037,8 +1061,12 @@@ sub run_request 
        reset_timer();
  
        evaluate_uri();
 +      evaluate_gitweb_config();
        check_loadavg();
  
 +      # $projectroot and $projects_list might be set in gitweb config file
 +      $projects_list ||= $projectroot;
 +
        evaluate_query_params();
        evaluate_path_info();
        evaluate_and_validate_params();
@@@ -1114,8 -1086,12 +1114,8 @@@ sub evaluate_argv 
  
  sub run {
        evaluate_argv();
 -      evaluate_gitweb_config();
        evaluate_git_version();
  
 -      # $projectroot and $projects_list might be set in gitweb config file
 -      $projects_list ||= $projectroot;
 -
        $pre_listen_hook->()
                if $pre_listen_hook;
  
  
                run_request();
  
 -              $pre_dispatch_hook->()
 +              $post_dispatch_hook->()
                        if $post_dispatch_hook;
  
                last REQUEST if ($is_last_request->());
@@@ -1356,6 -1332,13 +1356,13 @@@ sub esc_url 
        return $str;
  }
  
+ # quote unsafe characters in HTML attributes
+ sub esc_attr {
+       # for XHTML conformance escaping '"' to '&quot;' is not enough
+       return esc_html(@_);
+ }
  # replace invalid utf8 character with SUBSTITUTION sequence
  sub esc_html {
        my $str = shift;
@@@ -1761,7 -1744,7 +1768,7 @@@ sub format_ref_marker 
                                        hash=>$dest
                                )}, $name);
  
-                       $markers .= " <span class=\"$class\" title=\"$ref\">" .
+                       $markers .= " <span class=\"".esc_attr($class)."\" title=\"".esc_attr($ref)."\">" .
                                $link . "</span>";
                }
        }
@@@ -1845,7 -1828,7 +1852,7 @@@ sub git_get_avatar 
                return $pre_white .
                       "<img width=\"$size\" " .
                            "class=\"avatar\" " .
-                           "src=\"$url\" " .
+                           "src=\"".esc_url($url)."\" " .
                            "alt=\"\" " .
                       "/>" . $post_white;
        } else {
@@@ -2556,7 -2539,7 +2563,7 @@@ sub git_show_project_tagcloud 
        } else {
                my @tags = sort { $cloud->{$a}->{count} <=> $cloud->{$b}->{count} } keys %$cloud;
                return '<p align="center">' . join (', ', map {
-                       "<a href=\"$home_link?by_tag=$_\">$cloud->{$_}->{topname}</a>"
+                       $cgi->a({-href=>"$home_link?by_tag=$_"}, $cloud->{$_}->{topname})
                } splice(@tags, 0, $count)) . '</p>';
        }
  }
@@@ -3340,6 -3323,30 +3347,6 @@@ sub blob_contenttype 
  sub guess_file_syntax {
        my ($highlight, $mimetype, $file_name) = @_;
        return undef unless ($highlight && defined $file_name);
 -
 -      # configuration for 'highlight' (http://www.andre-simon.de/)
 -      # match by basename
 -      my %highlight_basename = (
 -              #'Program' => 'py',
 -              #'Library' => 'py',
 -              'SConstruct' => 'py', # SCons equivalent of Makefile
 -              'Makefile' => 'make',
 -      );
 -      # match by extension
 -      my %highlight_ext = (
 -              # main extensions, defining name of syntax;
 -              # see files in /usr/share/highlight/langDefs/ directory
 -              map { $_ => $_ }
 -                      qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl),
 -              # alternate extensions, see /etc/highlight/filetypes.conf
 -              'h' => 'c',
 -              map { $_ => 'cpp' } qw(cxx c++ cc),
 -              map { $_ => 'php' } qw(php3 php4),
 -              map { $_ => 'pl'  } qw(perl pm), # perhaps also 'cgi'
 -              'mak' => 'make',
 -              map { $_ => 'xml' } qw(xhtml html htm),
 -      );
 -
        my $basename = basename($file_name, '.in');
        return $highlight_basename{$basename}
                if exists $highlight_basename{$basename};
        # print out each stylesheet that exist, providing backwards capability
        # for those people who defined $stylesheet in a config file
        if (defined $stylesheet) {
-               print '<link rel="stylesheet" type="text/css" href="'.$stylesheet.'"/>'."\n";
+               print '<link rel="stylesheet" type="text/css" href="'.esc_url($stylesheet).'"/>'."\n";
        } else {
                foreach my $stylesheet (@stylesheets) {
                        next unless $stylesheet;
-                       print '<link rel="stylesheet" type="text/css" href="'.$stylesheet.'"/>'."\n";
+                       print '<link rel="stylesheet" type="text/css" href="'.esc_url($stylesheet).'"/>'."\n";
                }
        }
        if (defined $project) {
                        my $type = lc($format);
                        my %link_attr = (
                                '-rel' => 'alternate',
-                               '-title' => "$project - $href_params{'-title'} - $format feed",
+                               '-title' => esc_attr("$project - $href_params{'-title'} - $format feed"),
                                '-type' => "application/$type+xml"
                        );
  
        } else {
                printf('<link rel="alternate" title="%s projects list" '.
                       'href="%s" type="text/plain; charset=utf-8" />'."\n",
-                      $site_name, href(project=>undef, action=>"project_index"));
+                      esc_attr($site_name), href(project=>undef, action=>"project_index"));
                printf('<link rel="alternate" title="%s projects feeds" '.
                       'href="%s" type="text/x-opml" />'."\n",
-                      $site_name, href(project=>undef, action=>"opml"));
+                      esc_attr($site_name), href(project=>undef, action=>"opml"));
        }
        if (defined $favicon) {
-               print qq(<link rel="shortcut icon" href="$favicon" type="image/png" />\n);
+               print qq(<link rel="shortcut icon" href=").esc_url($favicon).qq(" type="image/png" />\n);
        }
  
        print "</head>\n" .
        print "<div class=\"page_header\">\n" .
              $cgi->a({-href => esc_url($logo_url),
                       -title => $logo_label},
-                     qq(<img src="$logo" width="72" height="27" alt="git" class="logo"/>));
+                     qq(<img src=").esc_url($logo).qq(" width="72" height="27" alt="git" class="logo"/>));
        print $cgi->a({-href => esc_url($home_link)}, $home_link_str) . " / ";
        if (defined $project) {
                print $cgi->a({-href => href(action=>"summary")}, esc_html($project));
@@@ -3590,7 -3597,7 +3597,7 @@@ sub git_footer_html 
                insert_file($site_footer);
        }
  
-       print qq!<script type="text/javascript" src="$javascript"></script>\n!;
+       print qq!<script type="text/javascript" src="!.esc_url($javascript).qq!"></script>\n!;
        if (defined $action &&
            $action eq 'blame_incremental') {
                print qq!<script type="text/javascript">\n!.
@@@ -5192,15 -5199,15 +5199,15 @@@ sub git_summary 
  }
  
  sub git_tag {
 -      my $head = git_get_head_hash($project);
 -      git_header_html();
 -      git_print_page_nav('','', $head,undef,$head);
        my %tag = parse_tag($hash);
  
        if (! %tag) {
                die_error(404, "Unknown tag object");
        }
  
 +      my $head = git_get_head_hash($project);
 +      git_header_html();
 +      git_print_page_nav('','', $head,undef,$head);
        git_print_header_div('commit', esc_html($tag{'name'}), $hash);
        print "<div class=\"title_text\">\n" .
              "<table class=\"object_header\">\n" .
@@@ -5610,14 -5617,14 +5617,14 @@@ sub git_blob 
        } else {
                print "<div class=\"page_nav\">\n" .
                      "<br/><br/></div>\n" .
-                     "<div class=\"title\">$hash</div>\n";
+                     "<div class=\"title\">".esc_html($hash)."</div>\n";
        }
        git_print_page_path($file_name, "blob", $hash_base);
        print "<div class=\"page_body\">\n";
        if ($mimetype =~ m!^image/!) {
-               print qq!<img type="$mimetype"!;
+               print qq!<img type="!.esc_attr($mimetype).qq!"!;
                if ($file_name) {
-                       print qq! alt="$file_name" title="$file_name"!;
+                       print qq! alt="!.esc_attr($file_name).qq!" title="!.esc_attr($file_name).qq!"!;
                }
                print qq! src="! .
                      href(action=>"blob_plain", hash=>$hash,
                        $nr++;
                        $line = untabify($line);
                        printf qq!<div class="pre"><a id="l%i" href="%s#l%i" class="linenr">%4i</a> %s</div>\n!,
-                              $nr, href(-replay => 1), $nr, $nr, $syntax ? $line : esc_html($line, -nbsp=>1);
+                              $nr, esc_attr(href(-replay => 1)), $nr, $nr, $syntax ? $line : esc_html($line, -nbsp=>1);
                }
        }
        close $fd
@@@ -5692,7 -5699,7 +5699,7 @@@ sub git_tree 
                undef $hash_base;
                print "<div class=\"page_nav\">\n";
                print "<br/><br/></div>\n";
-               print "<div class=\"title\">$hash</div>\n";
+               print "<div class=\"title\">".esc_html($hash)."</div>\n";
        }
        if (defined $file_name) {
                $basedir = $file_name;
@@@ -6160,7 -6167,7 +6167,7 @@@ sub git_blobdiff 
                        git_print_header_div('commit', esc_html($co{'title'}), $hash_base);
                } else {
                        print "<div class=\"page_nav\"><br/>$formats_nav<br/></div>\n";
-                       print "<div class=\"title\">$hash vs $hash_parent</div>\n";
+                       print "<div class=\"title\">".esc_html("$hash vs $hash_parent")."</div>\n";
                }
                if (defined $file_name) {
                        git_print_page_path($file_name, "blob", $hash_base);