From b0ff25c120c94b0c64902391eb47c9a8d537ace4 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Wed, 19 Nov 2025 12:35:36 +0800 Subject: [PATCH] 2.52.0 --- backport-CVE-2024-52005.patch | 65 +++++++++++++------------- git-2.51.2.tar.xz => git-2.52.0.tar.xz | 4 +- git.spec | 5 +- 3 files changed, 39 insertions(+), 35 deletions(-) rename git-2.51.2.tar.xz => git-2.52.0.tar.xz (32%) diff --git a/backport-CVE-2024-52005.patch b/backport-CVE-2024-52005.patch index cee35cc..3aa52ac 100644 --- a/backport-CVE-2024-52005.patch +++ b/backport-CVE-2024-52005.patch @@ -1,4 +1,4 @@ -From 5b257412e25ad29410c389300324886aa59e1f83 Mon Sep 17 00:00:00 2001 +From 962ce4c245bf39ec6f465c2a788ac8c99ce98836 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 6 Nov 2024 20:34:50 +0100 Subject: [PATCH 1/3] sideband: mask control characters @@ -29,10 +29,10 @@ Signed-off-by: Johannes Schindelin 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/sideband.c b/sideband.c -index 85bddfdcd4f57a..9384cb02d56a04 100644 +index ea7c25211e..d2e6023e60 100644 --- a/sideband.c +++ b/sideband.c -@@ -61,6 +61,19 @@ void list_config_color_sideband_slots(struct string_list *list, const char *pref +@@ -66,6 +66,19 @@ void list_config_color_sideband_slots(struct string_list *list, const char *pref list_config_item(list, prefix, keywords[i].keyword); } @@ -52,7 +52,7 @@ index 85bddfdcd4f57a..9384cb02d56a04 100644 /* * 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 -@@ -73,7 +86,7 @@ static void maybe_colorize_sideband(struct strbuf *dest, const char *src, int n) +@@ -81,7 +94,7 @@ static void maybe_colorize_sideband(struct strbuf *dest, const char *src, int n) int i; if (!want_color_stderr(use_sideband_colors())) { @@ -61,7 +61,7 @@ index 85bddfdcd4f57a..9384cb02d56a04 100644 return; } -@@ -106,7 +119,7 @@ static void maybe_colorize_sideband(struct strbuf *dest, const char *src, int n) +@@ -114,7 +127,7 @@ static void maybe_colorize_sideband(struct strbuf *dest, const char *src, int n) } } @@ -71,7 +71,7 @@ index 85bddfdcd4f57a..9384cb02d56a04 100644 diff --git a/t/t5409-colorize-remote-messages.sh b/t/t5409-colorize-remote-messages.sh -index fa5de4500a4f50..6a6e0d15b21050 100755 +index fa5de4500a..d0745c391b 100755 --- a/t/t5409-colorize-remote-messages.sh +++ b/t/t5409-colorize-remote-messages.sh @@ -98,4 +98,16 @@ test_expect_success 'fallback to color.ui' ' @@ -92,7 +92,7 @@ index fa5de4500a4f50..6a6e0d15b21050 100755 + test_done -From a8c289b0a531d25336a96eaa5e3584414ed4c6c4 Mon Sep 17 00:00:00 2001 +From 8b6de3647dc1599e23ae316ac9a2c2772ab6a9f5 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 6 Nov 2024 21:07:51 +0100 Subject: [PATCH 2/3] sideband: introduce an "escape hatch" to allow control @@ -116,13 +116,13 @@ Signed-off-by: Johannes Schindelin sideband.c | 10 ++++++++++ t/t5409-colorize-remote-messages.sh | 8 +++++++- 4 files changed, 24 insertions(+), 1 deletion(-) - create mode 100644 Documentation/config/sideband.txt + create mode 100644 Documentation/config/sideband.adoc diff --git a/Documentation/config.adoc b/Documentation/config.adoc -index 0e93aef86264db..abdbfba9bd756a 100644 +index 62eebe7c54..dcea3c0c15 100644 --- a/Documentation/config.adoc +++ b/Documentation/config.adoc -@@ -511,6 +511,8 @@ include::config/sequencer.txt[] +@@ -523,6 +523,8 @@ include::config/sequencer.adoc[] include::config/showbranch.adoc[] @@ -133,7 +133,7 @@ index 0e93aef86264db..abdbfba9bd756a 100644 include::config/splitindex.adoc[] diff --git a/Documentation/config/sideband.adoc b/Documentation/config/sideband.adoc new file mode 100644 -index 00000000000000..3fb5045cd79581 +index 0000000000..3fb5045cd7 --- /dev/null +++ b/Documentation/config/sideband.adoc @@ -0,0 +1,5 @@ @@ -143,29 +143,29 @@ index 00000000000000..3fb5045cd79581 + from being sent to the terminal. Use this config setting to override + this behavior. diff --git a/sideband.c b/sideband.c -index 9384cb02d56a04..8ebf1f0743e6b6 100644 +index d2e6023e60..ecba71e661 100644 --- a/sideband.c +++ b/sideband.c -@@ -20,6 +20,8 @@ static struct keyword_entry keywords[] = { +@@ -26,6 +26,8 @@ static struct keyword_entry keywords[] = { { "error", GIT_COLOR_BOLD_RED }, }; +static int allow_control_characters; + /* Returns a color setting (GIT_COLOR_NEVER, etc). */ - static int use_sideband_colors(void) + static enum git_colorbool use_sideband_colors(void) { -@@ -33,6 +35,9 @@ static int use_sideband_colors(void) - if (use_sideband_colors_cached >= 0) +@@ -39,6 +41,9 @@ static enum git_colorbool use_sideband_colors(void) + if (use_sideband_colors_cached != GIT_COLOR_UNKNOWN) return use_sideband_colors_cached; -+ git_config_get_bool("sideband.allowcontrolcharacters", ++ repo_config_get_bool(the_repository, "sideband.allowcontrolcharacters", + &allow_control_characters); + if (!repo_config_get_string_tmp(the_repository, key, &value)) use_sideband_colors_cached = git_config_colorbool(key, value); else if (!repo_config_get_string_tmp(the_repository, "color.ui", &value)) -@@ -63,6 +68,11 @@ void list_config_color_sideband_slots(struct string_list *list, const char *pref +@@ -68,6 +73,11 @@ void list_config_color_sideband_slots(struct string_list *list, const char *pref static void strbuf_add_sanitized(struct strbuf *dest, const char *src, int n) { @@ -178,7 +178,7 @@ index 9384cb02d56a04..8ebf1f0743e6b6 100644 for (; n && *src; src++, n--) { if (!iscntrl(*src) || *src == '\t' || *src == '\n') diff --git a/t/t5409-colorize-remote-messages.sh b/t/t5409-colorize-remote-messages.sh -index 6a6e0d15b21050..1cd0640f200009 100755 +index d0745c391b..fb31e85254 100755 --- a/t/t5409-colorize-remote-messages.sh +++ b/t/t5409-colorize-remote-messages.sh @@ -105,9 +105,15 @@ test_expect_success 'disallow (color) control sequences in sideband' ' @@ -199,7 +199,7 @@ index 6a6e0d15b21050..1cd0640f200009 100755 test_done -From c7049c2a7f47c99a67fd869f1ee89d7aa1a328d2 Mon Sep 17 00:00:00 2001 +From 2beea47408f350cb13b680bfa425e61ffca8d612 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 18 Nov 2024 21:42:57 +0100 Subject: [PATCH 3/3] sideband: do allow ANSI color sequences by default @@ -229,7 +229,7 @@ Signed-off-by: Johannes Schindelin 3 files changed, 84 insertions(+), 10 deletions(-) diff --git a/Documentation/config/sideband.adoc b/Documentation/config/sideband.adoc -index 3fb5045cd79581..f347fd6b33004a 100644 +index 3fb5045cd7..f347fd6b33 100644 --- a/Documentation/config/sideband.adoc +++ b/Documentation/config/sideband.adoc @@ -1,5 +1,16 @@ @@ -253,10 +253,10 @@ index 3fb5045cd79581..f347fd6b33004a 100644 + Allow all control characters to be sent to the terminal. +-- diff --git a/sideband.c b/sideband.c -index 8ebf1f0743e6b6..afd62aa008154b 100644 +index ecba71e661..17d0d5b719 100644 --- a/sideband.c +++ b/sideband.c -@@ -20,7 +20,11 @@ static struct keyword_entry keywords[] = { +@@ -26,7 +26,11 @@ static struct keyword_entry keywords[] = { { "error", GIT_COLOR_BOLD_RED }, }; @@ -268,12 +268,12 @@ index 8ebf1f0743e6b6..afd62aa008154b 100644 +} allow_control_characters = ALLOW_ANSI_COLOR_SEQUENCES; /* Returns a color setting (GIT_COLOR_NEVER, etc). */ - static int use_sideband_colors(void) -@@ -35,8 +39,24 @@ static int use_sideband_colors(void) - if (use_sideband_colors_cached >= 0) + static enum git_colorbool use_sideband_colors(void) +@@ -41,8 +45,24 @@ static enum git_colorbool use_sideband_colors(void) + if (use_sideband_colors_cached != GIT_COLOR_UNKNOWN) return use_sideband_colors_cached; -- git_config_get_bool("sideband.allowcontrolcharacters", +- repo_config_get_bool(the_repository, "sideband.allowcontrolcharacters", - &allow_control_characters); + switch (repo_config_get_maybe_bool(the_repository, "sideband.allowcontrolcharacters", &i)) { + case 0: /* Boolean value */ @@ -281,8 +281,8 @@ index 8ebf1f0743e6b6..afd62aa008154b 100644 + ALLOW_NO_CONTROL_CHARACTERS; + break; + case -1: /* non-Boolean value */ -+ if (repo_config_get_string(the_repository, "sideband.allowcontrolcharacters", -+ &value)) ++ if (repo_config_get_string_tmp(the_repository, "sideband.allowcontrolcharacters", ++ &value)) + ; /* huh? `get_maybe_bool()` returned -1 */ + else if (!strcmp(value, "color")) + allow_control_characters = ALLOW_ANSI_COLOR_SEQUENCES; @@ -296,7 +296,7 @@ index 8ebf1f0743e6b6..afd62aa008154b 100644 if (!repo_config_get_string_tmp(the_repository, key, &value)) use_sideband_colors_cached = git_config_colorbool(key, value); -@@ -66,9 +86,37 @@ void list_config_color_sideband_slots(struct string_list *list, const char *pref +@@ -71,9 +91,37 @@ void list_config_color_sideband_slots(struct string_list *list, const char *pref list_config_item(list, prefix, keywords[i].keyword); } @@ -335,7 +335,7 @@ index 8ebf1f0743e6b6..afd62aa008154b 100644 strbuf_add(dest, src, n); return; } -@@ -77,7 +125,10 @@ static void strbuf_add_sanitized(struct strbuf *dest, const char *src, int n) +@@ -82,7 +130,10 @@ static void strbuf_add_sanitized(struct strbuf *dest, const char *src, int n) for (; n && *src; src++, n--) { if (!iscntrl(*src) || *src == '\t' || *src == '\n') strbuf_addch(dest, *src); @@ -348,7 +348,7 @@ index 8ebf1f0743e6b6..afd62aa008154b 100644 strbuf_addch(dest, 0x40 + *src); } diff --git a/t/t5409-colorize-remote-messages.sh b/t/t5409-colorize-remote-messages.sh -index 1cd0640f200009..43296ea51c5db1 100755 +index fb31e85254..a755c49a74 100755 --- a/t/t5409-colorize-remote-messages.sh +++ b/t/t5409-colorize-remote-messages.sh @@ -100,7 +100,7 @@ test_expect_success 'fallback to color.ui' ' @@ -386,3 +386,4 @@ index 1cd0640f200009..43296ea51c5db1 100755 ' test_done + diff --git a/git-2.51.2.tar.xz b/git-2.52.0.tar.xz similarity index 32% rename from git-2.51.2.tar.xz rename to git-2.52.0.tar.xz index c49f6a0..fbb6078 100644 --- a/git-2.51.2.tar.xz +++ b/git-2.52.0.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:233d7143a2d58e60755eee9b76f559ec73ea2b3c297f5b503162ace95966b4e3 -size 7865980 +oid sha256:3cd8fee86f69a949cb610fee8cd9264e6873d07fa58411f6060b3d62729ed7c5 +size 7957064 diff --git a/git.spec b/git.spec index 91aa7d3..843f9f9 100644 --- a/git.spec +++ b/git.spec @@ -1,6 +1,6 @@ %global gitexecdir %{_libexecdir}/git-core Name: git -Version: 2.51.2 +Version: 2.52.0 Release: 1 Summary: A popular and widely used Version Control System License: BSD-3-Clause AND GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.1-or-later AND MIT @@ -285,6 +285,9 @@ grep -E "$not_core_re" bin-man-doc-files > git-bin-files %{_mandir}/man7/git*.7.* %changelog +* Tue Nov 18 2025 Funda Wang - 2.52.0-1 +- update to 2.52.0 + * Tue Oct 28 2025 Funda Wang - 2.51.2-1 - update to 2.51.2 -- Gitee