Update to git-1.6.3.3

- Move contributed hooks to %{_datadir}/git-core/contrib/hooks (bug 500137)
This commit is contained in:
Todd Zullinger 2009-06-28 23:26:09 +00:00
parent 87ceff4e35
commit 762cf1156b
5 changed files with 75 additions and 111 deletions

View File

@ -1 +1 @@
git-1.6.3.2.tar.bz2
git-1.6.3.3.tar.bz2

View File

@ -0,0 +1,43 @@
From 1963c852acc5d8c521a3e4f3b9ceb313d26a473c Mon Sep 17 00:00:00 2001
From: Todd Zullinger <tmz@pobox.com>
Date: Mon, 22 Jun 2009 08:00:29 -0400
Subject: [PATCH] Update path to contrib/hooks/post-receive-email
---
contrib/hooks/post-receive-email | 6 +++---
templates/hooks--post-receive.sample | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
index 2a66063..4835ada 100755
--- a/contrib/hooks/post-receive-email
+++ b/contrib/hooks/post-receive-email
@@ -10,12 +10,12 @@
# This hook is stored in the contrib/hooks directory. Your distribution
# will have put this somewhere standard. You should make this script
# executable then link to it in the repository you would like to use it in.
-# For example, on debian the hook is stored in
-# /usr/share/doc/git-core/contrib/hooks/post-receive-email:
+# For example, on fedora the hook is stored in
+# /usr/share/git-core/contrib/hooks/post-receive-email:
#
# chmod a+x post-receive-email
# cd /path/to/your/repository.git
-# ln -sf /usr/share/doc/git-core/contrib/hooks/post-receive-email hooks/post-receive
+# ln -sf /usr/share/git-core/contrib/hooks/post-receive-email hooks/post-receive
#
# This hook script assumes it is enabled on the central repository of a
# project, with all users pushing only to it and not between each other. It
diff --git a/templates/hooks--post-receive.sample b/templates/hooks--post-receive.sample
index 18d2e0f..cf57878 100755
--- a/templates/hooks--post-receive.sample
+++ b/templates/hooks--post-receive.sample
@@ -12,4 +12,4 @@
# see contrib/hooks/ for an sample, or uncomment the next line and
# rename the file to "post-receive".
-#. /usr/share/doc/git-core/contrib/hooks/post-receive-email
+#. /usr/share/git-core/contrib/hooks/post-receive-email
--
1.6.3.2

View File

