Update git to v2.10.2

* Fixes #735
* Import *sh completion and XSS patches from openSUSE
This commit is contained in:
Yury Buldakov
2016-11-05 13:15:20 +02:00
parent f65195ba99
commit cf4ac8a7bf
8 changed files with 232 additions and 58 deletions

View File

@@ -2,7 +2,7 @@
# Maintainer: Ray Donnelly <mingw.android@gmail.com>
pkgname=git
pkgver=2.10.1
pkgver=2.10.2
pkgrel=1
pkgdesc="The fast distributed version control system"
arch=('i686' 'x86_64')
@@ -49,13 +49,25 @@ source=("${pkgname}-${pkgver}.tar.gz"::https://github.com/git/git/archive/v${pkg
git-1.9.0-manifest-msys2.patch
git-1.8.4-msys2.patch
git-2.3.5-mingw-pwd.patch
git-2.8.2-Cygwin-Allow-DOS-paths.patch)
sha256sums=('b37b8f364f4b1cd8b82feee53d7ebf129e588901d21e3feaabaae9e51facb3ad'
git-2.8.2-Cygwin-Allow-DOS-paths.patch
git-prevent_xss-default.patch
git-bash-completion-egrep-color-fix.patch
git-tcsh-completion-fixes.patch
git-zsh-completion-fixes.patch
git-tclIndex.patch
git-setup-i18n-fix.patch)
sha256sums=('5e0e5034d39a6cfd768726ec87ec6ed0c724a4d28d2ad2b426227335ba3adff0'
'c5e735d829e11f79e2d508b663d0924030498f48fc716881031fb975dbf187a5'
'3c0ed027540a537617590dc2c09d449bb137badd5ee44893e65e450d95dc765d'
'c57837c3e169e5c2a9f8411d6870443efe145c95490fc03f82e8089292507f76'
'a82df3fc9a80b9f9003a9b9feca063413b14630c043c0b2b88bf2c61c46154cc'
'f67412f829e026b677d4c3ceacfb21da0549ad4636fb07c283e52c3fd5aa3e22'
'fb0e003f686a6d7c676d40144d16d4ba4ff38f28f7928e4401d95f198029f35e')
'fb0e003f686a6d7c676d40144d16d4ba4ff38f28f7928e4401d95f198029f35e'
'bbe523015863a4b2459624dcc4ad5c675c779c1134c8617f90d65a541b74e194'
'bc6ef4a066a8b206fbc162387918f801ef95c7a691fdaf284f895bc303a1ee01'
'b28b3e13de08911f027d19a557967fc21128318a8d6ca74b20b26ee997a9b992'
'261438a4bedd5563c702533c34792581ccfa46db873ca3e105e6c1ab803a3107'
'9543aeb4194f1996744884784dbd39e7d2ad713df0e0629899ef581469c3cace'
'94fc6958962fffd0f857ed1c312ede7ce65ab267005d2a1db38d9a2830d341cd')
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
@@ -66,6 +78,13 @@ prepare() {
patch -p1 -i "${srcdir}"/git-1.9.0-manifest-msys2.patch
patch -p2 -i "${srcdir}"/git-2.3.5-mingw-pwd.patch
patch -p1 -i "${srcdir}"/git-2.8.2-Cygwin-Allow-DOS-paths.patch
patch -p1 -i "${srcdir}"/git-prevent_xss-default.patch
patch -p1 -i "${srcdir}"/git-bash-completion-egrep-color-fix.patch
patch -p1 -i "${srcdir}"/git-tcsh-completion-fixes.patch
patch -p1 -i "${srcdir}"/git-zsh-completion-fixes.patch
patch -p1 -i "${srcdir}"/git-tclIndex.patch
patch -p1 -i "${srcdir}"/git-setup-i18n-fix.patch
local _arch=
if [ "${CARCH}" == 'x86_64' ]; then

View File

@@ -40,58 +40,27 @@ References:
Signed-off-by: Cesar Eduardo Barros <ces...@cesarb.net>
---
Makefile | 29 +++++++++++++++++++++--------
compat/win32/git.manifest | 11 +++++++++++
compat/win32/resource.rc | 1 +
3 files changed, 33 insertions(+), 8 deletions(-)
Makefile | 31 ++++++++++++++++++++++---------
compat/win32/git.manifest | 11 +++++++++++
compat/win32/resource.rc | 1 +
config.mak.uname | 4 ++++
4 files changed, 38 insertions(+), 9 deletions(-)
create mode 100644 compat/win32/git.manifest
create mode 100644 compat/win32/resource.rc
--- git-1.8.4/config.mak.uname.orig 2013-08-24 08:15:28.412809200 +0000
+++ git-1.8.4/config.mak.uname 2013-08-24 08:16:47.558359400 +0000
@@ -171,6 +171,7 @@
NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
X = .exe
+ APPLICATION_MANIFEST = YesPlease
UNRELIABLE_FSTAT = UnfortunatelyYes
SPARSE_FLAGS = -isystem /usr/include/w32api -Wno-one-bit-signed-bitfield
endif
@@ -196,6 +196,7 @@
NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
X = .exe
+ APPLICATION_MANIFEST = YesPlease
UNRELIABLE_FSTAT = UnfortunatelyYes
SPARSE_FLAGS = -isystem /usr/include/w32api -Wno-one-bit-signed-bitfield
endif
@@ -346,6 +347,7 @@
NO_INET_PTON = YesPlease
NO_INET_NTOP = YesPlease
NO_POSIX_GOODIES = UnfortunatelyYes
+ APPLICATION_MANIFEST = YesPlease
NATIVE_CRLF = YesPlease
DEFAULT_HELP_FORMAT = html
@@ -499,6 +501,7 @@
NO_INET_PTON = YesPlease
NO_INET_NTOP = YesPlease
NO_POSIX_GOODIES = UnfortunatelyYes
+ APPLICATION_MANIFEST = YesPlease
DEFAULT_HELP_FORMAT = html
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/win32
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
--- git-1.8.3.3/Makefile.orig 2013-07-15 20:59:21.000000000 +0000
+++ git-1.8.3.3/Makefile 2013-07-27 03:30:24.456888600 +0000
@@ -415,6 +415,7 @@
PTHREAD_LIBS = -lpthread
diff --git a/Makefile b/Makefile
index ddd1bdf..6ee4500 100644
--- a/Makefile
+++ b/Makefile
@@ -463,6 +463,7 @@ PTHREAD_LIBS = -lpthread
PTHREAD_CFLAGS =
GCOV = gcov
SPATCH = spatch
+WINDRES = windres
export TCL_PATH TCLTK_PATH
@@ -435,6 +436,7 @@
@@ -483,6 +484,7 @@ BUILTIN_OBJS =
BUILT_INS =
COMPAT_CFLAGS =
COMPAT_OBJS =
@@ -99,8 +68,8 @@ Signed-off-by: Cesar Eduardo Barros <ces...@cesarb.net>
XDIFF_OBJS =
VCSSVN_OBJS =
GENERATED_H =
@@ -1476,6 +1478,11 @@
COMPAT_OBJS += compat/nedmalloc/nedmalloc.o
@@ -1473,6 +1475,11 @@ ifdef OVERRIDE_STRDUP
COMPAT_OBJS += compat/strdup.o
endif
+ifdef APPLICATION_MANIFEST
@@ -111,15 +80,15 @@ Signed-off-by: Cesar Eduardo Barros <ces...@cesarb.net>
ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT
export GIT_TEST_CMP_USE_COPIED_CONTEXT
endif
@@ -1525,6 +1532,7 @@
@@ -1546,6 +1553,7 @@ ifndef V
QUIET_XGETTEXT = @echo ' ' XGETTEXT $@;
QUIET_MSGFMT = @echo ' ' MSGFMT $@;
QUIET_GCOV = @echo ' ' GCOV $@;
+ QUIET_WINDRES = @echo ' ' RC $@;
QUIET_SP = @echo ' ' SP $<;
QUIET_RC = @echo ' ' RC $@;
QUIET_SUBDIR0 = +@subdir=
QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
@@ -1709,9 +1717,9 @@
@@ -1754,9 +1762,9 @@ git.sp git.s git.o: EXTRA_CPPFLAGS = \
'-DGIT_MAN_PATH="$(mandir_relative_SQ)"' \
'-DGIT_INFO_PATH="$(infodir_relative_SQ)"'
@@ -131,7 +100,7 @@ Signed-off-by: Cesar Eduardo Barros <ces...@cesarb.net>
help.sp help.s help.o: common-cmds.h
@@ -2029,21 +2037,21 @@
@@ -2046,21 +2054,21 @@ compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
compat/nedmalloc/nedmalloc.sp: SPARSE_FLAGS += -Wno-non-pointer-null
endif
@@ -158,7 +127,7 @@ Signed-off-by: Cesar Eduardo Barros <ces...@cesarb.net>
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) \
$(VCSSVN_LIB)
@@ -2053,10 +2061,15 @@
@@ -2070,10 +2078,15 @@ $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)
ln -s $< $@ 2>/dev/null || \
cp $< $@
@@ -175,7 +144,7 @@ Signed-off-by: Cesar Eduardo Barros <ces...@cesarb.net>
$(LIB_FILE): $(LIB_OBJS)
$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
@@ -2260,7 +2273,7 @@
@@ -2284,7 +2297,7 @@ t/helper/test-svn-fe$X: $(VCSSVN_LIB)
.PRECIOUS: $(TEST_OBJS)
@@ -186,7 +155,7 @@ Signed-off-by: Cesar Eduardo Barros <ces...@cesarb.net>
check-sha1:: t/helper/test-sha1$X
diff --git a/compat/win32/git.manifest b/compat/win32/git.manifest
new file mode 100644
index 0000000..a82605c
index 0000000..325e3bb
--- /dev/null
+++ b/compat/win32/git.manifest
@@ -0,0 +1,11 @@
@@ -208,5 +177,35 @@ index 0000000..c2bf4a6
+++ b/compat/win32/resource.rc
@@ -0,0 +1 @@
+1 24 "git.manifest"
diff --git a/config.mak.uname b/config.mak.uname
index f20d4ce..fcc651f 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -213,6 +213,8 @@ ifeq ($(uname_O),Msys)
NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
X = .exe
+ APPLICATION_MANIFEST = YesPlease
+ APPLICATION_MANIFEST = YesPlease
UNRELIABLE_FSTAT = UnfortunatelyYes
SPARSE_FLAGS = -isystem /usr/include/w32api -Wno-one-bit-signed-bitfield
endif
@@ -398,6 +400,7 @@ ifeq ($(uname_S),Windows)
NO_INET_PTON = YesPlease
NO_INET_NTOP = YesPlease
NO_POSIX_GOODIES = UnfortunatelyYes
+ APPLICATION_MANIFEST = YesPlease
NATIVE_CRLF = YesPlease
DEFAULT_HELP_FORMAT = html
@@ -548,6 +551,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NO_INET_PTON = YesPlease
NO_INET_NTOP = YesPlease
NO_POSIX_GOODIES = UnfortunatelyYes
+ APPLICATION_MANIFEST = YesPlease
DEFAULT_HELP_FORMAT = html
COMPAT_CFLAGS += -DNOGDI -Icompat -Icompat/win32
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
--
1.7.4.4
2.10.1

