debian: apply security fixes from 2.24.1
[git/debian.git] / debian / patches / 0038-submodule-defend-against-submodule.update-command-in-.diff
blob8fb0228da9331d0ad3df4bbc1af13caf76fc7ea0
1 From b46f885ba75c6c80b7f7ad6b2ddc6275592cb8d9 Mon Sep 17 00:00:00 2001
2 From: Jonathan Nieder <jrnieder@gmail.com>
3 Date: Thu, 5 Dec 2019 01:28:28 -0800
4 Subject: submodule: defend against submodule.update = !command in .gitmodules
6 In v2.15.4, we started to reject `submodule.update` settings in
7 `.gitmodules`. Let's raise a BUG if it somehow still made it through
8 from anywhere but the Git config.
10 Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
11 Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
12 (cherry picked from commit c1547450748fcbac21675f2681506d2d80351a19)
13 Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
14 ---
15 builtin/submodule--helper.c | 2 ++
16 1 file changed, 2 insertions(+)
18 diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
19 index b67bda0945..521b4b3aa8 100644
20 --- a/builtin/submodule--helper.c
21 +++ b/builtin/submodule--helper.c
22 @@ -1487,6 +1487,8 @@ static void determine_submodule_update_strategy(struct repository *r,
23 die(_("Invalid update mode '%s' configured for submodule path '%s'"),
24 val, path);
25 } else if (sub->update_strategy.type != SM_UPDATE_UNSPECIFIED) {
26 + if (sub->update_strategy.type == SM_UPDATE_COMMAND)
27 + BUG("how did we read update = !command from .gitmodules?");
28 out->type = sub->update_strategy.type;
29 out->command = sub->update_strategy.command;
30 } else
31 --
32 2.24.0.393.g34dc348eaf