@ -1,104 +0,0 @@
From 73bb33a94ec67a53e7d805b12ad9264fa25f4f8d Mon Sep 17 00:00:00 2001
From: Shawn O. Pearce <spearce@spearce.org>
Date: Thu, 4 Jun 2009 18:33:32 -0700
Subject: [PATCH] daemon: Strictly parse the "extra arg" part of the command
Since 1.4.4.5 (49ba83fb67 "Add virtualization support to git-daemon")
git daemon enters an infinite loop and never terminates if a client
hides any extra arguments in the initial request line which is not
exactly "\0host=blah\0".
Since that change, a client must never insert additional extra
arguments, or attempt to use any argument other than "host=", as
any daemon will get stuck parsing the request line and will never
complete the request.
Since the client can't tell if the daemon is patched or not, it
is not possible to know if additional extra args might actually be
able to be safely requested.
If we ever need to extend the git daemon protocol to support a new
feature, we may have to do something like this to the exchange:
# If both support git:// v2
#
C: 000cgit://v2
S: 0010ok host user
C: 0018host git.kernel.org
C: 0027git-upload-pack /pub/linux-2.6.git
S: ...git-upload-pack header...
# If client supports git:// v2, server does not:
#
C: 000cgit://v2
S: <EOF>
C: 003bgit-upload-pack /pub/linux-2.6.git\0host=git.kernel.org\0
S: ...git-upload-pack header...
This requires the client to create two TCP connections to talk to
an older git daemon, however all daemons since the introduction of
daemon.c will safely reject the unknown "git://v2" command request,
so the client can quite easily determine the server supports an
older protocol.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff --git a/connect.c b/connect.c
index f6b8ba6..958c831 100644
--- a/connect.c
+++ b/connect.c
@@ -579,7 +579,10 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
git_tcp_connect(fd, host, flags);
/*
* Separate original protocol components prog and path
- * from extended components with a NUL byte.
+ * from extended host header with a NUL byte.
+ *
+ * Note: Do not add any other headers here! Doing so
+ * will cause older git-daemon servers to crash.
*/
packet_write(fd[1],
"%s %s%chost=%s%c",
diff --git a/daemon.c b/daemon.c
index daa4c8e..b2babcc 100644
--- a/daemon.c
+++ b/daemon.c
@@ -406,15 +406,15 @@ static char *xstrdup_tolower(const char *str)
}
/*
- * Separate the "extra args" information as supplied by the client connection.
+ * Read the host as supplied by the client connection.
*/
-static void parse_extra_args(char *extra_args, int buflen)
+static void parse_host_arg(char *extra_args, int buflen)
{
char *val;
int vallen;
char *end = extra_args + buflen;
- while (extra_args < end && *extra_args) {
+ if (extra_args < end && *extra_args) {
saw_extended_args = 1;
if (strncasecmp("host=", extra_args, 5) == 0) {
val = extra_args + 5;
@@ -436,6 +436,8 @@ static void parse_extra_args(char *extra_args, int buflen)
/* On to the next one */
extra_args = val + vallen;
}
+ if (extra_args < end && *extra_args)
+ die("Invalid request");
}
/*
@@ -545,7 +547,7 @@ static int execute(struct sockaddr *addr)
hostname = canon_hostname = ip_address = tcp_port = NULL;
if (len != pktlen)
- parse_extra_args(line + len + 1, pktlen - len - 1);
+ parse_host_arg(line + len + 1, pktlen - len - 1);
for (i = 0; i < ARRAY_SIZE(daemon_service); i++) {
struct daemon_service *s = &(daemon_service[i]);

View File

@ -1,8 +1,8 @@
# Pass --without docs to rpmbuild if you don't want the documentation
Name: git
Version: 1.6.3.2
Release: 3%{?dist}
Summary: Core git tools
Version: 1.6.3.3
Release: 1%{?dist}
Summary: Fast Version Control System
License: GPLv2
Group: Development/Tools
URL: http://git-scm.com/
@ -14,8 +14,8 @@ Source4: git-gui.desktop
Patch0: git-1.5-gitweb-home-link.patch
# https://bugzilla.redhat.com/490602
Patch1: git-cvsimport-Ignore-cvsps-2.2b1-Branches-output.patch
# http://git.kernel.org/?p=git/git.git;a=commitdiff;h=73bb33a9
Patch2: git-1.6.3.2-daemon-extra-args.patch
# https://bugzilla.redhat.com/500137
Patch2: git-1.6-update-contrib-hooks-path.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: desktop-file-utils
@ -203,6 +203,17 @@ make %{_smp_mflags} V=1 CFLAGS="$RPM_OPT_FLAGS" \\\
htmldir=%{_docdir}/%{name}-%{version} \\\
prefix=%{_prefix}
# Filter bogus perl requires
# packed-refs comes from a comment in contrib/hooks/update-paranoid
cat << \EOF > %{name}-req
#!/bin/sh
%{__perl_requires} $* |\
sed -e '/perl(packed-refs)/d'
EOF
%global __perl_requires %{_builddir}/%{name}-%{version}/%{name}-req
chmod +x %{__perl_requires}
%build
%{make_git} all %{!?_without_docs: doc}
@ -257,6 +268,14 @@ install -pm 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/git
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
install -pm 644 -T contrib/completion/git-completion.bash $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/git
# Move contrib/hooks out of %%docdir and make them executable
mkdir -p $RPM_BUILD_ROOT%{_datadir}/git-core/contrib
mv contrib/hooks $RPM_BUILD_ROOT%{_datadir}/git-core/contrib
chmod +x $RPM_BUILD_ROOT%{_datadir}/git-core/contrib/hooks/*
pushd contrib > /dev/null
ln -s ../../../git-core/contrib/hooks
popd > /dev/null
# install git-gui .desktop file
desktop-file-install \
%if 0%{?rhel} && 0%{?rhel} <= 5
@ -266,6 +285,7 @@ desktop-file-install \
# quiet some rpmlint complaints
chmod g-w $RPM_BUILD_ROOT%{_libexecdir}/git-core/*
chmod a-x $RPM_BUILD_ROOT%{_libexecdir}/git-core/git-mergetool--lib
rm -f {Documentation/technical,contrib/emacs}/.gitignore
chmod a-x Documentation/technical/api-index.sh
find contrib -type f -perm /a+x | xargs chmod -x
@ -366,6 +386,11 @@ rm -rf $RPM_BUILD_ROOT
# No files for you!
%changelog
* Sun Jun 28 2009 Todd Zullinger <tmz@pobox.com> - 1.6.3.3-1
- git-1.6.3.3
- Move contributed hooks to %%{_datadir}/git-core/contrib/hooks (bug 500137)
- Fix rpmlint warnings about Summary and git-mergetool--lib missing shebang
* Fri Jun 19 2009 Todd Zullinger <tmz@pobox.com> - 1.6.3.2-3
- Temporarily disable asciidoc's safe mode until bug 506953 is fixed

View File

@ -1 +1 @@
149948ff33fb7d8cf9eef925e6c08157 git-1.6.3.2.tar.bz2
91ae46ac01dadab1962beb064abd5b60 git-1.6.3.3.tar.bz2