View File

@@ -0,0 +1,15 @@
---
contrib/completion/git-completion.bash | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -536,7 +536,7 @@ __git_commands () {
then
printf "%s" "${GIT_TESTING_COMMAND_COMPLETION}"
else
- git help -a|egrep '^ [a-zA-Z0-9]'
+ git help -a|egrep --color=never '^ [a-zA-Z0-9]'
fi
}

View File

@@ -0,0 +1,38 @@
From: Jakub Narebski <jnareb@...il.com>
Subject: [PATCH] gitweb: Enable $prevent_xss by default
This fixes issue CVE-2011-2186 originally reported in
https://launchpad.net/bugs/777804
Reported-by: dave b <db.pub.mail@...il.com>
Signed-off-by: Jakub Narebski <jnareb@...il.com>
---
git-instaweb.sh | 4 ++++
gitweb/README | 5 +++--
gitweb/gitweb.perl | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -583,6 +583,10 @@
our \$git_temp = "$fqgitdir/gitweb/tmp";
our \$projects_list = \$projectroot;
+# we can trust our own repository, so disable XSS prevention
+# to enable some extra features
+our \$prevent_xss = 0;
+
\$feature{'remote_heads'}{'default'} = [1];
EOF
}
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -170,7 +170,7 @@
# Disables features that would allow repository owners to inject script into
# the gitweb domain.
-our $prevent_xss = 0;
+our $prevent_xss = 1;
# Path to the highlight executable to use (must be the one from
# http://www.andre-simon.de due to assumptions about parameters and output).

