Skip to content

Commit f6e53be

Browse files
authored
Fix git ptest with new git config syntax (microsoft#14342)
1 parent d92d957 commit f6e53be

File tree

2 files changed

+53
-2
lines changed

2 files changed

+53
-2
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
From 5415cf267c1b5a4ef9591e11106085bc24b7131b Mon Sep 17 00:00:00 2001
2+
From: archana25-ms <[email protected]>
3+
Date: Thu, 17 Jul 2025 17:21:37 +0000
4+
Subject: [PATCH] Fix git config syntax
5+
Upstream Patch reference: https://lkml.org/lkml/2025/7/8/1608
6+
7+
---
8+
t/t1300-config.sh | 4 ++--
9+
t/t7450-bad-git-dotfiles.sh | 4 ++--
10+
2 files changed, 4 insertions(+), 4 deletions(-)
11+
12+
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
13+
index 00f34c5..3ed4a0b 100755
14+
--- a/t/t1300-config.sh
15+
+++ b/t/t1300-config.sh
16+
@@ -2743,8 +2743,8 @@ test_expect_success 'writing value with trailing CR not stripped on read' '
17+
18+
printf "bar\r\n" >expect &&
19+
git init cr-test &&
20+
- git -C cr-test config set core.foo $(printf "bar\r") &&
21+
- git -C cr-test config get core.foo >actual &&
22+
+ git -C cr-test config core.foo $(printf "bar\r") &&
23+
+ git -C cr-test config --get core.foo >actual &&
24+
25+
test_cmp expect actual
26+
'
27+
diff --git a/t/t7450-bad-git-dotfiles.sh b/t/t7450-bad-git-dotfiles.sh
28+
index ff63c05..38b9db8 100755
29+
--- a/t/t7450-bad-git-dotfiles.sh
30+
+++ b/t/t7450-bad-git-dotfiles.sh
31+
@@ -388,10 +388,10 @@ test_expect_success SYMLINKS,!WINDOWS,!MINGW 'submodule must not checkout into d
32+
git -C repo mv sub $(printf "sub\r") &&
33+
34+
# Ensure config values containing CR are wrapped in quotes.
35+
- git config unset -f repo/.gitmodules submodule.sub.path &&
36+
+ git config --unset -f repo/.gitmodules submodule.sub.path &&
37+
printf "\tpath = \"sub\r\"\n" >>repo/.gitmodules &&
38+
39+
- git config unset -f repo/.git/modules/sub/config core.worktree &&
40+
+ git config --unset -f repo/.git/modules/sub/config core.worktree &&
41+
{
42+
printf "[core]\n" &&
43+
printf "\tworktree = \"../../../sub\r\"\n"
44+
--
45+
2.45.3
46+

SPECS/git/git.spec

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
Summary: Fast distributed version control system
88
Name: git
99
Version: 2.45.4
10-
Release: 1%{?dist}
10+
Release: 2%{?dist}
1111
License: GPLv2
1212
Vendor: Microsoft Corporation
1313
Distribution: Azure Linux
1414
Group: System Environment/Programming
1515
URL: https://git-scm.com/
1616
Source0: https://github.com/git/git/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
17+
# Below patch not needed for Git 2.46.0, already includes this fix.
18+
Patch0: Ptest-fix-git-config-syntax.patch
1719
BuildRequires: curl-devel
1820
BuildRequires: python3-devel
1921
Requires: curl
@@ -106,7 +108,7 @@ BuildArch: noarch
106108
%endif
107109

108110
%prep
109-
%autosetup
111+
%autosetup -p1
110112
%{py3_shebang_fix} git-p4.py
111113

112114
%build
@@ -173,6 +175,9 @@ fi
173175
%endif
174176

175177
%changelog
178+
* Fri Jul 18 2025 Archana Shettigar <[email protected]> - 2.45.4-2
179+
- Fix ptest with new git config syntax in CVE-2025-48384
180+
176181
* Fri Jul 11 2025 Archana Shettigar <[email protected]> - 2.45.4-1
177182
- Upgrade to 2.45.4 - CVE-2025-48384, CVE-2025-48385, CVE-2025-27613 & CVE-2025-27614
178183

0 commit comments

Comments
 (0)