Compare commits

...

No commits in common. "imports/c8s/git-2.27.0-1.el8" and "c8" have entirely different histories.

11 changed files with 875 additions and 64 deletions

View File

@ -1,2 +1,2 @@
996c0be58e901deb4ef9d0145e7bf98cdf6a0fb3 SOURCES/git-2.27.0.tar.xz 7577a22e233e892dba5cf19a3a57cef2062d01e6 SOURCES/git-2.43.5.tar.sign
097b8da13939ac9f51f97a5659184c1d96fb0973 SOURCES/gpgkey-junio.asc 31decef72034ae36c8098a9e6bb13a7dd4859fd9 SOURCES/git-2.43.5.tar.xz

4
.gitignore vendored
View File

@ -1,2 +1,2 @@
SOURCES/git-2.27.0.tar.xz SOURCES/git-2.43.5.tar.sign
SOURCES/gpgkey-junio.asc SOURCES/git-2.43.5.tar.xz

View File

@ -0,0 +1,73 @@
From aedeaaf788bd8a7fc5a1887196b6f6d8a5c31362 Mon Sep 17 00:00:00 2001
From: Todd Zullinger <tmz@pobox.com>
Date: Sun, 21 Aug 2022 13:49:57 -0400
Subject: [PATCH] t/lib-httpd: try harder to find a port for apache
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When running multiple builds concurrently, tests which run daemons, like
apache httpd, sometimes conflict with each other, leading to spurious
failures:
++ /usr/sbin/httpd -d '/tmp/git-t.ck9I/trash directory.t9118-git-svn-funky-branch-names/httpd' \
-f /builddir/build/BUILD/git-2.37.2/t/lib-httpd/apache.conf -DDAV -DSVN -c 'Listen 127.0.0.1:9118' \
-k start
(98)Address already in use: AH00072: make_sock: could not bind to address 127.0.0.1:9118
no listening sockets available, shutting down
AH00015: Unable to open logs
++ test 1 -ne 0
Try a bit harder to find an open port to use to avoid these intermittent
failures. If we fail to start httpd, increment the port number and try
again. By default, we make 3 attempts. This may be overridden by
setting GIT_TEST_START_HTTPD_TRIES to a different value.
Helped-by: Ondřej Pohořelský <opohorel@redhat.com>
Signed-off-by: Todd Zullinger <tmz@pobox.com>
---
t/lib-httpd.sh | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index 1f6b9b08d1..9279dcd659 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -175,19 +175,26 @@ prepare_httpd() {
}
start_httpd() {
- prepare_httpd >&3 2>&4
-
test_atexit stop_httpd
- "$LIB_HTTPD_PATH" -d "$HTTPD_ROOT_PATH" \
- -f "$TEST_PATH/apache.conf" $HTTPD_PARA \
- -c "Listen 127.0.0.1:$LIB_HTTPD_PORT" -k start \
- >&3 2>&4
- if test $? -ne 0
- then
- cat "$HTTPD_ROOT_PATH"/error.log >&4 2>/dev/null
- test_skip_or_die GIT_TEST_HTTPD "web server setup failed"
- fi
+ i=0
+ while test $i -lt ${GIT_TEST_START_HTTPD_TRIES:-3}
+ do
+ i=$(($i + 1))
+ prepare_httpd >&3 2>&4
+ say >&3 "Starting httpd on port $LIB_HTTPD_PORT"
+ "$LIB_HTTPD_PATH" -d "$HTTPD_ROOT_PATH" \
+ -f "$TEST_PATH/apache.conf" $HTTPD_PARA \
+ -c "Listen 127.0.0.1:$LIB_HTTPD_PORT" -k start \
+ >&3 2>&4
+ test $? -eq 0 && return
+ LIB_HTTPD_PORT=$(($LIB_HTTPD_PORT + 1))
+ export LIB_HTTPD_PORT
+ # clean up modules symlink, prepare_httpd will re-create it
+ rm -f "$HTTPD_ROOT_PATH/modules"
+ done
+ cat "$HTTPD_ROOT_PATH"/error.log >&4 2>/dev/null
+ test_skip_or_die GIT_TEST_HTTPD "web server setup failed"
}
stop_httpd() {

View File

@ -0,0 +1,88 @@
From 16750d024ce038b019ab2e9ee5639901e445af37 Mon Sep 17 00:00:00 2001
From: Todd Zullinger <tmz@pobox.com>
Date: Fri, 26 Aug 2022 18:28:44 -0400
Subject: [PATCH] t/lib-git-daemon: try harder to find a port
As with the previous commit, try harder to find an open port to avoid
intermittent failures on busy/shared build systems.
By default, we make 3 attempts. This may be overridden by setting
GIT_TEST_START_GIT_DAEMON_TRIES to a different value.
Signed-off-by: Todd Zullinger <tmz@pobox.com>
---
t/lib-git-daemon.sh | 60 ++++++++++++++++++++++++++++-----------------
1 file changed, 37 insertions(+), 23 deletions(-)
diff --git a/t/lib-git-daemon.sh b/t/lib-git-daemon.sh
index e62569222b..c3e8dda9ff 100644
--- a/t/lib-git-daemon.sh
+++ b/t/lib-git-daemon.sh
@@ -51,30 +51,44 @@ start_git_daemon() {
registered_stop_git_daemon_atexit_handler=AlreadyDone
fi
- say >&3 "Starting git daemon ..."
- mkfifo git_daemon_output
- ${LIB_GIT_DAEMON_COMMAND:-git daemon} \
- --listen=127.0.0.1 --port="$LIB_GIT_DAEMON_PORT" \
- --reuseaddr --verbose --pid-file="$GIT_DAEMON_PIDFILE" \
- --base-path="$GIT_DAEMON_DOCUMENT_ROOT_PATH" \
- "$@" "$GIT_DAEMON_DOCUMENT_ROOT_PATH" \
- >&3 2>git_daemon_output &
- GIT_DAEMON_PID=$!
- {
- read -r line <&7
- printf "%s\n" "$line" >&4
- cat <&7 >&4 &
- } 7<git_daemon_output &&
+ i=0
+ while test $i -lt ${GIT_TEST_START_GIT_DAEMON_TRIES:-3}
+ do
+ say >&3 "Starting git daemon on port $LIB_GIT_DAEMON_PORT ..."
+ mkfifo git_daemon_output
+ ${LIB_GIT_DAEMON_COMMAND:-git daemon} \
+ --listen=127.0.0.1 --port="$LIB_GIT_DAEMON_PORT" \
+ --reuseaddr --verbose --pid-file="$GIT_DAEMON_PIDFILE" \
+ --base-path="$GIT_DAEMON_DOCUMENT_ROOT_PATH" \
+ "$@" "$GIT_DAEMON_DOCUMENT_ROOT_PATH" \
+ >&3 2>git_daemon_output &
+ GIT_DAEMON_PID=$!
+ {
+ read -r line <&7
+ printf "%s\n" "$line" >&4
+ cat <&7 >&4 &
+ } 7<git_daemon_output &&
- # Check expected output
- if test x"$(expr "$line" : "\[[0-9]*\] \(.*\)")" != x"Ready to rumble"
- then
- kill "$GIT_DAEMON_PID"
- wait "$GIT_DAEMON_PID"
- unset GIT_DAEMON_PID
- test_skip_or_die GIT_TEST_GIT_DAEMON \
- "git daemon failed to start"
- fi
+ # Check expected output
+ output="$(expr "$line" : "\[[0-9]*\] \(.*\)")"
+ # Return if found
+ test x"$output" = x"Ready to rumble" && return
+ # Increment port for retry if not found
+ LIB_GIT_DAEMON_PORT=$(($LIB_GIT_DAEMON_PORT + 1))
+ export LIB_GIT_DAEMON_PORT
+ GIT_DAEMON_HOST_PORT=127.0.0.1:$LIB_GIT_DAEMON_PORT
+ GIT_DAEMON_URL=git://$GIT_DAEMON_HOST_PORT
+ # unset GIT_DAEMON_PID; remove the fifo & pid file
+ GIT_DAEMON_PID=
+ rm -f git_daemon_output "$GIT_DAEMON_PIDFILE"
+ done
+
+ # Clean up and return failure
+ kill "$GIT_DAEMON_PID"
+ wait "$GIT_DAEMON_PID"
+ unset GIT_DAEMON_PID
+ test_skip_or_die GIT_TEST_GIT_DAEMON \
+ "git daemon failed to start"
}
stop_git_daemon() {

View File

@ -0,0 +1,85 @@
From aa5105dc115b43edc6c9c11714b092583f1221aa Mon Sep 17 00:00:00 2001
From: Todd Zullinger <tmz@pobox.com>
Date: Fri, 26 Aug 2022 18:28:44 -0400
Subject: [PATCH] t/lib-git-svn: try harder to find a port
As with the previous commits, try harder to find an open port to avoid
intermittent failures on busy/shared build systems.
By default, we make 3 attempts. This may be overridden by setting
GIT_TEST_START_SVNSERVE_TRIES to a different value.
Run svnserve in daemon mode and use 'test_atexit' to stop it. This is
cleaner than running in the foreground with --listen-once and having to
manage the PID ourselves.
Signed-off-by: Todd Zullinger <tmz@pobox.com>
---
t/lib-git-svn.sh | 34 +++++++++++++++++++++++++----
t/t9113-git-svn-dcommit-new-file.sh | 1 -
2 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh
index ea28971e8e..04e660e2ba 100644
--- a/t/lib-git-svn.sh
+++ b/t/lib-git-svn.sh
@@ -17,6 +17,7 @@ fi
GIT_DIR=$PWD/.git
GIT_SVN_DIR=$GIT_DIR/svn/refs/remotes/git-svn
SVN_TREE=$GIT_SVN_DIR/svn-tree
+SVNSERVE_PIDFILE="$PWD"/daemon.pid
test_set_port SVNSERVE_PORT
svn >/dev/null 2>&1
@@ -119,10 +120,35 @@ require_svnserve () {
}
start_svnserve () {
- svnserve --listen-port $SVNSERVE_PORT \
- --root "$rawsvnrepo" \
- --listen-once \
- --listen-host 127.0.0.1 &
+ test_atexit stop_svnserve
+
+ i=0
+ while test $i -lt ${GIT_TEST_START_SVNSERVE_TRIES:-3}
+ do
+ say >&3 "Starting svnserve on port $SVNSERVE_PORT ..."
+ svnserve --listen-port $SVNSERVE_PORT \
+ --root "$rawsvnrepo" \
+ --daemon --pid-file="$SVNSERVE_PIDFILE" \
+ --listen-host 127.0.0.1
+ ret=$?
+ # increment port and retry if unsuccessful
+ if test $ret -ne 0
+ then
+ SVNSERVE_PORT=$(($SVNSERVE_PORT + 1))
+ export SVNSERVE_PORT
+ else
+ break
+ fi
+ done
+}
+
+stop_svnserve () {
+ say >&3 "Stopping svnserve ..."
+ SVNSERVE_PID="$(cat "$SVNSERVE_PIDFILE")"
+ if test -n "$SVNSERVE_PID"
+ then
+ kill "$SVNSERVE_PID" 2>/dev/null
+ fi
}
prepare_utf8_locale () {
diff --git a/t/t9113-git-svn-dcommit-new-file.sh b/t/t9113-git-svn-dcommit-new-file.sh
index e8479cec7a..5925891f5d 100755
--- a/t/t9113-git-svn-dcommit-new-file.sh
+++ b/t/t9113-git-svn-dcommit-new-file.sh
@@ -28,7 +28,6 @@ test_expect_success 'create files in new directory with dcommit' "
echo hello > git-new-dir/world &&
git update-index --add git-new-dir/world &&
git commit -m hello &&
- start_svnserve &&
git svn dcommit
"

Binary file not shown.

View File

@ -1,16 +1,16 @@
diff -ur a/builtin/receive-pack.c b/builtin/receive-pack.c diff -ur b/builtin/receive-pack.c a/builtin/receive-pack.c
--- a/builtin/receive-pack.c 2020-06-01 17:49:27.000000000 +0200 --- b/builtin/receive-pack.c 2023-11-20 03:07:41.000000000 +0100
+++ b/builtin/receive-pack.c 2020-06-15 15:28:48.149268576 +0200 +++ a/builtin/receive-pack.c 2023-12-06 15:34:28.294170714 +0100
@@ -29,6 +29,8 @@ @@ -40,6 +40,8 @@
#include "commit-reach.h"
#include "worktree.h" #include "worktree.h"
#include "shallow.h" #include "shallow.h"
#include "parse-options.h"
+#include <openssl/hmac.h> +#include <openssl/hmac.h>
+#include <openssl/evp.h> +#include <openssl/evp.h>
static const char * const receive_pack_usage[] = { static const char * const receive_pack_usage[] = {
N_("git receive-pack <git-dir>"), N_("git receive-pack <git-dir>"),
@@ -419,43 +421,11 @@ @@ -538,43 +540,11 @@
return 0; return 0;
} }
@ -56,11 +56,11 @@ diff -ur a/builtin/receive-pack.c b/builtin/receive-pack.c
} }
static char *prepare_push_cert_nonce(const char *path, timestamp_t stamp) static char *prepare_push_cert_nonce(const char *path, timestamp_t stamp)
diff -ur a/Makefile b/Makefile diff -ur b/Makefile a/Makefile
--- a/Makefile 2020-06-01 17:49:27.000000000 +0200 --- b/Makefile 2023-11-20 03:07:41.000000000 +0100
+++ b/Makefile 2020-06-15 15:00:45.212758547 +0200 +++ a/Makefile 2023-12-06 15:35:08.506316431 +0100
@@ -1830,6 +1830,8 @@ @@ -2123,6 +2123,8 @@
BASIC_CFLAGS += -DHAVE_GETDELIM EXTLIBS += -lcrypto -lssl
endif endif
+EXTLIBS += -lcrypto +EXTLIBS += -lcrypto

View File

@ -0,0 +1,115 @@
From 51441e6460b505c07b4a8a6deeaa7de4bf6e8e33 Mon Sep 17 00:00:00 2001
From: Junio C Hamano <gitster@pobox.com>
Date: Fri, 3 May 2024 08:34:27 -0700
Subject: [PATCH] stop using HEAD for attributes in bare repository by default
With 23865355 (attr: read attributes from HEAD when bare repo,
2023-10-13), we started to use the HEAD tree as the default
attribute source in a bare repository. One argument for such a
behaviour is that it would make things like "git archive" run in
bare and non-bare repositories for the same commit consistent.
This changes was merged to Git 2.43 but without an explicit mention
in its release notes.
It turns out that this change destroys performance of shallowly
cloning from a bare repository. As the "server" installations are
expected to be mostly bare, and "git pack-objects", which is the
core of driving the other side of "git clone" and "git fetch" wants
to see if a path is set not to delta with blobs from other paths via
the attribute system, the change forces the server side to traverse
the tree of the HEAD commit needlessly to find if each and every
paths the objects it sends out has the attribute that controls the
deltification. Given that (1) most projects do not configure such
an attribute, and (2) it is dubious for the server side to honor
such an end-user supplied attribute anyway, this was a poor choice
of the default.
To mitigate the current situation, let's revert the change that uses
the tree of HEAD in a bare repository by default as the attribute
source. This will help most people who have been happy with the
behaviour of Git 2.42 and before.
Two things to note:
* If you are stuck with versions of Git 2.43 or newer, that is
older than the release this fix appears in, you can explicitly
set the attr.tree configuration variable to point at an empty
tree object, i.e.
$ git config attr.tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
* If you like the behaviour we are reverting, you can explicitly
set the attr.tree configuration variable to HEAD, i.e.
$ git config attr.tree HEAD
The right fix for this is to optimize the code paths that allow
accesses to attributes in tree objects, but that is a much more
involved change and is left as a longer-term project, outside the
scope of this "first step" fix.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
attr.c | 7 -------
t/t0003-attributes.sh | 10 ++++++++--
t/t5001-archive-attr.sh | 3 ++-
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/attr.c b/attr.c
index e62876dfd3e9be..02ab8436266289 100644
--- a/attr.c
+++ b/attr.c
@@ -1213,13 +1213,6 @@ static void compute_default_attr_source(struct object_id *attr_source)
ignore_bad_attr_tree = 1;
}
- if (!default_attr_source_tree_object_name &&
- startup_info->have_repository &&
- is_bare_repository()) {
- default_attr_source_tree_object_name = "HEAD";
- ignore_bad_attr_tree = 1;
- }
-
if (!default_attr_source_tree_object_name || !is_null_oid(attr_source))
return;
diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh
index aee2298f01331a..5de46ddf67f7ff 100755
--- a/t/t0003-attributes.sh
+++ b/t/t0003-attributes.sh
@@ -384,13 +384,19 @@ test_expect_success 'bad attr source defaults to reading .gitattributes file' '
)
'
-test_expect_success 'bare repo defaults to reading .gitattributes from HEAD' '
+test_expect_success 'bare repo no longer defaults to reading .gitattributes from HEAD' '
test_when_finished rm -rf test bare_with_gitattribute &&
git init test &&
test_commit -C test gitattributes .gitattributes "f/path test=val" &&
git clone --bare test bare_with_gitattribute &&
- echo "f/path: test: val" >expect &&
+
+ echo "f/path: test: unspecified" >expect &&
git -C bare_with_gitattribute check-attr test -- f/path >actual &&
+ test_cmp expect actual &&
+
+ echo "f/path: test: val" >expect &&
+ git -C bare_with_gitattribute -c attr.tree=HEAD \
+ check-attr test -- f/path >actual &&
test_cmp expect actual
'
diff --git a/t/t5001-archive-attr.sh b/t/t5001-archive-attr.sh
index eaf959d8f63f15..7310774af5efea 100755
--- a/t/t5001-archive-attr.sh
+++ b/t/t5001-archive-attr.sh
@@ -133,7 +133,8 @@ test_expect_success 'git archive vs. bare' '
'
test_expect_success 'git archive with worktree attributes, bare' '
- (cd bare && git archive --worktree-attributes HEAD) >bare-worktree.tar &&
+ (cd bare &&
+ git -c attr.tree=HEAD archive --worktree-attributes HEAD) >bare-worktree.tar &&
(mkdir bare-worktree && cd bare-worktree && "$TAR" xf -) <bare-worktree.tar
'