View File

@@ -0,0 +1,13 @@
Index: git-2.10.0/git-sh-setup.sh
===================================================================
--- git-2.10.0.orig/git-sh-setup.sh 2016-09-03 03:59:09.000000000 +0200
+++ git-2.10.0/git-sh-setup.sh 2016-09-07 17:24:58.817642893 +0200
@@ -3,7 +3,7 @@
# a few helper shell functions.
# Source git-sh-i18n for gettext support.
-. git-sh-i18n
+. "$(git --exec-path)/git-sh-i18n"
# Having this variable in your environment would break scripts because
# you would cause "cd" to be taken to unexpected places. If you

19
git/git-tclIndex.patch Normal file
View File

@@ -0,0 +1,19 @@
ALL_LIBFILES uses wildcard, which provides the result in directory
order. This order depends on the underlying filesystem on the
buildhost. To get reproducible builds it is required to sort such list
before using them.
---
git-gui/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/git-gui/Makefile
+++ b/git-gui/Makefile
@@ -259,7 +259,7 @@ lib/tclIndex: $(ALL_LIBFILES) GIT-GUI-VA
rm -f $@ ; \
echo '# Autogenerated by git-gui Makefile' >$@ && \
echo >>$@ && \
- $(foreach p,$(PRELOAD_FILES) $(ALL_LIBFILES),echo '$(subst lib/,,$p)' >>$@ &&) \
+ $(foreach p,$(PRELOAD_FILES) $(sort $(ALL_LIBFILES)),echo '$(subst lib/,,$p)' >>$@ &&) \
echo >>$@ ; \
fi

