From 898225ba0419f3a2fabdf11750a90031a838f3b3 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 17 Mar 2022 10:35:52 +0100 Subject: GIT-VERSION-GEN: bump to v2.33.1 This was missed in af6d1d602a8f (Git 2.33.1, 2021-10-12). Signed-off-by: Johannes Schindelin --- GIT-VERSION-GEN | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index b1c0d4eb2e..11aac6e397 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v2.33.0 +DEF_VER=v2.33.1 LF=' ' -- cgit v1.2.3 From 6e7ad1e4c22e7038975ba37c7413374fe566b064 Mon Sep 17 00:00:00 2001 From: Carlo Marcelo Arenas Belón Date: Sat, 27 Nov 2021 10:15:32 +0000 Subject: mingw: avoid fallback for {local,gm}time_r() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mingw-w64's pthread_unistd.h had a bug that mistakenly (because there is no support for the *lockfile() functions required[1]) defined _POSIX_THREAD_SAFE_FUNCTIONS and that was being worked around since 3ecd153a3b (compat/mingw: support MSys2-based MinGW build, 2016-01-14). The bug was fixed in winphtreads, but as a side effect, leaves the reentrant functions from time.h no longer visible and therefore breaks the build. Since the intention all along was to avoid using the fallback functions, formalize the use of POSIX by setting the corresponding feature flag and compile out the implementation for the fallback functions. [1] https://unix.org/whitepapers/reentrant.html Signed-off-by: Carlo Marcelo Arenas Belón Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- compat/mingw.c | 2 ++ git-compat-util.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/compat/mingw.c b/compat/mingw.c index a43599841c..abb4d26ce9 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1060,6 +1060,7 @@ int pipe(int filedes[2]) return 0; } +#ifndef __MINGW64__ struct tm *gmtime_r(const time_t *timep, struct tm *result) { if (gmtime_s(result, timep) == 0) @@ -1073,6 +1074,7 @@ struct tm *localtime_r(const time_t *timep, struct tm *result) return result; return NULL; } +#endif char *mingw_getcwd(char *pointer, int len) { diff --git a/git-compat-util.h b/git-compat-util.h index 7d3db43f11..3da9f975e2 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -127,7 +127,9 @@ /* Approximation of the length of the decimal representation of this type. */ #define decimal_length(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1) -#if defined(__sun__) +#ifdef __MINGW64__ +#define _POSIX_C_SOURCE 1 +#elif defined(__sun__) /* * On Solaris, when _XOPEN_EXTENDED is set, its header file * forces the programs to be XPG4v2, defeating any _XOPEN_SOURCE -- cgit v1.2.3 From bdc77d1d685be9c10b88abb281a42bc620548595 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 2 Mar 2022 11:06:24 +0100 Subject: Add a function to determine whether a path is owned by the current user This function will be used in the next commit to prevent `setup_git_directory()` from discovering a repository in a directory that is owned by someone other than the current user. Note: We cannot simply use `st.st_uid` on Windows just like we do on Linux and other Unix-like platforms: according to https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/stat-functions this field is always zero on Windows (because Windows' idea of a user ID does not fit into a single numerical value). Therefore, we have to do something a little involved to replicate the same functionality there. Also note: On Windows, a user's home directory is not actually owned by said user, but by the administrator. For all practical purposes, it is under the user's control, though, therefore we pretend that it is owned by the user. Signed-off-by: Johannes Schindelin --- compat/mingw.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ compat/mingw.h | 7 +++++ git-compat-util.h | 12 ++++++++ 3 files changed, 106 insertions(+) diff --git a/compat/mingw.c b/compat/mingw.c index abb4d26ce9..38ac35913d 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1,5 +1,6 @@ #include "../git-compat-util.h" #include "win32.h" +#include #include #include #include "../strbuf.h" @@ -2601,6 +2602,92 @@ static void setup_windows_environment(void) } } +static PSID get_current_user_sid(void) +{ + HANDLE token; + DWORD len = 0; + PSID result = NULL; + + if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token)) + return NULL; + + if (!GetTokenInformation(token, TokenUser, NULL, 0, &len)) { + TOKEN_USER *info = xmalloc((size_t)len); + if (GetTokenInformation(token, TokenUser, info, len, &len)) { + len = GetLengthSid(info->User.Sid); + result = xmalloc(len); + if (!CopySid(len, result, info->User.Sid)) { + error(_("failed to copy SID (%ld)"), + GetLastError()); + FREE_AND_NULL(result); + } + } + FREE_AND_NULL(info); + } + CloseHandle(token); + + return result; +} + +int is_path_owned_by_current_sid(const char *path) +{ + WCHAR wpath[MAX_PATH]; + PSID sid = NULL; + PSECURITY_DESCRIPTOR descriptor = NULL; + DWORD err; + + static wchar_t home[MAX_PATH]; + + int result = 0; + + if (xutftowcs_path(wpath, path) < 0) + return 0; + + /* + * On Windows, the home directory is owned by the administrator, but for + * all practical purposes, it belongs to the user. Do pretend that it is + * owned by the user. + */ + if (!*home) { + DWORD size = ARRAY_SIZE(home); + DWORD len = GetEnvironmentVariableW(L"HOME", home, size); + if (!len || len > size) + wcscpy(home, L"::N/A::"); + } + if (!wcsicmp(wpath, home)) + return 1; + + /* Get the owner SID */ + err = GetNamedSecurityInfoW(wpath, SE_FILE_OBJECT, + OWNER_SECURITY_INFORMATION | + DACL_SECURITY_INFORMATION, + &sid, NULL, NULL, NULL, &descriptor); + + if (err != ERROR_SUCCESS) + error(_("failed to get owner for '%s' (%ld)"), path, err); + else if (sid && IsValidSid(sid)) { + /* Now, verify that the SID matches the current user's */ + static PSID current_user_sid; + + if (!current_user_sid) + current_user_sid = get_current_user_sid(); + + if (current_user_sid && + IsValidSid(current_user_sid) && + EqualSid(sid, current_user_sid)) + result = 1; + } + + /* + * We can release the security descriptor struct only now because `sid` + * actually points into this struct. + */ + if (descriptor) + LocalFree(descriptor); + + return result; +} + int is_valid_win32_path(const char *path, int allow_literal_nul) { const char *p = path; diff --git a/compat/mingw.h b/compat/mingw.h index af8eddd73e..f6bab548f4 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -452,6 +452,13 @@ char *mingw_query_user_email(void); #include #endif +/** + * Verifies that the specified path is owned by the user running the + * current process. + */ +int is_path_owned_by_current_sid(const char *path); +#define is_path_owned_by_current_user is_path_owned_by_current_sid + /** * Verifies that the given path is a valid one on Windows. * diff --git a/git-compat-util.h b/git-compat-util.h index 3da9f975e2..63ba89dd31 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -392,6 +392,18 @@ static inline int git_offset_1st_component(const char *path) #define is_valid_path(path) 1 #endif +#ifndef is_path_owned_by_current_user +static inline int is_path_owned_by_current_uid(const char *path) +{ + struct stat st; + if (lstat(path, &st)) + return 0; + return st.st_uid == geteuid(); +} + +#define is_path_owned_by_current_user is_path_owned_by_current_uid +#endif + #ifndef find_last_dir_sep static inline char *git_find_last_dir_sep(const char *path) { -- cgit v1.2.3 From 8959555cee7ec045958f9b6dd62e541affb7e7d9 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 2 Mar 2022 12:23:04 +0100 Subject: setup_git_directory(): add an owner check for the top-level directory It poses a security risk to search for a git directory outside of the directories owned by the current user. For example, it is common e.g. in computer pools of educational institutes to have a "scratch" space: a mounted disk with plenty of space that is regularly swiped where any authenticated user can create a directory to do their work. Merely navigating to such a space with a Git-enabled `PS1` when there is a maliciously-crafted `/scratch/.git/` can lead to a compromised account. The same holds true in multi-user setups running Windows, as `C:\` is writable to every authenticated user by default. To plug this vulnerability, we stop Git from accepting top-level directories owned by someone other than the current user. We avoid looking at the ownership of each and every directories between the current and the top-level one (if there are any between) to avoid introducing a performance bottleneck. This new default behavior is obviously incompatible with the concept of shared repositories, where we expect the top-level directory to be owned by only one of its legitimate users. To re-enable that use case, we add support for adding exceptions from the new default behavior via the config setting `safe.directory`. The `safe.directory` config setting is only respected in the system and global configs, not from repository configs or via the command-line, and can have multiple values to allow for multiple shared repositories. We are particularly careful to provide a helpful message to any user trying to use a shared repository. Signed-off-by: Johannes Schindelin --- Documentation/config.txt | 2 ++ Documentation/config/safe.txt | 21 ++++++++++++++++ setup.c | 57 ++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 Documentation/config/safe.txt diff --git a/Documentation/config.txt b/Documentation/config.txt index 6ba50b1104..34e6d477d6 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -438,6 +438,8 @@ include::config/rerere.txt[] include::config/reset.txt[] +include::config/safe.txt[] + include::config/sendemail.txt[] include::config/sequencer.txt[] diff --git a/Documentation/config/safe.txt b/Documentation/config/safe.txt new file mode 100644 index 0000000000..63597b2df8 --- /dev/null +++ b/Documentation/config/safe.txt @@ -0,0 +1,21 @@ +safe.directory:: + These config entries specify Git-tracked directories that are + considered safe even if they are owned by someone other than the + current user. By default, Git will refuse to even parse a Git + config of a repository owned by someone else, let alone run its + hooks, and this config setting allows users to specify exceptions, + e.g. for intentionally shared repositories (see the `--shared` + option in linkgit:git-init[1]). ++ +This is a multi-valued setting, i.e. you can add more than one directory +via `git config --add`. To reset the list of safe directories (e.g. to +override any such directories specified in the system config), add a +`safe.directory` entry with an empty value. ++ +This config setting is only respected when specified in a system or global +config, not when it is specified in a repository config or via the command +line option `-c safe.directory=`. ++ +The value of this setting is interpolated, i.e. `~/` expands to a +path relative to the home directory and `%(prefix)/` expands to a +path relative to Git's (runtime) prefix. diff --git a/setup.c b/setup.c index c04cd25a30..95d5b00940 100644 --- a/setup.c +++ b/setup.c @@ -5,6 +5,7 @@ #include "string-list.h" #include "chdir-notify.h" #include "promisor-remote.h" +#include "quote.h" static int inside_git_dir = -1; static int inside_work_tree = -1; @@ -1024,6 +1025,42 @@ static int canonicalize_ceiling_entry(struct string_list_item *item, } } +struct safe_directory_data { + const char *path; + int is_safe; +}; + +static int safe_directory_cb(const char *key, const char *value, void *d) +{ + struct safe_directory_data *data = d; + + if (!value || !*value) + data->is_safe = 0; + else { + const char *interpolated = NULL; + + if (!git_config_pathname(&interpolated, key, value) && + !fspathcmp(data->path, interpolated ? interpolated : value)) + data->is_safe = 1; + + free((char *)interpolated); + } + + return 0; +} + +static int ensure_valid_ownership(const char *path) +{ + struct safe_directory_data data = { .path = path }; + + if (is_path_owned_by_current_user(path)) + return 1; + + read_very_early_config(safe_directory_cb, &data); + + return data.is_safe; +} + enum discovery_result { GIT_DIR_NONE = 0, GIT_DIR_EXPLICIT, @@ -1032,7 +1069,8 @@ enum discovery_result { /* these are errors */ GIT_DIR_HIT_CEILING = -1, GIT_DIR_HIT_MOUNT_POINT = -2, - GIT_DIR_INVALID_GITFILE = -3 + GIT_DIR_INVALID_GITFILE = -3, + GIT_DIR_INVALID_OWNERSHIP = -4 }; /* @@ -1122,11 +1160,15 @@ static enum discovery_result setup_git_directory_gently_1(struct strbuf *dir, } strbuf_setlen(dir, offset); if (gitdirenv) { + if (!ensure_valid_ownership(dir->buf)) + return GIT_DIR_INVALID_OWNERSHIP; strbuf_addstr(gitdir, gitdirenv); return GIT_DIR_DISCOVERED; } if (is_git_directory(dir->buf)) { + if (!ensure_valid_ownership(dir->buf)) + return GIT_DIR_INVALID_OWNERSHIP; strbuf_addstr(gitdir, "."); return GIT_DIR_BARE; } @@ -1253,6 +1295,19 @@ const char *setup_git_directory_gently(int *nongit_ok) dir.buf); *nongit_ok = 1; break; + case GIT_DIR_INVALID_OWNERSHIP: + if (!nongit_ok) { + struct strbuf quoted = STRBUF_INIT; + + sq_quote_buf_pretty("ed, dir.buf); + die(_("unsafe repository ('%s' is owned by someone else)\n" + "To add an exception for this directory, call:\n" + "\n" + "\tgit config --global --add safe.directory %s"), + dir.buf, quoted.buf); + } + *nongit_ok = 1; + break; case GIT_DIR_NONE: /* * As a safeguard against setup_git_directory_gently_1 returning -- cgit v1.2.3 From fdcad5a53e14bd397e4fa323e7fd0c3bf16dd373 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 23 Mar 2022 23:00:41 +0100 Subject: Fix `GIT_CEILING_DIRECTORIES` with `C:\` and the likes When determining the length of the longest ancestor of a given path with respect to to e.g. `GIT_CEILING_DIRECTORIES`, we special-case the root directory by returning 0 (i.e. we pretend that the path `/` does not end in a slash by virtually stripping it). That is the correct behavior because when normalizing paths, the root directory is special: all other directory paths have their trailing slash stripped, but not the root directory's path (because it would become the empty string, which is not a legal path). However, this special-casing of the root directory in `longest_ancestor_length()` completely forgets about Windows-style root directories, e.g. `C:\`. These _also_ get normalized with a trailing slash (because `C:` would actually refer to the current directory on that drive, not necessarily to its root directory). In fc56c7b34b (mingw: accomodate t0060-path-utils for MSYS2, 2016-01-27), we almost got it right. We noticed that `longest_ancestor_length()` expects a slash _after_ the matched prefix, and if the prefix already ends in a slash, the normalized path won't ever match and -1 is returned. But then that commit went astray: The correct fix is not to adjust the _tests_ to expect an incorrect -1 when that function is fed a prefix that ends in a slash, but instead to treat such a prefix as if the trailing slash had been removed. Likewise, that function needs to handle the case where it is fed a path that ends in a slash (not only a prefix that ends in a slash): if it matches the prefix (plus trailing slash), we still need to verify that the path does not end there, otherwise the prefix is not actually an ancestor of the path but identical to it (and we need to return -1 in that case). With these two adjustments, we no longer need to play games in t0060 where we only add `$rootoff` if the passed prefix is different from the MSYS2 pseudo root, instead we also add it for the MSYS2 pseudo root itself. We do have to be careful to skip that logic entirely for Windows paths, though, because they do are not subject to that MSYS2 pseudo root treatment. This patch fixes the scenario where a user has set `GIT_CEILING_DIRECTORIES=C:\`, which would be ignored otherwise. Signed-off-by: Johannes Schindelin --- path.c | 14 +++++++++----- t/t0060-path-utils.sh | 20 ++++++++++++++------ 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/path.c b/path.c index 7b385e5eb2..853e7165c8 100644 --- a/path.c +++ b/path.c @@ -1218,11 +1218,15 @@ int longest_ancestor_length(const char *path, struct string_list *prefixes) const char *ceil = prefixes->items[i].string; int len = strlen(ceil); - if (len == 1 && ceil[0] == '/') - len = 0; /* root matches anything, with length 0 */ - else if (!strncmp(path, ceil, len) && path[len] == '/') - ; /* match of length len */ - else + /* + * For root directories (`/`, `C:/`, `//server/share/`) + * adjust the length to exclude the trailing slash. + */ + if (len > 0 && ceil[len - 1] == '/') + len--; + + if (strncmp(path, ceil, len) || + path[len] != '/' || !path[len + 1]) continue; /* no match */ if (len > max_len) diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh index 56db5c8aba..f538264cdd 100755 --- a/t/t0060-path-utils.sh +++ b/t/t0060-path-utils.sh @@ -55,12 +55,15 @@ fi ancestor() { # We do some math with the expected ancestor length. expected=$3 - if test -n "$rootoff" && test "x$expected" != x-1; then - expected=$(($expected-$rootslash)) - test $expected -lt 0 || - expected=$(($expected+$rootoff)) - fi - test_expect_success "longest ancestor: $1 $2 => $expected" \ + case "$rootoff,$expected,$2" in + *,*,//*) ;; # leave UNC paths alone + [0-9]*,[0-9]*,/*) + # On Windows, expect MSYS2 pseudo root translation for + # Unix-style absolute paths + expected=$(($expected-$rootslash+$rootoff)) + ;; + esac + test_expect_success $4 "longest ancestor: $1 $2 => $expected" \ "actual=\$(test-tool path-utils longest_ancestor_length '$1' '$2') && test \"\$actual\" = '$expected'" } @@ -156,6 +159,11 @@ ancestor /foo/bar /foo 4 ancestor /foo/bar /foo:/bar 4 ancestor /foo/bar /bar -1 +# Windows-specific: DOS drives, network shares +ancestor C:/Users/me C:/ 2 MINGW +ancestor D:/Users/me C:/ -1 MINGW +ancestor //server/share/my-directory //server/share/ 14 MINGW + test_expect_success 'strip_path_suffix' ' test c:/msysgit = $(test-tool path-utils strip_path_suffix \ c:/msysgit/libexec//git-core libexec/git-core) -- cgit v1.2.3 From cb95038137e9e66fc6a6b4a0e8db62bcc521b709 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 17 Mar 2022 10:15:15 +0100 Subject: Git 2.30.3 Signed-off-by: Johannes Schindelin --- Documentation/RelNotes/2.30.3.txt | 24 ++++++++++++++++++++++++ GIT-VERSION-GEN | 2 +- RelNotes | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 Documentation/RelNotes/2.30.3.txt diff --git a/Documentation/RelNotes/2.30.3.txt b/Documentation/RelNotes/2.30.3.txt new file mode 100644 index 0000000000..31b2a4daa6 --- /dev/null +++ b/Documentation/RelNotes/2.30.3.txt @@ -0,0 +1,24 @@ +Git v2.30.2 Release Notes +========================= + +This release addresses the security issue CVE-2022-24765. + +Fixes since v2.30.2 +------------------- + + * Build fix on Windows. + + * Fix `GIT_CEILING_DIRECTORIES` with Windows-style root directories. + + * CVE-2022-24765: + On multi-user machines, Git users might find themselves + unexpectedly in a Git worktree, e.g. when another user created a + repository in `C:\.git`, in a mounted network drive or in a + scratch space. Merely having a Git-aware prompt that runs `git + status` (or `git diff`) and navigating to a directory which is + supposedly not a Git worktree, or opening such a directory in an + editor or IDE such as VS Code or Atom, will potentially run + commands defined by that other user. + +Credit for finding this vulnerability goes to 俞晨东; The fix was +authored by Johannes Schindelin. diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 9d789e0efc..7cf68be76f 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v2.30.2 +DEF_VER=v2.30.3 LF=' ' diff --git a/RelNotes b/RelNotes index d73be92065..187351ccd9 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes/2.30.2.txt \ No newline at end of file +Documentation/RelNotes/2.30.3.txt \ No newline at end of file -- cgit v1.2.3 From 44de39c45c65134f4a6e02e7702a5db70a71041d Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 17 Mar 2022 10:57:32 +0100 Subject: Git 2.31.2 Signed-off-by: Johannes Schindelin --- Documentation/RelNotes/2.31.2.txt | 6 ++++++ GIT-VERSION-GEN | 2 +- RelNotes | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 Documentation/RelNotes/2.31.2.txt diff --git a/Documentation/RelNotes/2.31.2.txt b/Documentation/RelNotes/2.31.2.txt new file mode 100644 index 0000000000..aa13a5b022 --- /dev/null +++ b/Documentation/RelNotes/2.31.2.txt @@ -0,0 +1,6 @@ +Git v2.31.2 Release Notes +========================= + +This release merges up the fixes that appear in v2.30.3 to address +the security issue CVE-2022-24765; see the release notes for that +version for details. diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 36ab53e153..2498affd30 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v2.31.1 +DEF_VER=v2.31.2 LF=' ' diff --git a/RelNotes b/RelNotes index 07f22a5d65..dff85391eb 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes/2.31.1.txt \ No newline at end of file +Documentation/RelNotes/2.31.2.txt \ No newline at end of file -- cgit v1.2.3 From 9bcd7a8ecac1c9196bc927647bd06c38ec1feabe Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 17 Mar 2022 10:57:38 +0100 Subject: Git 2.32.1 Signed-off-by: Johannes Schindelin --- Documentation/RelNotes/2.32.1.txt | 6 ++++++ GIT-VERSION-GEN | 2 +- RelNotes | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 Documentation/RelNotes/2.32.1.txt diff --git a/Documentation/RelNotes/2.32.1.txt b/Documentation/RelNotes/2.32.1.txt new file mode 100644 index 0000000000..7dcca13b92 --- /dev/null +++ b/Documentation/RelNotes/2.32.1.txt @@ -0,0 +1,6 @@ +Git v2.32.1 Release Notes +========================= + +This release merges up the fixes that appear in v2.30.3 and +v2.31.2 to address the security issue CVE-2022-24765; see the +release notes for these versions for details. diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 9c125f298a..c462040198 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v2.32.0 +DEF_VER=v2.32.1 LF=' ' diff --git a/RelNotes b/RelNotes index aece21e8a4..da84ed1cd7 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes/2.32.0.txt \ No newline at end of file +Documentation/RelNotes/2.32.1.txt \ No newline at end of file -- cgit v1.2.3 From 87ed4fc046840706138d46e0033a009e74c3887a Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 17 Mar 2022 10:57:44 +0100 Subject: Git 2.33.2 Signed-off-by: Johannes Schindelin --- Documentation/RelNotes/2.33.2.txt | 15 +++++++++++++++ GIT-VERSION-GEN | 2 +- RelNotes | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 Documentation/RelNotes/2.33.2.txt diff --git a/Documentation/RelNotes/2.33.2.txt b/Documentation/RelNotes/2.33.2.txt new file mode 100644 index 0000000000..e504489d61 --- /dev/null +++ b/Documentation/RelNotes/2.33.2.txt @@ -0,0 +1,15 @@ +Git v2.33.2 Release Notes +========================= + +This release merges up the fixes that appear in v2.30.3, v2.31.2 +and v2.32.1 to address the security issue CVE-2022-24765; see +the release notes for these versions for details. + +In addition, it contains the following fixes: + + * Squelch over-eager warning message added during this cycle. + + * A bug in "git rebase -r" has been fixed. + + * One CI task based on Fedora image noticed a not-quite-kosher + construct recently, which has been corrected. diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 11aac6e397..d81eab5f00 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v2.33.1 +DEF_VER=v2.33.2 LF=' ' diff --git a/RelNotes b/RelNotes index 567659e5a3..8e79de2efe 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes/2.33.1.txt \ No newline at end of file +Documentation/RelNotes/2.33.2.txt \ No newline at end of file -- cgit v1.2.3 From 4d0b43aa765a0056c88381eea862364c95e358ca Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 17 Mar 2022 10:57:52 +0100 Subject: Git 2.34.2 Signed-off-by: Johannes Schindelin --- Documentation/RelNotes/2.34.2.txt | 6 ++++++ GIT-VERSION-GEN | 2 +- RelNotes | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 Documentation/RelNotes/2.34.2.txt diff --git a/Documentation/RelNotes/2.34.2.txt b/Documentation/RelNotes/2.34.2.txt new file mode 100644 index 0000000000..0c32cd844b --- /dev/null +++ b/Documentation/RelNotes/2.34.2.txt @@ -0,0 +1,6 @@ +Git v2.34.2 Release Notes +========================= + +This release merges up the fixes that appear in v2.30.3, v2.31.2, +v2.32.1 and v2.33.2 to address the security issue CVE-2022-24765; +see the release notes for these versions for details. diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 991308dfaf..81dd339513 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v2.34.1 +DEF_VER=v2.34.2 LF=' ' diff --git a/RelNotes b/RelNotes index 30a5e48971..01d62667bf 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes/2.34.1.txt \ No newline at end of file +Documentation/RelNotes/2.34.2.txt \ No newline at end of file -- cgit v1.2.3 From 53ef17d3ee0f7fcb151f428ee3bd736b8046825f Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 17 Mar 2022 10:58:00 +0100 Subject: Git 2.35.2 Signed-off-by: Johannes Schindelin --- Documentation/RelNotes/2.35.2.txt | 7 +++++++ GIT-VERSION-GEN | 2 +- RelNotes | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 Documentation/RelNotes/2.35.2.txt diff --git a/Documentation/RelNotes/2.35.2.txt b/Documentation/RelNotes/2.35.2.txt new file mode 100644 index 0000000000..290bfa9ea4 --- /dev/null +++ b/Documentation/RelNotes/2.35.2.txt @@ -0,0 +1,7 @@ +Git v2.35.2 Release Notes +========================= + +This release merges up the fixes that appear in v2.30.3, +v2.31.2, v2.32.1, v2.33.2 and v2.34.2 to address the security +issue CVE-2022-24765; see the release notes for these versions +for details. diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index b3cf1ff939..3a7a9f0438 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v2.35.1 +DEF_VER=v2.35.2 LF=' ' diff --git a/RelNotes b/RelNotes index d7b83df043..286559e32e 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes/2.35.1.txt \ No newline at end of file +Documentation/RelNotes/2.35.2.txt \ No newline at end of file -- cgit v1.2.3 From 350296cc78912c245847ec65e55143053450cce1 Mon Sep 17 00:00:00 2001 From: Josh Steadmon Date: Mon, 4 Apr 2022 15:42:24 -0700 Subject: ls-tree: `-l` should not imply recursive listing In 9c4d58ff2c (ls-tree: split up "fast path" callbacks, 2022-03-23), a refactoring of the various read_tree_at() callbacks caused us to unconditionally recurse into directories if `-l` (long format) was passed on the command line, regardless of whether or not we also pass the `-r` (recursive) flag. Fix this by making show_tree_long() return the value of `recurse`, rather than always returning 1. This value is interpreted by read_tree_at() to be a signal on whether or not to recurse. Signed-off-by: Josh Steadmon Signed-off-by: Junio C Hamano --- builtin/ls-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c index 44a91cf9d0..696d94b8b8 100644 --- a/builtin/ls-tree.c +++ b/builtin/ls-tree.c @@ -255,7 +255,7 @@ static int show_tree_long(const struct object_id *oid, struct strbuf *base, printf("%06o %s %s %7s\t", data.mode, type_name(data.type), find_unique_abbrev(data.oid, abbrev), size_text); show_tree_common_default_long(base, pathname, data.base->len); - return 1; + return recurse; } static int show_tree_name_only(const struct object_id *oid, struct strbuf *base, -- cgit v1.2.3 From 5b52d9f15e311b82ee5f5c5ed9927c65b63731bf Mon Sep 17 00:00:00 2001 From: Carlo Marcelo Arenas Belón Date: Mon, 4 Apr 2022 21:28:26 -0700 Subject: git-compat-util: really support openssl as a source of entropy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 05cd988dce5 (wrapper: add a helper to generate numbers from a CSPRNG, 2022-01-17), configure openssl as the source for entropy in NON-STOP but doesn't add the needed header or link options. Since the only system that is configured to use openssl as a source of entropy is NON-STOP, add the header unconditionally, and -lcrypto to the list of external libraries. An additional change is required to make sure a NO_OPENSSL=1 build will be able to work as well (tested on Linux with a modified value of CSPRNG_METHOD = openssl), and the more complex logic that allows for compatibility with APPLE_COMMON_CRYPTO or allowing for simpler ways to link (without libssl) has been punted for now. Reported-by: Randall Becker Signed-off-by: Carlo Marcelo Arenas Belón Signed-off-by: Junio C Hamano --- Makefile | 1 + git-compat-util.h | 4 ++++ imap-send.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 198b759e76..e106728194 100644 --- a/Makefile +++ b/Makefile @@ -1940,6 +1940,7 @@ endif ifneq ($(findstring openssl,$(CSPRNG_METHOD)),) BASIC_CFLAGS += -DHAVE_OPENSSL_CSPRNG + EXTLIBS += -lcrypto -lssl endif ifneq ($(PROCFS_EXECUTABLE_PATH),) diff --git a/git-compat-util.h b/git-compat-util.h index 50597c76be..f439f2691d 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -521,6 +521,10 @@ void warning_errno(const char *err, ...) __attribute__((format (printf, 1, 2))); #include #endif /* NO_OPENSSL */ +#ifdef HAVE_OPENSSL_CSPRNG +#include +#endif + /* * Let callers be aware of the constant return value; this can help * gcc with -Wuninitialized analysis. We restrict this trick to gcc, though, diff --git a/imap-send.c b/imap-send.c index e6090a0346..c091b4e94b 100644 --- a/imap-send.c +++ b/imap-send.c @@ -27,7 +27,7 @@ #include "exec-cmd.h" #include "run-command.h" #include "parse-options.h" -#ifdef NO_OPENSSL +#if defined(NO_OPENSSL) && !defined(HAVE_OPENSSL_CSPRNG) typedef void *SSL; #endif #ifdef USE_CURL_FOR_IMAP_SEND -- cgit v1.2.3 From 2e37594797155e5d6134db3ce1e23bf42045934b Mon Sep 17 00:00:00 2001 From: Adam Dinwoodie Date: Tue, 5 Apr 2022 11:00:20 +0100 Subject: configure.ac: fix HAVE_SYNC_FILE_RANGE definition If sync_file_range is not available when building the configure script, there is a cosmetic bug when running that script reporting "HAVE_SYNC_FILE_RANGE: command not found". Remove that error message by defining HAVE_SYNC_FILE_RANGE to an empty string, rather than generating a script where that appears as a bare command. Signed-off-by: Adam Dinwoodie Signed-off-by: Junio C Hamano --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6bd6bef1c4..316a31d231 100644 --- a/configure.ac +++ b/configure.ac @@ -1087,7 +1087,7 @@ GIT_CONF_SUBST([HAVE_CLOCK_MONOTONIC]) # Define HAVE_SYNC_FILE_RANGE=YesPlease if sync_file_range is available. GIT_CHECK_FUNC(sync_file_range, [HAVE_SYNC_FILE_RANGE=YesPlease], - [HAVE_SYNC_FILE_RANGE]) + [HAVE_SYNC_FILE_RANGE=]) GIT_CONF_SUBST([HAVE_SYNC_FILE_RANGE]) # -- cgit v1.2.3 From 8af0699b7a86a6f3c2fe9b745bcbe56ec777feac Mon Sep 17 00:00:00 2001 From: Ævar Arnfjörð Bjarmason Date: Tue, 5 Apr 2022 21:56:20 +0200 Subject: Documentation/Makefile: fix "make info" regression in dad9cd7d518 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix a regression in my dad9cd7d518 (Makefile: move ".SUFFIXES" rule to shared.mak, 2022-03-03). As explained in the GNU make documentation for the $* variable, available at: info make --index-search='$*' This rule relied on ".texi" being in the default list of suffixes, as seen at: make -f/dev/null -p | grep -v -e ^# -e ^$|grep -F .SUFFIXES The documentation explains what was going on here: In an explicit rule, there is no stem; so '$*' cannot be determined in that way. Instead, if the target name ends with a recognized suffix (*note Old-Fashioned Suffix Rules: Suffix Rules.), '$*' is set to the target name minus the suffix. For example, if the target name is 'foo.c', then '$*' is set to 'foo', since '.c' is a suffix. GNU 'make' does this bizarre thing only for compatibility with other implementations of 'make'. You should generally avoid using '$*' except in implicit rules or static pattern rules. If the target name in an explicit rule does not end with a recognized suffix, '$*' is set to the empty string for that rule. I.e. this rule added back in 5cefc33bffd (Documentation: add gitman.info target, 2007-12-10) was resolving gitman.texi from gitman.info. We can instead just use the more obvious $< variable referring to the prerequisite. This was the only use of $* in our Makefiles in an explicit rule, the three remaining ones are all implicit rules, and therefore didn't depend on the ".SUFFIXES" list. Reported-by: Adam Dinwoodie Signed-off-by: Ævar Arnfjörð Bjarmason Tested-by: Adam Dinwoodie Signed-off-by: Junio C Hamano --- Documentation/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index 1eb9192dae..44c080e3e5 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -390,7 +390,7 @@ gitman.texi: $(MAN_XML) cat-texi.perl texi.xsl $(RM) $@+ gitman.info: gitman.texi - $(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $*.texi + $(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $< $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml $(QUIET_DB2TEXI)$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@ -- cgit v1.2.3 From f2a2876f5a4a9c5250d8f64bd468677d506a956a Mon Sep 17 00:00:00 2001 From: Victoria Dye Date: Tue, 5 Apr 2022 22:35:36 +0000 Subject: contrib/scalar: fix 'all' target in Makefile Add extra ':' to second 'all' target definition to allow 'scalar' to build. Without this fix, the 'all:' and 'all::' targets together cause a build failure when 'scalar' build is enabled with 'INCLUDE_SCALAR': Makefile:14: *** target file `all' has both : and :: entries. Stop. Signed-off-by: Victoria Dye Signed-off-by: Junio C Hamano --- contrib/scalar/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/scalar/Makefile b/contrib/scalar/Makefile index 5e86d78e19..37f283f35d 100644 --- a/contrib/scalar/Makefile +++ b/contrib/scalar/Makefile @@ -11,7 +11,7 @@ include ../../config.mak.uname TARGETS = scalar$(X) scalar.o GITLIBS = ../../common-main.o ../../libgit.a ../../xdiff/lib.a -all: scalar$(X) ../../bin-wrappers/scalar +all:: scalar$(X) ../../bin-wrappers/scalar $(GITLIBS): $(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) $(subst ../../,,$@) -- cgit v1.2.3 From f3ea4bed2acb129db66c4c9a22dae71576d58066 Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Wed, 6 Apr 2022 14:41:22 -0400 Subject: doc: replace "--" with {litdd} in credential-cache/fsmonitor Asciidoc renders `--` as em-dash. This is not appropriate for command names. It also breaks linkgit links to these commands. Fix git-credential-cache--daemon and git-fsmonitor--daemon. The latter was added 3248486920 (fsmonitor: document builtin fsmonitor, 2022-03-25) and included several links. A check for broken links in the HTML docs turned this up. Manually inspecting the other Documentation/git-*--*.txt files turned up the issue in git-credential-cache--daemon. While here, quote `git credential-cache--daemon` in the synopsis to match the vast majority of our other documentation. Signed-off-by: Todd Zullinger Signed-off-by: Junio C Hamano --- Documentation/config/core.txt | 2 +- Documentation/git-credential-cache--daemon.txt | 6 +++--- Documentation/git-fsmonitor--daemon.txt | 12 ++++++------ Documentation/git-update-index.txt | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Documentation/config/core.txt b/Documentation/config/core.txt index 889522956e..e67392cc83 100644 --- a/Documentation/config/core.txt +++ b/Documentation/config/core.txt @@ -63,7 +63,7 @@ core.protectNTFS:: core.fsmonitor:: If set to true, enable the built-in file system monitor - daemon for this working directory (linkgit:git-fsmonitor--daemon[1]). + daemon for this working directory (linkgit:git-fsmonitor{litdd}daemon[1]). + Like hook-based file system monitors, the built-in file system monitor can speed up Git commands that need to refresh the Git index diff --git a/Documentation/git-credential-cache--daemon.txt b/Documentation/git-credential-cache--daemon.txt index 7051c6bdf8..01e1c214dd 100644 --- a/Documentation/git-credential-cache--daemon.txt +++ b/Documentation/git-credential-cache--daemon.txt @@ -1,5 +1,5 @@ -git-credential-cache--daemon(1) -=============================== +git-credential-cache{litdd}daemon(1) +==================================== NAME ---- @@ -8,7 +8,7 @@ git-credential-cache--daemon - Temporarily store user credentials in memory SYNOPSIS -------- [verse] -git credential-cache--daemon [--debug] +'git credential-cache{litdd}daemon' [--debug] DESCRIPTION ----------- diff --git a/Documentation/git-fsmonitor--daemon.txt b/Documentation/git-fsmonitor--daemon.txt index 0fedf5a456..cc142fb861 100644 --- a/Documentation/git-fsmonitor--daemon.txt +++ b/Documentation/git-fsmonitor--daemon.txt @@ -1,5 +1,5 @@ -git-fsmonitor--daemon(1) -======================== +git-fsmonitor{litdd}daemon(1) +============================= NAME ---- @@ -8,10 +8,10 @@ git-fsmonitor--daemon - A Built-in File System Monitor SYNOPSIS -------- [verse] -'git fsmonitor--daemon' start -'git fsmonitor--daemon' run -'git fsmonitor--daemon' stop -'git fsmonitor--daemon' status +'git fsmonitor{litdd}daemon' start +'git fsmonitor{litdd}daemon' run +'git fsmonitor{litdd}daemon' stop +'git fsmonitor{litdd}daemon' status DESCRIPTION ----------- diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt index 64315e2e8c..5ea2f2c60e 100644 --- a/Documentation/git-update-index.txt +++ b/Documentation/git-update-index.txt @@ -528,7 +528,7 @@ This feature is intended to speed up git operations for repos that have large working directories. It enables git to work together with a file system monitor (see -linkgit:git-fsmonitor--daemon[1] +linkgit:git-fsmonitor{litdd}daemon[1] and the "fsmonitor-watchman" section of linkgit:githooks[5]) that can inform it as to what files have been modified. This enables git to avoid -- cgit v1.2.3 From 5da9560ebc8a089807920a7548141e4e5b60a4dc Mon Sep 17 00:00:00 2001 From: Fangyi Zhou Date: Wed, 6 Apr 2022 21:32:57 +0100 Subject: submodule-helper: fix usage string The missing space at the end of the line makes the closing square bracket sticking to the dash in the next line Found during localisation v2.36.0 round 1 Signed-off-by: Fangyi Zhou Signed-off-by: Junio C Hamano --- builtin/submodule--helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 11552970f2..447c5cfe84 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -1895,7 +1895,7 @@ static int module_clone(int argc, const char **argv, const char *prefix) const char *const git_submodule_helper_usage[] = { N_("git submodule--helper clone [--prefix=] [--quiet] " "[--reference ] [--name ] [--depth ] " - "[--single-branch] [--filter ]" + "[--single-branch] [--filter ] " "--url --path "), NULL }; -- cgit v1.2.3 From 5e65dac9c88d02f569cc87cdf630ecb5a780c6a6 Mon Sep 17 00:00:00 2001 From: Martin Ågren Date: Thu, 7 Apr 2022 17:52:31 +0200 Subject: git-ls-tree.txt: fix the name of "%(objectsize:padded)" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 455923e0a1 ("ls-tree: introduce "--format" option", 2022-03-23) introduced `--format` and the various placeholders it can take, such as %(objectname) and %(objectsize). At some point when that patch was being developed, those placeholders had shorter names, e.g., %(name) and %(size), which can be seen in the commit message of 455923e0a1. One instance of "%(size:padded)" also managed to enter the documentation in the final version of the patch. Correct it to "%(objectsize:padded)". Signed-off-by: Martin Ågren Signed-off-by: Junio C Hamano --- Documentation/git-ls-tree.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt index 43aebb9938..8f31e2ee9d 100644 --- a/Documentation/git-ls-tree.txt +++ b/Documentation/git-ls-tree.txt @@ -156,7 +156,7 @@ objectname:: The name of the object. objectsize[:padded]:: The size of the object ("-" if it's a tree). - It also supports a padded format of size with "%(size:padded)". + It also supports a padded format of size with "%(objectsize:padded)". path:: The pathname of the object. -- cgit v1.2.3 From 473fa2df08d9c6e2a4ff81ddc74f53f4b94a7983 Mon Sep 17 00:00:00 2001 From: Ævar Arnfjörð Bjarmason Date: Thu, 7 Apr 2022 21:08:59 +0200 Subject: Documentation: add --batch-command to cat-file synopsis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 440c705ea63 (cat-file: add --batch-command mode, 2022-02-18) added the new option and operating mode without listing it to the synopsis section. Fix it. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- Documentation/git-cat-file.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt index 70c5b4f12d..24a811f0ef 100644 --- a/Documentation/git-cat-file.txt +++ b/Documentation/git-cat-file.txt @@ -12,7 +12,7 @@ SYNOPSIS 'git cat-file' 'git cat-file' (-e | -p) 'git cat-file' (-t | -s) [--allow-unknown-type] -'git cat-file' (--batch | --batch-check) [--batch-all-objects] +'git cat-file' (--batch | --batch-check | --batch-command) [--batch-all-objects] [--buffer] [--follow-symlinks] [--unordered] [--textconv | --filters] 'git cat-file' (--textconv | --filters) -- cgit v1.2.3 From acd34fd5f60ab01e871dfa3a3bb8b81828ac181d Mon Sep 17 00:00:00 2001 From: Ævar Arnfjörð Bjarmason Date: Fri, 8 Apr 2022 18:00:25 +0200 Subject: ls-tree doc: document interaction with submodules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ls-tree documentation had never been updated after it learned to interact with submodules to explicitly mention them. The initial support was added in f35a6d3bce7 (Teach core object handling functions about gitlinks, 2007-04-09). E.g. the discussion of --long added in f35a6d3bce7 (Teach core object handling functions about gitlinks, 2007-04-09) didn't explicitly mention them. But this documentation added in 455923e0a15 (ls-tree: introduce "--format" option, 2022-03-23) had no such excuse, and was actively misleading by providing an exhaustive but incomplete list of object types we'd emit. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- Documentation/git-ls-tree.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt index 8f31e2ee9d..0240adb8ee 100644 --- a/Documentation/git-ls-tree.txt +++ b/Documentation/git-ls-tree.txt @@ -151,11 +151,11 @@ names can be used: objectmode:: The mode of the object. objecttype:: - The type of the object (`blob` or `tree`). + The type of the object (`commit`, `blob` or `tree`). objectname:: The name of the object. objectsize[:padded]:: - The size of the object ("-" if it's a tree). + The size of a `blob` object ("-" if it's a `commit` or `tree`). It also supports a padded format of size with "%(objectsize:padded)". path:: The pathname of the object. -- cgit v1.2.3 From 6d340dfaef25453a7d95a3e3960aea06fe69dbdf Mon Sep 17 00:00:00 2001 From: Adam Dinwoodie Date: Fri, 8 Apr 2022 10:53:53 +0100 Subject: t9902: split test to run on appropriate systems The "FUNNYNAMES" test prerequisite passes on Cygwin, as the Cygwin file system interface has a workaround for the underlying operating system's lack of support for tabs, newlines or quotes. However, it does not add support for backslash, which is treated as a directory separator, meaning one of the tests added by 48803821b1 ("completion: handle unusual characters for sparse-checkout", 2022-02-07) will fail on Cygwin. To avoid this failure while still getting maximal test coverage, split that test into two: test handling of paths that include tabs on anything that has the FUNNYNAMES prerequisite, but skip testing handling of paths that include backslashes unless both FUNNYNAMES is set and the system is not Cygwin. It might be nice to have more granularity than "FUNNYNAMES" and its sibling "FUNNIERNAMES" provide, so that tests could be run based on specific individual characters supported by the file system being tested, but that seems like it would make the prerequisite checks in this area much more verbose for very little gain. Signed-off-by: Adam Dinwoodie Signed-off-by: Junio C Hamano --- t/t9902-completion.sh | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 96dbda97cf..89705ea21d 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -1529,28 +1529,45 @@ test_expect_success 'cone mode sparse-checkout completes directory names with sp ) ' -# use FUNNYNAMES to avoid running on Windows, which doesn't permit backslashes or tabs in paths -test_expect_success FUNNYNAMES 'cone mode sparse-checkout completes directory names with backslashes and tabs' ' +# use FUNNYNAMES to avoid running on Windows, which doesn't permit tabs in paths +test_expect_success FUNNYNAMES 'cone mode sparse-checkout completes directory names with tabs' ' # reset sparse-checkout git -C sparse-checkout sparse-checkout disable && ( cd sparse-checkout && - mkdir "directory\with\backslashes" && mkdir "$(printf "directory\twith\ttabs")" && - >"directory\with\backslashes/randomfile" && >"$(printf "directory\twith\ttabs")/randomfile" && git add . && - git commit -m "Add directory with backslashes and directory with tabs" && - git sparse-checkout set --cone "directory\with\backslashes" \ + git commit -m "Add directory with tabs" && + git sparse-checkout set --cone \ "$(printf "directory\twith\ttabs")" && test_completion "git sparse-checkout add dir" <<-\EOF && - directory\with\backslashes/ directory with tabs/ EOF - rm -rf "directory\with\backslashes" && rm -rf "$(printf "directory\twith\ttabs")" && git add . && - git commit -m "Remove directory with backslashes and directory with tabs" + git commit -m "Remove directory with tabs" + ) +' + +# use FUNNYNAMES to avoid running on Windows, and !CYGWIN for Cygwin, as neither permit backslashes in paths +test_expect_success FUNNYNAMES,!CYGWIN 'cone mode sparse-checkout completes directory names with backslashes' ' + # reset sparse-checkout + git -C sparse-checkout sparse-checkout disable && + ( + cd sparse-checkout && + mkdir "directory\with\backslashes" && + >"directory\with\backslashes/randomfile" && + git add . && + git commit -m "Add directory with backslashes" && + git sparse-checkout set --cone \ + "directory\with\backslashes" && + test_completion "git sparse-checkout add dir" <<-\EOF && + directory\with\backslashes/ + EOF + rm -rf "directory\with\backslashes" && + git add . && + git commit -m "Remove directory with backslashes" ) ' -- cgit v1.2.3 From ab1f2765f78e75ee51dface57e1071b3b7f42b09 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 8 Apr 2022 13:54:49 -0700 Subject: Git 2.36-rc1 Signed-off-by: Junio C Hamano --- GIT-VERSION-GEN | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index d92e7d4398..1c5f645167 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v2.36.0-rc0 +DEF_VER=v2.36.0-rc1 LF=' ' -- cgit v1.2.3 From af15f84da731e59197af147497868f684b8c5650 Mon Sep 17 00:00:00 2001 From: Jean-Noël Avila Date: Mon, 11 Apr 2022 19:23:30 +0000 Subject: i18n: fix some badly formatted i18n strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit String in submodule--helper is not correctly formatting placeholders. The string in git-send-email is partial. Signed-off-by: Jean-Noël Avila Signed-off-by: Junio C Hamano --- builtin/submodule--helper.c | 2 +- git-send-email.perl | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 0b8b226c8f..2c87ef9364 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -3082,7 +3082,7 @@ static int module_create_branch(int argc, const char **argv, const char *prefix) OPT_END() }; const char *const usage[] = { - N_("git submodule--helper create-branch [-f|--force] [--create-reflog] [-q|--quiet] [-t|--track] [-n|--dry-run] "), + N_("git submodule--helper create-branch [-f|--force] [--create-reflog] [-q|--quiet] [-t|--track] [-n|--dry-run] "), NULL }; diff --git a/git-send-email.perl b/git-send-email.perl index a98460bdb9..5861e99a6e 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -2096,10 +2096,9 @@ sub validate_patch { chdir($cwd_save) or die("chdir: $!"); } if ($hook_error) { - $hook_error = sprintf(__("fatal: %s: rejected by %s hook\n" . - $hook_error . "\n" . - "warning: no patches were sent\n"), - $fn, $hook_name); + $hook_error = sprintf( + __("fatal: %s: rejected by %s hook\n%s\nwarning: no patches were sent\n"), + $fn, $hook_name, $hook_error); die $hook_error; } } -- cgit v1.2.3 From 11cfe552610386954886543f5de87dcc49ad5735 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 11 Apr 2022 21:27:02 -0700 Subject: Git 2.36-rc2 Signed-off-by: Junio C Hamano --- Documentation/RelNotes/2.36.0.txt | 2 ++ GIT-VERSION-GEN | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/RelNotes/2.36.0.txt b/Documentation/RelNotes/2.36.0.txt index 8da5b2e1e7..d61ade21e2 100644 --- a/Documentation/RelNotes/2.36.0.txt +++ b/Documentation/RelNotes/2.36.0.txt @@ -397,6 +397,8 @@ Fixes since v2.35 entry it moved. (merge b7f9130a06 vd/mv-refresh-stat later to maint). + * Fix for CVE-2022-24765 has been merged up from 2.35.2 and others. + * Other code cleanup, docfix, build fix, etc. (merge cfc5cf428b jc/find-header later to maint). (merge 40e7cfdd46 jh/p4-fix-use-of-process-error-exception later to maint). diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 1c5f645167..9252e0430d 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v2.36.0-rc1 +DEF_VER=v2.36.0-rc2 LF=' ' -- cgit v1.2.3