View File

@ -0,0 +1,219 @@
From 13bb730859857c97f298e9a8c7b68fe00074b3d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Poho=C5=99elsk=C3=BD?= <opohorel@redhat.com>
Date: Thu, 3 Apr 2025 14:46:53 +0200
Subject: [PATCH] Adds the option to sanitize sideband channel messages
CVE-2024-52005 wasn't fixed by upstream. This patch adds the option
to harden Git against it.
The default behaviour of Git remains unchanged.
Changes are taken from Git for Windows. The only differences are that
by default we are allowing all control characters, the documentation
reflects it and one of the tests has to be invoked with a config
change: `sideband.allowControlCharacters=color`
These commits can also be seen in this upstream PR:
https://github.com/gitgitgadget/git/pull/1853
---
Documentation/config.txt | 2 +
Documentation/config/sideband.txt | 16 ++++++
sideband.c | 78 ++++++++++++++++++++++++++++-
t/t5409-colorize-remote-messages.sh | 30 +++++++++++
4 files changed, 124 insertions(+), 2 deletions(-)
create mode 100644 Documentation/config/sideband.txt
diff --git a/Documentation/config.txt b/Documentation/config.txt
index e3a74dd1c1..5b8bbdee82 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -513,6 +513,8 @@ include::config/sequencer.txt[]
include::config/showbranch.txt[]
+include::config/sideband.txt[]
+
include::config/sparse.txt[]
include::config/splitindex.txt[]
diff --git a/Documentation/config/sideband.txt b/Documentation/config/sideband.txt
new file mode 100644
index 0000000000..1adc831667
--- /dev/null
+++ b/Documentation/config/sideband.txt
@@ -0,0 +1,16 @@
+sideband.allowControlCharacters::
+ By default, control characters that are delivered via the sideband
+ are NOT masked. Use this config setting to prevent potentially
+ unwanted ANSI escape sequences from being sent to the terminal:
++
+--
+ color::
+ Allow ANSI color sequences, line feeds and horizontal tabs,
+ but mask all other control characters.
+ false::
+ Mask all control characters other than line feeds and
+ horizontal tabs.
+ true::
+ Allow all control characters to be sent to the terminal.
+ This is the default.
+--
\ No newline at end of file
diff --git a/sideband.c b/sideband.c
index 266a67342b..316a401a5d 100644
--- a/sideband.c
+++ b/sideband.c
@@ -23,6 +23,12 @@ static struct keyword_entry keywords[] = {
{ "error", GIT_COLOR_BOLD_RED },
};
+static enum {
+ ALLOW_NO_CONTROL_CHARACTERS = 0,
+ ALLOW_ALL_CONTROL_CHARACTERS = 1,
+ ALLOW_ANSI_COLOR_SEQUENCES = 2
+} allow_control_characters = ALLOW_ALL_CONTROL_CHARACTERS;
+
/* Returns a color setting (GIT_COLOR_NEVER, etc). */
static int use_sideband_colors(void)
{
@@ -36,6 +42,25 @@ static int use_sideband_colors(void)
if (use_sideband_colors_cached >= 0)
return use_sideband_colors_cached;
+ switch (git_config_get_maybe_bool("sideband.allowcontrolcharacters", &i)) {
+ case 0: /* Boolean value */
+ allow_control_characters = i ? ALLOW_ALL_CONTROL_CHARACTERS :
+ ALLOW_NO_CONTROL_CHARACTERS;
+ break;
+ case -1: /* non-Boolean value */
+ if (git_config_get_string_tmp("sideband.allowcontrolcharacters",
+ &value))
+ ; /* huh? `get_maybe_bool()` returned -1 */
+ else if (!strcmp(value, "color"))
+ allow_control_characters = ALLOW_ANSI_COLOR_SEQUENCES;
+ else
+ warning(_("unrecognized value for `sideband."
+ "allowControlCharacters`: '%s'"), value);
+ break;
+ default:
+ break; /* not configured */
+ }
+
if (!git_config_get_string(key, &value)) {
use_sideband_colors_cached = git_config_colorbool(key, value);
} else if (!git_config_get_string("color.ui", &value)) {
@@ -64,6 +89,55 @@ void list_config_color_sideband_slots(struct string_list *list, const char *pref
list_config_item(list, prefix, keywords[i].keyword);
}
+static int handle_ansi_color_sequence(struct strbuf *dest, const char *src, int n)
+{
+ int i;
+
+ /*
+ * Valid ANSI color sequences are of the form
+ *
+ * ESC [ [<n> [; <n>]*] m
+ */
+
+ if (allow_control_characters != ALLOW_ANSI_COLOR_SEQUENCES ||
+ n < 3 || src[0] != '\x1b' || src[1] != '[')
+ return 0;
+
+ for (i = 2; i < n; i++) {
+ if (src[i] == 'm') {
+ strbuf_add(dest, src, i + 1);
+ return i;
+ }
+ if (!isdigit(src[i]) && src[i] != ';')
+ break;
+ }
+
+ return 0;
+}
+
+static void strbuf_add_sanitized(struct strbuf *dest, const char *src, int n)
+{
+ int i;
+
+ if (allow_control_characters == ALLOW_ALL_CONTROL_CHARACTERS) {
+ strbuf_add(dest, src, n);
+ return;
+ }
+
+ strbuf_grow(dest, n);
+ for (; n && *src; src++, n--) {
+ if (!iscntrl(*src) || *src == '\t' || *src == '\n')
+ strbuf_addch(dest, *src);
+ else if ((i = handle_ansi_color_sequence(dest, src, n))) {
+ src += i;
+ n -= i;
+ } else {
+ strbuf_addch(dest, '^');
+ strbuf_addch(dest, 0x40 + *src);
+ }
+ }
+}
+
/*
* Optionally highlight one keyword in remote output if it appears at the start
* of the line. This should be called for a single line only, which is
@@ -79,7 +153,7 @@ static void maybe_colorize_sideband(struct strbuf *dest, const char *src, int n)
int i;
if (!want_color_stderr(use_sideband_colors())) {
- strbuf_add(dest, src, n);
+ strbuf_add_sanitized(dest, src, n);
return;
}
@@ -112,7 +186,7 @@ static void maybe_colorize_sideband(struct strbuf *dest, const char *src, int n)
}
}
- strbuf_add(dest, src, n);
+ strbuf_add_sanitized(dest, src, n);
}
diff --git a/t/t5409-colorize-remote-messages.sh b/t/t5409-colorize-remote-messages.sh
index fa5de4500a..3b5ff00363 100755
--- a/t/t5409-colorize-remote-messages.sh
+++ b/t/t5409-colorize-remote-messages.sh
@@ -98,4 +98,34 @@ test_expect_success 'fallback to color.ui' '
grep "<BOLD;RED>error<RESET>: error" decoded
'
+test_expect_success 'disallow (color) control sequences in sideband' '
+ write_script .git/color-me-surprised <<-\EOF &&
+ printf "error: Have you \\033[31mread\\033[m this?\\a\\n" >&2
+ exec "$@"
+ EOF
+ test_config_global uploadPack.packObjectshook ./color-me-surprised &&
+ test_commit need-at-least-one-commit &&
+ git -c sideband.allowControlCharacters=color \
+ clone --no-local . throw-away 2>stderr &&
+ test_decode_color <stderr >decoded &&
+ test_grep RED decoded &&
+ test_grep "\\^G" stderr &&
+ tr -dc "\\007" <stderr >actual &&
+ test_must_be_empty actual &&
+
+ rm -rf throw-away &&
+ git -c sideband.allowControlCharacters=false \
+ clone --no-local . throw-away 2>stderr &&
+ test_decode_color <stderr >decoded &&
+ test_grep ! RED decoded &&
+ test_grep "\\^G" stderr &&
+
+ rm -rf throw-away &&
+ git -c sideband.allowControlCharacters clone --no-local . throw-away 2>stderr &&
+ test_decode_color <stderr >decoded &&
+ test_grep RED decoded &&
+ tr -dc "\\007" <stderr >actual &&
+ test_file_not_empty actual
+'
+
test_done
--
2.49.0

144
SOURCES/gpgkey-junio.asc Normal file
View File

@ -0,0 +1,144 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBE6GdewBEADE3szNmKeUAUad22z1tWkLjLzyDcJpF7IzEnL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5I0W58DLeAOIxCRkm3kH
Bi22PpuAKhRelRQnAF9dLdlhZECy5eYl7JKQzOS/dQ0Z3zg+HuDBRyhrmV/go/9C
npFGUZBa+FOC1GMO07GKH8tZY99D5tDCAH6r6S+RrYS690mWpjXhqouBtJezld+X
dsgKwgKHk3IEM4m916O0E75kiNk/AD7vZowwEBvPsgN+CDXCPgH4J5x0p9uyxnKH
omLBd7cuJpio6gf4O1KTl1tlVGcb8f+AUR/MIe70NXyEtpYWMiPW3/0dKwt9APgW
KSX0c8Mp2XKH/vAEDx86XTfBNrnXyUanOQhbLQciYzolJjiPrB0C2NgFFFXSHPwC
ikyT5n2RehAJVmg3eufB1ZOKQgo7ue3ynkW4JidgyCUtsoYSmipl9Nhw1hA3ZNK1
FVCx7tcmy0ZHFO+PV+p17oAC8ZCxSRE0oTeHKcgpF5+DRhQM/+UnmKg=
=7hTI
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -85,12 +85,15 @@
%global build_ldflags -Wl,-z,relro -Wl,-z,now %global build_ldflags -Wl,-z,relro -Wl,-z,now
%endif %endif
# Set path to the package-notes linker script
%global _package_note_file %{_builddir}/%{name}-%{version}/.package_note-%{name}-%{version}-%{release}.%{_arch}.ld
# Define for release candidates # Define for release candidates
#global rcrev .rc0 #global rcrev .rc0
Name: git Name: git
Version: 2.27.0 Version: 2.43.5
Release: 1%{?rcrev}%{?dist} Release: 3%{?rcrev}%{?dist}
Summary: Fast Version Control System Summary: Fast Version Control System
License: GPLv2 License: GPLv2
URL: https://git-scm.com/ URL: https://git-scm.com/
@ -106,7 +109,7 @@ Source1: https://www.kernel.org/pub/software/scm/git/%{?rcrev:testing/}%{
# #
# https://git.kernel.org/cgit/git/git.git/tag/?h=junio-gpg-pub # https://git.kernel.org/cgit/git/git.git/tag/?h=junio-gpg-pub
# https://git.kernel.org/cgit/git/git.git/blob/?h=junio-gpg-pub&id=7214aea37915ee2c4f6369eb9dea520aec7d855b # https://git.kernel.org/cgit/git/git.git/blob/?h=junio-gpg-pub&id=7214aea37915ee2c4f6369eb9dea520aec7d855b
Source9: gpgkey-junio.asc Source2: gpgkey-junio.asc
# Local sources begin at 10 to allow for additional future upstream sources # Local sources begin at 10 to allow for additional future upstream sources
Source11: git.xinetd.in Source11: git.xinetd.in
@ -123,7 +126,29 @@ Source99: print-failed-test-output
Patch0: git-cvsimport-Ignore-cvsps-2.2b1-Branches-output.patch Patch0: git-cvsimport-Ignore-cvsps-2.2b1-Branches-output.patch
Patch1: 0001-Switch-git-instaweb-default-to-apache-2.26.2.patch Patch1: 0001-Switch-git-instaweb-default-to-apache-2.26.2.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1619113 # https://bugzilla.redhat.com/show_bug.cgi?id=1619113
Patch2: git-2.27.0-core-crypto-hmac.patch Patch2: git-2.43.0-core-crypto-hmac.patch
# https://bugzilla.redhat.com/2114531
# tests: try harder to find open ports for apache, git, and svn
#
# https://github.com/tmzullinger/git/commit/aedeaaf788
Patch3: 0001-t-lib-httpd-try-harder-to-find-a-port-for-apache.patch
# https://github.com/tmzullinger/git/commit/16750d024c
Patch4: 0002-t-lib-git-daemon-try-harder-to-find-a-port.patch
# https://github.com/tmzullinger/git/commit/aa5105dc11
Patch5: 0003-t-lib-git-svn-try-harder-to-find-a-port.patch
# attr: read attributes from HEAD when bare repo
#
# https://github.com/git/git/commit/2386535511d1181afd4e892e2a866ffe5e1d7d21
Patch6: git-2.43.0-slow-shallow-clones.patch
# Adds the option to sanitize sideband channel messages
# CVE-2024-52005 wasn't fixed by upstream. This patch adds the option to harden Git against it.
# The default behaviour of Git remains unchanged.
#
# https://github.com/gitgitgadget/git/pull/1853
Patch7: git-2.43.5-sanitize-sideband-channel-messages.patch
%if %{with docs} %if %{with docs}
# pod2man is needed to build Git.3pm # pod2man is needed to build Git.3pm
@ -135,6 +160,7 @@ BuildRequires: rubygem-asciidoctor
BuildRequires: asciidoc >= 8.4.1 BuildRequires: asciidoc >= 8.4.1
%endif %endif
# endif with asciidoctor # endif with asciidoctor
BuildRequires: perl(File::Compare)
BuildRequires: xmlto BuildRequires: xmlto
%if %{with linkcheck} %if %{with linkcheck}
BuildRequires: linkchecker BuildRequires: linkchecker
@ -305,6 +331,7 @@ Requires: git-credential-libsecret = %{version}-%{release}
Requires: git-cvs = %{version}-%{release} Requires: git-cvs = %{version}-%{release}
%endif %endif
# endif with cvs # endif with cvs
Requires: git-daemon = %{version}-%{release}
Requires: git-email = %{version}-%{release} Requires: git-email = %{version}-%{release}
Requires: git-gui = %{version}-%{release} Requires: git-gui = %{version}-%{release}
%if %{with p4} %if %{with p4}
@ -396,7 +423,22 @@ Summary: Git tools for sending patches via email
BuildArch: noarch BuildArch: noarch
Requires: git = %{version}-%{release} Requires: git = %{version}-%{release}
Requires: perl(Authen::SASL) Requires: perl(Authen::SASL)
Requires: perl(Cwd)
Requires: perl(File::Spec)
Requires: perl(File::Spec::Functions)
Requires: perl(File::Temp)
Requires: perl(IO::Socket::SSL)
Requires: perl(Mail::Address)
Requires: perl(MIME::Base64)
Requires: perl(MIME::QuotedPrint)
Requires: perl(Net::Domain)
Requires: perl(Net::SMTP)
Requires: perl(Net::SMTP::SSL) Requires: perl(Net::SMTP::SSL)
Requires: perl(POSIX)
Requires: perl(Sys::Hostname)
Requires: perl(Term::ANSIColor)
Requires: perl(Term::ReadLine)
Requires: perl(Text::ParseWords)
%description email %description email
%{summary}. %{summary}.
@ -501,13 +543,11 @@ Requires: subversion
gpghome="$(mktemp -qd)" # Ensure we don't use any existing gpg keyrings gpghome="$(mktemp -qd)" # Ensure we don't use any existing gpg keyrings
# Convert the ascii-armored key to binary # Convert the ascii-armored key to binary
# (use --yes to ensure an existing dearmored key is overwritten) # (use --yes to ensure an existing dearmored key is overwritten)
gpg2 --homedir "$gpghome" --dearmor --quiet --yes %{SOURCE9} gpg2 --homedir "$gpghome" --dearmor --quiet --yes %{SOURCE2}
xz -dc %{SOURCE0} | # Upstream signs the uncompressed tarballs xz -dc %{SOURCE0} | # Upstream signs the uncompressed tarballs
gpgv2 --homedir "$gpghome" --quiet --keyring %{SOURCE9}.gpg %{SOURCE1} - gpgv2 --homedir "$gpghome" --quiet --keyring %{SOURCE2}.gpg %{SOURCE1} -
rm -rf "$gpghome" # Cleanup tmp gpg home dir rm -rf "$gpghome" # Cleanup tmp gpg home dir
# Ensure a blank line follows autosetup, el6 chokes otherwise
# https://bugzilla.redhat.com/1310704
%autosetup -p1 -n %{name}-%{version}%{?rcrev} %autosetup -p1 -n %{name}-%{version}%{?rcrev}
# Install print-failed-test-output script # Install print-failed-test-output script
@ -620,26 +660,17 @@ export SOURCE_DATE_EPOCH=$(date -r version +%%s 2>/dev/null)
# Fix shebang in a few places to silence rpmlint complaints # Fix shebang in a few places to silence rpmlint complaints
%if %{with python2} %if %{with python2}
sed -i -e '1s@#! */usr/bin/env python$@#!%{__python2}@' \ sed -i -e '1s@#! */usr/bin/env python$@#!%{__python2}@' \
contrib/fast-import/import-zips.py \ contrib/fast-import/import-zips.py
contrib/hg-to-git/hg-to-git.py \
contrib/hooks/multimail/git_multimail.py \
contrib/hooks/multimail/migrate-mailhook-config \
contrib/hooks/multimail/post-receive.example \
contrib/svn-fe/svnrdump_sim.py
%else %else
# Remove contrib/fast-import/import-zips.py, contrib/hg-to-git, and # Remove contrib/fast-import/import-zips.py which require python2.
# contrib/svn-fe which all require python2. rm -rf contrib/fast-import/import-zips.py
rm -rf contrib/fast-import/import-zips.py contrib/hg-to-git contrib/svn-fe
%endif %endif
# endif with python2 # endif with python2
# The multimail hook is installed with git. Use python3 to avoid an # Use python3 to avoid an unnecessary python2 dependency, if possible.
# unnecessary python2 dependency, if possible.
%if %{with python3} %if %{with python3}
sed -i -e '1s@#!\( */usr/bin/env python\|%{__python2}\)$@#!%{__python3}@' \ sed -i -e '1s@#!\( */usr/bin/env python\|%{__python2}\)$@#!%{__python3}@' \
contrib/hooks/multimail/git_multimail.py \ contrib/hg-to-git/hg-to-git.py
contrib/hooks/multimail/migrate-mailhook-config \
contrib/hooks/multimail/post-receive.example
%endif %endif
# endif with python3 # endif with python3
@ -681,6 +712,9 @@ install -Dpm 0755 contrib/diff-highlight/diff-highlight \
%{buildroot}%{_datadir}/git-core/contrib/diff-highlight %{buildroot}%{_datadir}/git-core/contrib/diff-highlight
rm -rf contrib/diff-highlight/{Makefile,diff-highlight,*.perl,t} rm -rf contrib/diff-highlight/{Makefile,diff-highlight,*.perl,t}
# Remove contrib/scalar to avoid cruft in the git-core-doc docdir
rm -rf contrib/scalar
# Clean up contrib/subtree to avoid cruft in the git-core-doc docdir # Clean up contrib/subtree to avoid cruft in the git-core-doc docdir
rm -rf contrib/subtree/{INSTALL,Makefile,git-subtree*,t} rm -rf contrib/subtree/{INSTALL,Makefile,git-subtree*,t}
@ -744,9 +778,6 @@ mkdir -p %{buildroot}%{_datadir}/git-core/contrib/completion
install -pm 644 contrib/completion/git-completion.tcsh \ install -pm 644 contrib/completion/git-completion.tcsh \
%{buildroot}%{_datadir}/git-core/contrib/completion/ %{buildroot}%{_datadir}/git-core/contrib/completion/
# Drop .py extension from git_multimail to avoid byte-compiling
mv contrib/hooks/multimail/git_multimail{.py,}
# Move contrib/hooks out of %%docdir # Move contrib/hooks out of %%docdir
mkdir -p %{buildroot}%{_datadir}/git-core/contrib mkdir -p %{buildroot}%{_datadir}/git-core/contrib
mv contrib/hooks %{buildroot}%{_datadir}/git-core/contrib mv contrib/hooks %{buildroot}%{_datadir}/git-core/contrib
@ -782,7 +813,7 @@ chmod a-x Documentation/technical/api-index.sh
find contrib -type f -print0 | xargs -r0 chmod -x find contrib -type f -print0 | xargs -r0 chmod -x
# Split core files # Split core files
not_core_re="git-(add--interactive|contacts|credential-netrc|difftool|filter-branch|instaweb|request-pull|send-mail)|gitweb" not_core_re="git-(add--interactive|contacts|credential-netrc|filter-branch|instaweb|request-pull|send-mail)|gitweb"
grep -vE "$not_core_re|%{_mandir}" bin-man-doc-files > bin-files-core grep -vE "$not_core_re|%{_mandir}" bin-man-doc-files > bin-files-core
touch man-doc-files-core touch man-doc-files-core
%if %{with docs} %if %{with docs}
@ -835,7 +866,17 @@ find %{buildroot}%{_pkgdocdir} -name "*.html" -print0 | xargs -r0 linkchecker
# endif with docs && with linkcheck # endif with docs && with linkcheck
# Tests to skip on all releases and architectures # Tests to skip on all releases and architectures
GIT_SKIP_TESTS="" #
# t5559-http-fetch-smart-http2 runs t5551-http-fetch-smart with
# HTTP_PROTO=HTTP/2. Unfortunately, it fails quite regularly.
# https://lore.kernel.org/git/Y4fUntdlc1mqwad5@pobox.com/
GIT_SKIP_TESTS="t5559"
%if 0%{?rhel} && 0%{?rhel} < 8
# Skip tests which require mod_http2 on el7
GIT_SKIP_TESTS="$GIT_SKIP_TESTS t5559"
%endif
# endif rhel < 8
%ifarch aarch64 %{arm} %{power64} %ifarch aarch64 %{arm} %{power64}
# Skip tests which fail on aarch64, arm, and ppc # Skip tests which fail on aarch64, arm, and ppc
@ -844,30 +885,39 @@ GIT_SKIP_TESTS=""
# to limit the maximum stack size. # to limit the maximum stack size.
# t5541.35 'push 2000 tags over http' # t5541.35 'push 2000 tags over http'
# t5551.25 'clone the 2,000 tag repo to check OS command line overflow' # t5551.25 'clone the 2,000 tag repo to check OS command line overflow'
GIT_SKIP_TESTS="$GIT_SKIP_TESTS t5541.35 t5551.25" GIT_SKIP_TESTS="$GIT_SKIP_TESTS t5541.37 t5551.25"
%endif %endif
# endif aarch64 %%{arm} %%{power64} # endif aarch64 %%{arm} %%{power64}
%ifarch %{power64} %if 0%{?rhel} == 8 && "%{_arch}" == "s390x"
# Skip tests which fail on ppc # Skip tests which fail on s390x on rhel-8
# #
# t9115-git-svn-dcommit-funky-renames is disabled because it frequently fails. # The following tests fail on s390x & el8. The cause should be investigated.
# The port it uses (9115) is already in use. It is unclear if this is # However, it's a lower priority since the same tests work consistently on
# due to an issue in the test suite or a conflict with some other process on # s390x with Fedora and RHEL-9. The failures seem to originate in t5300.
# the build host. It only appears to occur on ppc-arches.
GIT_SKIP_TESTS="$GIT_SKIP_TESTS t9115"
%endif
# endif %%{power64}
%ifarch s390x
# Skip tests which fail on s390x
# #
# t7812-grep-icase-non-ascii's "PCRE v2: grep non-ASCII from invalid UTF-8 # t5300.10 'unpack without delta'
# data" test fails on big-endian arches. This is known upstream and will # t5300.12 'unpack with REF_DELTA'
# hopefully be resolved soon (2019/10/24, tmz) # t5300.13 'unpack with REF_DELTA'
GIT_SKIP_TESTS="$GIT_SKIP_TESTS t7812.11" # t5300.14 'unpack with OFS_DELTA'
# t5300.18 'compare delta flavors'
# t5300.20 'use packed deltified (REF_DELTA) objects'
# t5300.23 'verify pack'
# t5300.24 'verify pack -v'
# t5300.25 'verify-pack catches mismatched .idx and .pack files'
# t5300.29 'verify-pack catches a corrupted sum of the index file itself'
# t5300.30 'build pack index for an existing pack'
# t5300.45 'make sure index-pack detects the SHA1 collision'
# t5300.46 'make sure index-pack detects the SHA1 collision (large blobs)'
# t5303.5 'create corruption in data of first object'
# t5303.7 '... and loose copy of second object allows for partial recovery'
# t5303.11 'create corruption in data of first delta'
# t6300.35 'basic atom: head objectsize:disk'
# t6300.91 'basic atom: tag objectsize:disk'
# t6300.92 'basic atom: tag *objectsize:disk'
GIT_SKIP_TESTS="$GIT_SKIP_TESTS t5300.1[02348] t5300.2[03459] t5300.30 t5300.4[56] t5303.[57] t5303.11 t6300.35 t6300.9[12]"
%endif %endif
# endif s390x # endif rhel == 8 && arch == s390x
export GIT_SKIP_TESTS export GIT_SKIP_TESTS
@ -875,11 +925,13 @@ export GIT_SKIP_TESTS
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8
# Explicitly enable tests which may be skipped opportunistically # Explicitly enable tests which may be skipped opportunistically
# (Check for variables set via test_tristate in the test suite) # Check for variables set via test_bool_env in the test suite:
export GIT_SVN_TEST_HTTPD=true # git grep 'test_bool_env GIT_' -- t/{lib-,t[0-9]}*.sh |
# sed -r 's/.* (GIT_[^ ]+) .*/\1/g' | sort -u
export GIT_TEST_GIT_DAEMON=true export GIT_TEST_GIT_DAEMON=true
export GIT_TEST_HTTPD=true export GIT_TEST_HTTPD=true
export GIT_TEST_SVNSERVE=true export GIT_TEST_SVNSERVE=true
export GIT_TEST_SVN_HTTPD=true
# Create tmpdir for test output and update GIT_TEST_OPTS # Create tmpdir for test output and update GIT_TEST_OPTS
# Also update GIT-BUILD-OPTIONS to keep make from any needless rebuilding # Also update GIT-BUILD-OPTIONS to keep make from any needless rebuilding
@ -919,7 +971,6 @@ rmdir --ignore-fail-on-non-empty "$testdir"
%endif %endif
# endif emacs_filesystem # endif emacs_filesystem
%{_datadir}/git-core/contrib/diff-highlight %{_datadir}/git-core/contrib/diff-highlight
%{_datadir}/git-core/contrib/hooks/multimail
%{_datadir}/git-core/contrib/hooks/update-paranoid %{_datadir}/git-core/contrib/hooks/update-paranoid
%{_datadir}/git-core/contrib/hooks/setgitperms.perl %{_datadir}/git-core/contrib/hooks/setgitperms.perl
%{_datadir}/git-core/templates/hooks/fsmonitor-watchman.sample %{_datadir}/git-core/templates/hooks/fsmonitor-watchman.sample
@ -936,7 +987,6 @@ rmdir --ignore-fail-on-non-empty "$testdir"
%license COPYING %license COPYING
# exclude is best way here because of troubles with symlinks inside git-core/ # exclude is best way here because of troubles with symlinks inside git-core/
%exclude %{_datadir}/git-core/contrib/diff-highlight %exclude %{_datadir}/git-core/contrib/diff-highlight
%exclude %{_datadir}/git-core/contrib/hooks/multimail
%exclude %{_datadir}/git-core/contrib/hooks/update-paranoid %exclude %{_datadir}/git-core/contrib/hooks/update-paranoid
%exclude %{_datadir}/git-core/contrib/hooks/setgitperms.perl %exclude %{_datadir}/git-core/contrib/hooks/setgitperms.perl
%exclude %{_datadir}/git-core/templates/hooks/fsmonitor-watchman.sample %exclude %{_datadir}/git-core/templates/hooks/fsmonitor-watchman.sample
@ -1061,6 +1111,43 @@ rmdir --ignore-fail-on-non-empty "$testdir"
%{?with_docs:%{_pkgdocdir}/git-svn.html} %{?with_docs:%{_pkgdocdir}/git-svn.html}
%changelog %changelog
* Fri Apr 04 2025 Ondřej Pohořelský <opohorel@redhat.com> - 2.43.5-3
- add the option to sanitize sideband channel messages
- Resolves: RHEL-74177
* Fri Nov 15 2024 Ondřej Pohořelský <opohorel@redhat.com> - 2.43.5-2
- Sync version with the hotfix branch
- Related: RHEL-64984
* Thu Nov 14 2024 Ondřej Pohořelský <opohorel@redhat.com> - 2.43.0-2
- Add fix for extremely slow shallow clones
- Repair t6300 on s390x
- Resolves: RHEL-64984
* Wed Dec 06 2023 Ondřej Pohořelský <opohorel@redhat.com> - 2.43.0-1
- Update to 2.43.0
- Resolves: RHEL-17103
* Thu Apr 27 2023 Ondřej Pohořelský <opohorel@redhat.com> - 2.39.3-1
- Update to 2.39.3
- Resolves: #2188364, #2188373, #2190157, #2190158
* Thu Jan 19 2023 Ondrej Pohorelsky <opohorel@redhat.com> - 2.39.1-1
- Update to 2.39.1
- Resolves: rhbz#2162064
* Mon Dec 19 2022 Ondrej Pohorelsky <opohorel@redhat.com> - 2.39.0-1
- Update to 2.39.0
- Resolves: rhbz#2139378
* Thu Nov 25 2021 Ondrej Pohorelsky <opohorel@redhat.com> - 2.31.1-2
- Remove perl(Email::Valid) require from git-email
- Related: rhbz#2021547
* Fri Nov 19 2021 Ondrej Pohorelsky <opohorel@redhat.com> - 2.31.1-1
- Update to release 2.31.1
- Resolves: rhbz#2021547
* Thu Jun 11 2020 Ondrej Pohorelsky <opohorel@redhat.com> - 2.27.0-1 * Thu Jun 11 2020 Ondrej Pohorelsky <opohorel@redhat.com> - 2.27.0-1
- Update to release 2.27.0 - Update to release 2.27.0
- Resolves: rhbz#1825114 - Resolves: rhbz#1825114