]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Git 2.33.3 v2.33.3
authorJunio C Hamano <gitster@pobox.com>
Wed, 13 Apr 2022 22:21:28 +0000 (15:21 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 13 Apr 2022 22:21:28 +0000 (15:21 -0700)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/RelNotes/2.30.4.txt [new file with mode: 0644]
Documentation/RelNotes/2.31.3.txt [new file with mode: 0644]
Documentation/RelNotes/2.32.2.txt [new file with mode: 0644]
Documentation/RelNotes/2.33.3.txt [new file with mode: 0644]
Documentation/config/safe.txt
GIT-VERSION-GEN
RelNotes
setup.c
t/t0033-safe-directory.sh [new file with mode: 0755]

diff --git a/Documentation/RelNotes/2.30.4.txt b/Documentation/RelNotes/2.30.4.txt
new file mode 100644 (file)
index 0000000..4eedb74
--- /dev/null
@@ -0,0 +1,21 @@
+Git v2.30.4 Release Notes
+=========================
+
+This release contains minor fix-ups for the changes that went into
+Git 2.30.3, which was made to address CVE-2022-24765.
+
+ * The code that was meant to parse the new `safe.directory`
+   configuration variable was not checking what configuration
+   variable was being fed to it, which has been corrected.
+
+ * '*' can be used as the value for the `safe.directory` variable to
+   signal that the user considers that any directory is safe.
+
+
+
+Derrick Stolee (2):
+      t0033: add tests for safe.directory
+      setup: opt-out of check with safe.directory=*
+
+Matheus Valadares (1):
+      setup: fix safe.directory key not being checked
diff --git a/Documentation/RelNotes/2.31.3.txt b/Documentation/RelNotes/2.31.3.txt
new file mode 100644 (file)
index 0000000..ca143ab
--- /dev/null
@@ -0,0 +1,4 @@
+Git Documentation/RelNotes/2.31.3.txt Release Notes
+=========================
+
+This release merges up the fixes that appear in v2.31.3.
diff --git a/Documentation/RelNotes/2.32.2.txt b/Documentation/RelNotes/2.32.2.txt
new file mode 100644 (file)
index 0000000..cf49695
--- /dev/null
@@ -0,0 +1,4 @@
+Git Documentation/RelNotes/2.32.2.txt Release Notes
+=========================
+
+This release merges up the fixes that appear in v2.32.2.
diff --git a/Documentation/RelNotes/2.33.3.txt b/Documentation/RelNotes/2.33.3.txt
new file mode 100644 (file)
index 0000000..e2bada1
--- /dev/null
@@ -0,0 +1,4 @@
+Git Documentation/RelNotes/2.33.3.txt Release Notes
+=========================
+
+This release merges up the fixes that appear in v2.33.3.
index 63597b2df8f80f543efad8ba6f6bb784bbc895dc..6d764fe0ccf3a87dbfeb34da03b7e1dcb380ac99 100644 (file)
@@ -19,3 +19,10 @@ line option `-c safe.directory=<path>`.
 The value of this setting is interpolated, i.e. `~/<path>` expands to a
 path relative to the home directory and `%(prefix)/<path>` expands to a
 path relative to Git's (runtime) prefix.
++
+To completely opt-out of this security check, set `safe.directory` to the
+string `*`. This will allow all repositories to be treated as if their
+directory was listed in the `safe.directory` list. If `safe.directory=*`
+is set in system config and you want to re-enable this protection, then
+initialize your list with an empty value before listing the repositories
+that you deem safe.
index d81eab5f00fa8ae6cf60fe810b399d24ca5309c7..86a3a2870c975e3eb42d087c00b739c7257d4b5d 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=GIT-VERSION-FILE
-DEF_VER=v2.33.2
+DEF_VER=v2.33.3
 
 LF='
 '
index 8e79de2efe22d97c3d59a5675157ef76a36cf808..899139d9ec73b18cb8b5a5fd06e04ea64f58704a 120000 (symlink)
--- a/RelNotes
+++ b/RelNotes
@@ -1 +1 @@
-Documentation/RelNotes/2.33.2.txt
\ No newline at end of file
+Documentation/RelNotes/2.33.3.txt
\ No newline at end of file
diff --git a/setup.c b/setup.c
index 2ed94baac92091baf5bcb31fa3b7acbf712b26c9..a9161acbe204fe680c2ee4d399f3ea5c788a525b 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -1035,9 +1035,14 @@ static int safe_directory_cb(const char *key, const char *value, void *d)
 {
        struct safe_directory_data *data = d;
 
-       if (!value || !*value)
+       if (strcmp(key, "safe.directory"))
+               return 0;
+
+       if (!value || !*value) {
                data->is_safe = 0;
-       else {
+       } else if (!strcmp(value, "*")) {
+               data->is_safe = 1;
+       } else {
                const char *interpolated = NULL;
 
                if (!git_config_pathname(&interpolated, key, value) &&
@@ -1054,7 +1059,8 @@ static int ensure_valid_ownership(const char *path)
 {
        struct safe_directory_data data = { .path = path };
 
-       if (is_path_owned_by_current_user(path))
+       if (!git_env_bool("GIT_TEST_ASSUME_DIFFERENT_OWNER", 0) &&
+           is_path_owned_by_current_user(path))
                return 1;
 
        read_very_early_config(safe_directory_cb, &data);
diff --git a/t/t0033-safe-directory.sh b/t/t0033-safe-directory.sh
new file mode 100755 (executable)
index 0000000..239d93f
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+test_description='verify safe.directory checks'
+
+. ./test-lib.sh
+
+GIT_TEST_ASSUME_DIFFERENT_OWNER=1
+export GIT_TEST_ASSUME_DIFFERENT_OWNER
+
+expect_rejected_dir () {
+       test_must_fail git status 2>err &&
+       grep "safe.directory" err
+}
+
+test_expect_success 'safe.directory is not set' '
+       expect_rejected_dir
+'
+
+test_expect_success 'safe.directory does not match' '
+       git config --global safe.directory bogus &&
+       expect_rejected_dir
+'
+
+test_expect_success 'path exist as different key' '
+       git config --global foo.bar "$(pwd)" &&
+       expect_rejected_dir
+'
+
+test_expect_success 'safe.directory matches' '
+       git config --global --add safe.directory "$(pwd)" &&
+       git status
+'
+
+test_expect_success 'safe.directory matches, but is reset' '
+       git config --global --add safe.directory "" &&
+       expect_rejected_dir
+'
+
+test_expect_success 'safe.directory=*' '
+       git config --global --add safe.directory "*" &&
+       git status
+'
+
+test_expect_success 'safe.directory=*, but is reset' '
+       git config --global --add safe.directory "" &&
+       expect_rejected_dir
+'
+
+test_done