From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7F8F815813A for ; Fri, 10 Jan 2025 21:45:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8BE02E07FA; Fri, 10 Jan 2025 21:45:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 74FDFE07FA for ; Fri, 10 Jan 2025 21:45:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A7C9533C1EB for ; Fri, 10 Jan 2025 21:45:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 08D3E1FA5 for ; Fri, 10 Jan 2025 21:45:32 +0000 (UTC) From: "Ionen Wolkens" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ionen Wolkens" Message-ID: <1736545299.1a95f5bad210d7dcafbc1160c8e6197bbf3732bf.ionen@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-vcs/git/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-vcs/git/files/git-2.47.0-maintenance.patch X-VCS-Directories: dev-vcs/git/files/ X-VCS-Committer: ionen X-VCS-Committer-Name: Ionen Wolkens X-VCS-Revision: 1a95f5bad210d7dcafbc1160c8e6197bbf3732bf X-VCS-Branch: master Date: Fri, 10 Jan 2025 21:45:32 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 8fbb42fa-cfbb-4f40-8025-520b25a5e478 X-Archives-Hash: 57d35f397afbcf675cc68254c5c54d7d commit: 1a95f5bad210d7dcafbc1160c8e6197bbf3732bf Author: Michael Mair-Keimberger levelnine at> AuthorDate: Fri Jan 10 15:58:32 2025 +0000 Commit: Ionen Wolkens gentoo org> CommitDate: Fri Jan 10 21:41:39 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a95f5ba dev-vcs/git: remove unused patch Signed-off-by: Michael Mair-Keimberger levelnine.at> Signed-off-by: Ionen Wolkens gentoo.org> dev-vcs/git/files/git-2.47.0-maintenance.patch | 85 -------------------------- 1 file changed, 85 deletions(-) diff --git a/dev-vcs/git/files/git-2.47.0-maintenance.patch b/dev-vcs/git/files/git-2.47.0-maintenance.patch deleted file mode 100644 index 085d4adac33f..000000000000 --- a/dev-vcs/git/files/git-2.47.0-maintenance.patch +++ /dev/null @@ -1,85 +0,0 @@ -https://lore.kernel.org/git/CAG=Um+0mJW-oAH+YLC3dWEU64JwS-zMkkTiFWYBe4g6HMbe-iA@mail.gmail.com/ -https://github.com/git/git/commit/c95547a394a35dc26afa686454086d2db6e51ea4 - -From c95547a394a35dc26afa686454086d2db6e51ea4 Mon Sep 17 00:00:00 2001 -From: Patrick Steinhardt -Date: Thu, 10 Oct 2024 07:33:01 +0200 -Subject: [PATCH] builtin/gc: fix crash when running `git maintenance start` - -It was reported on the mailing list that running `git maintenance start` -immediately segfaults starting with b6c3f8e12c (builtin/maintenance: fix -leak in `get_schedule_cmd()`, 2024-09-26). And indeed, this segfault is -trivial to reproduce up to a point where one is scratching their head -why we didn't catch this regression in our test suite. - -The root cause of this error is `get_schedule_cmd()`, which does not -populate the `out` parameter in all cases anymore starting with the -mentioned commit. Callers do assume it to always be populated though and -will e.g. call `strvec_split()` on the returned value, which will of -course segfault when the variable is uninitialized. - -So why didn't we catch this trivial regression? The reason is that our -tests always set up the "GIT_TEST_MAINT_SCHEDULER" environment variable -via "t/test-lib.sh", which allows us to override the scheduler command -with a custom one so that we don't accidentally modify the developer's -system. But the faulty code where we don't set the `out` parameter will -only get hit in case that environment variable is _not_ set, which is -never the case when executing our tests. - -Fix the regression by again unconditionally allocating the value in the -`out` parameter, if provided. Add a test that unsets the environment -variable to catch future regressions in this area. - -Reported-by: Shubham Kanodia -Signed-off-by: Patrick Steinhardt -Signed-off-by: Junio C Hamano ---- a/builtin/gc.c -+++ b/builtin/gc.c -@@ -1794,7 +1794,7 @@ static const char *get_frequency(enum schedule_priority schedule) - * | Input | Output | - * | *cmd | return code | *out | *is_available | - * +-------+-------------+-------------------+---------------+ -- * | "foo" | false | NULL | (unchanged) | -+ * | "foo" | false | "foo" (allocated) | (unchanged) | - * +-------+-------------+-------------------+---------------+ - * - * GIT_TEST_MAINT_SCHEDULER set to “foo:./mock_foo.sh,bar:./mock_bar.sh” -@@ -1812,8 +1812,11 @@ static int get_schedule_cmd(const char *cmd, int *is_available, char **out) - struct string_list_item *item; - struct string_list list = STRING_LIST_INIT_NODUP; - -- if (!testing) -+ if (!testing) { -+ if (out) -+ *out = xstrdup(cmd); - return 0; -+ } - - if (is_available) - *is_available = 0; ---- a/t/t7900-maintenance.sh -+++ b/t/t7900-maintenance.sh -@@ -646,6 +646,22 @@ test_expect_success !MINGW 'register and unregister with regex metacharacters' ' - maintenance.repo "$(pwd)/$META" - ' - -+test_expect_success 'start without GIT_TEST_MAINT_SCHEDULER' ' -+ test_when_finished "rm -rf systemctl.log script repo" && -+ mkdir script && -+ write_script script/systemctl <<-\EOF && -+ echo "$*" >>../systemctl.log -+ EOF -+ git init repo && -+ ( -+ cd repo && -+ sane_unset GIT_TEST_MAINT_SCHEDULER && -+ PATH="$PWD/../script:$PATH" git maintenance start --scheduler=systemd -+ ) && -+ test_grep -- "--user list-timers" systemctl.log && -+ test_grep -- "enable --now git-maintenance@" systemctl.log -+' -+ - test_expect_success 'start --scheduler=' ' - test_expect_code 129 git maintenance start --scheduler=foo 2>err && - test_grep "unrecognized --scheduler argument" err && -