View File

@@ -0,0 +1,57 @@
---
contrib/completion/git-completion.tcsh | 17 +++++++----------
contrib/completion/git.csh | 4 ++++
contrib/completion/git.tcsh | 4 ++++
3 files changed, 15 insertions(+), 10 deletions(-)
Index: git-2.4.6/contrib/completion/git-completion.tcsh
===================================================================
--- git-2.4.6.orig/contrib/completion/git-completion.tcsh
+++ git-2.4.6/contrib/completion/git-completion.tcsh
@@ -32,14 +32,14 @@ if ( ${__git_tcsh_completion_version[1]}
endif
unset __git_tcsh_completion_version
-set __git_tcsh_completion_original_script = ${HOME}/.git-completion.bash
-set __git_tcsh_completion_script = ${HOME}/.git-completion.tcsh.bash
+set __git_tcsh_completion_original_script = /etc/bash_completion.d/git.sh
+set __git_tcsh_completion_script = $RPM_BUILD_ROOT/usr/share/tcsh/git.complete
-# Check that the user put the script in the right place
-if ( ! -e ${__git_tcsh_completion_original_script} ) then
- echo "git-completion.tcsh: Cannot find: ${__git_tcsh_completion_original_script}. Git completion will not work."
- exit
-endif
+# # Check that the user put the script in the right place
+# if ( ! -e ${__git_tcsh_completion_original_script} ) then
+# echo "git-completion.tcsh: Cannot find: ${__git_tcsh_completion_original_script}. Git completion will not work."
+# exit
+# endif
cat << EOF >! ${__git_tcsh_completion_script}
#!bash
@@ -121,6 +121,3 @@ EOF
# Don't need this variable anymore, so don't pollute the users environment
unset __git_tcsh_completion_original_script
-
-complete git 'p,*,`bash ${__git_tcsh_completion_script} git "${COMMAND_LINE}"`,'
-complete gitk 'p,*,`bash ${__git_tcsh_completion_script} gitk "${COMMAND_LINE}"`,'
Index: git-2.4.6/contrib/completion/git.csh
===================================================================
--- /dev/null
+++ git-2.4.6/contrib/completion/git.csh
@@ -0,0 +1,4 @@
+if (${?prompt}) then
+complete git 'p,*,`bash /usr/share/tcsh/git.complete git "${COMMAND_LINE}"`,'
+complete gitk 'p,*,`bash /usr/share/tcsh/git.complete gitk "${COMMAND_LINE}"`,'
+endif
Index: git-2.4.6/contrib/completion/git.tcsh
===================================================================
--- /dev/null
+++ git-2.4.6/contrib/completion/git.tcsh
@@ -0,0 +1,4 @@
+if (${?prompt}) then
+complete git 'p,*,`bash /usr/share/tcsh/git.complete git "${COMMAND_LINE}"`,'
+complete gitk 'p,*,`bash /usr/share/tcsh/git.complete gitk "${COMMAND_LINE}"`,'
+endif

View File

@@ -0,0 +1,14 @@
---
contrib/completion/git-completion.zsh | 1 +
1 file changed, 1 insertion(+)
--- a/contrib/completion/git-completion.zsh
+++ b/contrib/completion/git-completion.zsh
@@ -31,6 +31,7 @@ if [ -z "$script" ]; then
local e
locations=(
$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
+ '/etc/bash_completion.d/git.sh' # suse
'/etc/bash_completion.d/git' # fedora, old debian
'/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian
'/usr/share/bash-completion/git' # gentoo