summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-11-26Git 2.45.3v2.45.3Johannes Schindelin
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-11-26Sync with 2.44.3Johannes Schindelin
* maint-2.44: Git 2.44.3 Git 2.43.6 Git 2.42.4 Git 2.41.3 Git 2.40.4 credential: disallow Carriage Returns in the protocol by default credential: sanitize the user prompt credential_format(): also encode <host>[:<port>] t7300: work around platform-specific behaviour with long paths on MinGW compat/regex: fix argument order to calloc(3) mingw: drop bogus (and unneeded) declaration of `_pgmptr` ci: remove 'Upload failed tests' directories' step from linux32 jobs
2024-11-26Git 2.44.3v2.44.3Johannes Schindelin
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-11-26Sync with 2.43.6Johannes Schindelin
* maint-2.43: Git 2.43.6 Git 2.42.4 Git 2.41.3 Git 2.40.4 credential: disallow Carriage Returns in the protocol by default credential: sanitize the user prompt credential_format(): also encode <host>[:<port>] t7300: work around platform-specific behaviour with long paths on MinGW compat/regex: fix argument order to calloc(3) mingw: drop bogus (and unneeded) declaration of `_pgmptr` ci: remove 'Upload failed tests' directories' step from linux32 jobs
2024-11-26Git 2.43.6v2.43.6Johannes Schindelin
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-11-26Sync with 2.42.4Johannes Schindelin
* maint-2.42: Git 2.42.4 Git 2.41.3 Git 2.40.4 credential: disallow Carriage Returns in the protocol by default credential: sanitize the user prompt credential_format(): also encode <host>[:<port>] t7300: work around platform-specific behaviour with long paths on MinGW compat/regex: fix argument order to calloc(3) mingw: drop bogus (and unneeded) declaration of `_pgmptr` ci: remove 'Upload failed tests' directories' step from linux32 jobs
2024-11-26Git 2.42.4v2.42.4Johannes Schindelin
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-11-26Sync with 2.41.3Johannes Schindelin
* maint-2.41: Git 2.41.3 Git 2.40.4 credential: disallow Carriage Returns in the protocol by default credential: sanitize the user prompt credential_format(): also encode <host>[:<port>] t7300: work around platform-specific behaviour with long paths on MinGW compat/regex: fix argument order to calloc(3) mingw: drop bogus (and unneeded) declaration of `_pgmptr` ci: remove 'Upload failed tests' directories' step from linux32 jobs
2024-11-26Git 2.41.3v2.41.3Johannes Schindelin
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-11-26Sync with 2.40.4Johannes Schindelin
* maint-2.40: Git 2.40.4 credential: disallow Carriage Returns in the protocol by default credential: sanitize the user prompt credential_format(): also encode <host>[:<port>] t7300: work around platform-specific behaviour with long paths on MinGW compat/regex: fix argument order to calloc(3) mingw: drop bogus (and unneeded) declaration of `_pgmptr` ci: remove 'Upload failed tests' directories' step from linux32 jobs
2024-11-26Git 2.40.4v2.40.4Johannes Schindelin
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-11-26Merge branch 'disallow-control-characters-in-credential-urls-by-default'Johannes Schindelin
This addresses two vulnerabilities: - CVE-2024-50349: Printing unsanitized URLs when asking for credentials made the user susceptible to crafted URLs (e.g. in recursive clones) that mislead the user into typing in passwords for trusted sites that would then be sent to untrusted sites instead. - CVE-2024-52006 Git may pass on Carriage Returns via the credential protocol to credential helpers which use line-reading functions that interpret said Carriage Returns as line endings, even though Git did not intend that. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-11-26credential: disallow Carriage Returns in the protocol by defaultJohannes Schindelin
While Git has documented that the credential protocol is line-based, with newlines as terminators, the exact shape of a newline has not been documented. From Git's perspective, which is firmly rooted in the Linux ecosystem, it is clear that "a newline" means a Line Feed character. However, even Git's credential protocol respects Windows line endings (a Carriage Return character followed by a Line Feed character, "CR/LF") by virtue of using `strbuf_getline()`. There is a third category of line endings that has been used originally by MacOS, and that is respected by the default line readers of .NET and node.js: bare Carriage Returns. Git cannot handle those, and what is worse: Git's remedy against CVE-2020-5260 does not catch when credential helpers are used that interpret bare Carriage Returns as newlines. Git Credential Manager addressed this as CVE-2024-50338, but other credential helpers may still be vulnerable. So let's not only disallow Line Feed characters as part of the values in the credential protocol, but also disallow Carriage Return characters. In the unlikely event that a credential helper relies on Carriage Returns in the protocol, introduce an escape hatch via the `credential.protectProtocol` config setting. This addresses CVE-2024-52006. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-11-26credential: sanitize the user promptJohannes Schindelin
When asking the user interactively for credentials, we want to avoid misleading them e.g. via control sequences that pretend that the URL targets a trusted host when it does not. While Git learned, over the course of the preceding commits, to disallow URLs containing URL-encoded control characters by default, credential helpers are still allowed to specify values very freely (apart from Line Feed and NUL characters, anything is allowed), and this would allow, say, a username containing control characters to be specified that would then be displayed in the interactive terminal prompt asking the user for the password, potentially sending those control characters directly to the terminal. This is undesirable because control characters can be used to mislead users to divulge secret information to untrusted sites. To prevent such an attack vector, let's add a `git_prompt()` that forces the displayed text to be sanitized, i.e. displaying question marks instead of control characters. Note: While this commit's diff changes a lot of `user@host` strings to `user%40host`, which may look suspicious on the surface, there is a good reason for that: this string specifies a user name, not a <username>@<hostname> combination! In the context of t5541, the actual combination looks like this: `user%40@127.0.0.1:5541`. Therefore, these string replacements document a net improvement introduced by this commit, as `user@host@127.0.0.1` could have left readers wondering where the user name ends and where the host name begins. Hinted-at-by: Jeff King <peff@peff.net> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-11-26credential_format(): also encode <host>[:<port>]Johannes Schindelin
An upcoming change wants to sanitize the credential password prompt where a URL is displayed that may potentially come from a `.gitmodules` file. To this end, the `credential_format()` function is employed. To sanitize the host name (and optional port) part of the URL, we need a new mode of the `strbuf_add_percentencode()` function because the current mode is both too strict and too lenient: too strict because it encodes `:`, `[` and `]` (which should be left unencoded in `<host>:<port>` and in IPv6 addresses), and too lenient because it does not encode invalid host name characters `/`, `_` and `~`. So let's introduce and use a new mode specifically to encode the host name and optional port part of a URI, leaving alpha-numerical characters, periods, colons and brackets alone and encoding all others. This only leads to a change of behavior for URLs that contain invalid host names. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-10-30Merge branch 'backport-github-actions-fixes'Johannes Schindelin
The planet keeps revolving, and CI definitions (even old ones) need to be kept up to date, even if they worked unchanged before (because now they don't). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-10-30t7300: work around platform-specific behaviour with long paths on MinGWPatrick Steinhardt
Windows by default has a restriction in place to only allow paths up to 260 characters. This restriction can nowadays be lifted by setting a registry key, but is still active by default. In t7300 we have one test that exercises the behaviour of git-clean(1) with such long paths. Interestingly enough, this test fails on my system that uses Windows 10 with mingw-w64 installed via MSYS2: instead of observing ENAMETOOLONG, we observe ENOENT. This behaviour is consistent across multiple different environments I have tried. I cannot say why exactly we observe a different error here, but I would not be surprised if this was either dependent on the Windows version, the version of MinGW, the current working directory of Git or any kind of combination of these. Work around the issue by handling both errors. [Backported from 106834e34a2 (t7300: work around platform-specific behaviour with long paths on MinGW, 2024-10-09).] Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-10-30compat/regex: fix argument order to calloc(3)Junio C Hamano
Windows compiler suddenly started complaining that calloc(3) takes its arguments in <nmemb, size> order. Indeed, there are many calls that has their arguments in a _wrong_ order. Fix them all. A sample breakage can be seen at https://github.com/git/git/actions/runs/9046793153/job/24857988702#step:4:272 [Backported from f01301aabe1 (compat/regex: fix argument order to calloc(3), 2024-05-11).] Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
2024-10-30mingw: drop bogus (and unneeded) declaration of `_pgmptr`Johannes Schindelin
In 08809c09aa13 (mingw: add a helper function to attach GDB to the current process, 2020-02-13), I added a declaration that was not needed. Back then, that did not matter, but now that the declaration of that symbol was changed in mingw-w64's headers, it causes the following compile error: CC compat/mingw.o compat/mingw.c: In function 'open_in_gdb': compat/mingw.c:35:9: error: function declaration isn't a prototype [-Werror=strict-prototypes] 35 | extern char *_pgmptr; | ^~~~~~ In file included from C:/git-sdk-64/usr/src/git/build-installers/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/mm_malloc.h:27, from C:/git-sdk-64/usr/src/git/build-installers/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/xmmintrin.h:34, from C:/git-sdk-64/usr/src/git/build-installers/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/immintrin.h:31, from C:/git-sdk-64/usr/src/git/build-installers/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/x86intrin.h:32, from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/winnt.h:1658, from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/minwindef.h:163, from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/windef.h:9, from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/windows.h:69, from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/winsock2.h:23, from compat/../git-compat-util.h:215, from compat/mingw.c:1: compat/mingw.c:35:22: error: '__p__pgmptr' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes] 35 | extern char *_pgmptr; | ^~~~~~~ Let's just drop the declaration and get rid of this compile error. [Backported from 3c295c87c25 (mingw: drop bogus (and unneeded) declaration of `_pgmptr`, 2024-06-19).] Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-10-30ci: remove 'Upload failed tests' directories' step from linux32 jobsJunio C Hamano
Linux32 jobs seem to be getting: Error: This request has been automatically failed because it uses a deprecated version of `actions/upload-artifact: v1`. Learn more: https://github.blog/changelog/2024-02-13-deprecation-notice-v1-and-v2-of-the-artifact-actions/ before doing anything useful. For now, disable the step. Ever since actions/upload-artifact@v1 got disabled, mentioning the offending version of it seems to stop anything from happening. At least this should run the same build and test. See https://github.com/git/git/actions/runs/10780030750/job/29894867249 for example. [Backported from 90f2c7240cc (ci: remove 'Upload failed tests' directories' step from linux32 jobs, 2024-09-09).] Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-07-02Yet another batch of post 2.45.2 updates from the 'master' frontJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-02Merge branch 'rs/remove-unused-find-header-mem' into maint-2.45Junio C Hamano
Code clean-up. * rs/remove-unused-find-header-mem: commit: remove find_header_mem()
2024-07-02Merge branch 'jc/worktree-git-path' into maint-2.45Junio C Hamano
Code cleanup. * jc/worktree-git-path: worktree_git_path(): move the declaration to path.h
2024-07-02Merge branch 'jk/fetch-pack-fsck-wo-lock-pack' into maint-2.45Junio C Hamano
"git fetch-pack -k -k" without passing "--lock-pack" (which we never do ourselves) did not work at all, which has been corrected. * jk/fetch-pack-fsck-wo-lock-pack: fetch-pack: fix segfault when fscking without --lock-pack
2024-07-02Merge branch 'jk/t5500-typofix' into maint-2.45Junio C Hamano
A helper function shared between two tests had a copy-paste bug, which has been corrected. * jk/t5500-typofix: t5500: fix mistaken $SERVER reference in helper function
2024-07-02Merge branch 'js/mingw-remove-unused-extern-decl' into maint-2.45Junio C Hamano
An unused extern declaration for mingw has been removed to prevent it from causing build failure. * js/mingw-remove-unused-extern-decl: mingw: drop bogus (and unneeded) declaration of `_pgmptr`
2024-07-02Merge branch 'jc/no-default-attr-tree-in-bare' into maint-2.45Junio C Hamano
Earlier we stopped using the tree of HEAD as the default source of attributes in a bare repository, but failed to document it. This has been corrected. * jc/no-default-attr-tree-in-bare: attr.tree: HEAD:.gitattributes is no longer the default in a bare repo
2024-07-02Merge branch 'tb/precompose-getcwd' into maint-2.45Junio C Hamano
We forgot to normalize the result of getcwd() to NFC on macOS where all other paths are normalized, which has been corrected. This still does not address the case where core.precomposeUnicode configuration is not defined globally. * tb/precompose-getcwd: macOS: ls-files path fails if path of workdir is NFD
2024-07-02Merge branch 'pw/rebase-i-error-message' into maint-2.45Junio C Hamano
When the user adds to "git rebase -i" instruction to "pick" a merge commit, the error experience is not pleasant. Such an error is now caught earlier in the process that parses the todo list. * pw/rebase-i-error-message: rebase -i: improve error message when picking merge rebase -i: pass struct replay_opts to parse_insn_line()
2024-07-02Merge branch 'ds/format-patch-rfc-and-k' into maint-2.45Junio C Hamano
The "-k" and "--rfc" options of "format-patch" will now error out when used together, as one tells us not to add anything to the title of the commit, and the other one tells us to add "RFC" in addition to "PATCH". * ds/format-patch-rfc-and-k: format-patch: ensure that --rfc and -k are mutually exclusive
2024-06-28More post 2.45.2 updates from the 'master' frontJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-06-28Merge branch 'ds/ahead-behind-fix' into maint-2.45Junio C Hamano
Fix for a progress bar. * ds/ahead-behind-fix: commit-graph: increment progress indicator
2024-06-28Merge branch 'ds/doc-add-interactive-singlekey' into maint-2.45Junio C Hamano
Doc update. * ds/doc-add-interactive-singlekey: doc: interactive.singleKey is disabled by default
2024-06-28Merge branch 'jc/varargs-attributes' into maint-2.45Junio C Hamano
Varargs functions that are unannotated as printf-like or execl-like have been annotated as such. * jc/varargs-attributes: __attribute__: add a few missing format attributes __attribute__: mark some functions with LAST_ARG_MUST_BE_NULL __attribute__: remove redundant attribute declaration for git_die_config() __attribute__: trace2_region_enter_printf() is like "printf"
2024-06-28Merge branch 'ps/ci-fix-detection-of-ubuntu-20' into maint-2.45Junio C Hamano
Fix for an embarrassing typo that prevented Python2 tests from running anywhere. * ps/ci-fix-detection-of-ubuntu-20: ci: fix check for Ubuntu 20.04
2024-06-28Merge branch 'jk/cap-exclude-file-size' into maint-2.45Junio C Hamano
An overly large ".gitignore" files are now rejected silently. * jk/cap-exclude-file-size: dir.c: reduce max pattern file size to 100MB dir.c: skip .gitignore, etc larger than INT_MAX
2024-06-28Merge branch 'jc/safe-directory-leading-path' into maint-2.45Junio C Hamano
The safe.directory configuration knob has been updated to optionally allow leading path matches. * jc/safe-directory-leading-path: safe.directory: allow "lead/ing/path/*" match
2024-06-28Merge branch 'rs/difftool-env-simplify' into maint-2.45Junio C Hamano
Code simplification. * rs/difftool-env-simplify: difftool: add env vars directly in run_file_diff()
2024-06-28Merge branch 'ps/fix-reinit-includeif-onbranch' into maint-2.45Junio C Hamano
"git init" in an already created directory, when the user configuration has includeif.onbranch, started to fail recently, which has been corrected. * ps/fix-reinit-includeif-onbranch: setup: fix bug with "includeIf.onbranch" when initializing dir
2024-06-28Merge branch 'es/chainlint-ncores-fix' into maint-2.45Junio C Hamano
The chainlint script (invoked during "make test") did nothing when it failed to detect the number of available CPUs. It now falls back to 1 CPU to avoid the problem. * es/chainlint-ncores-fix: chainlint.pl: latch CPU count directly reported by /proc/cpuinfo chainlint.pl: fix incorrect CPU count on Linux SPARC chainlint.pl: make CPU count computation more robust
2024-06-28Merge branch 'jc/rev-parse-fatal-doc' into maint-2.45Junio C Hamano
Doc update. * jc/rev-parse-fatal-doc: rev-parse: document how --is-* options work outside a repository
2024-06-28Merge branch 'jc/doc-diff-name-only' into maint-2.45Junio C Hamano
The documentation for "git diff --name-only" has been clarified that it is about showing the names in the post-image tree. * jc/doc-diff-name-only: diff: document what --name-only shows
2024-06-28Merge branch 'mt/t0211-typofix' into maint-2.45Junio C Hamano
Test fix. * mt/t0211-typofix: t/t0211-trace2-perf.sh: fix typo patern -> pattern
2024-06-28Merge branch 'dg/fetch-pack-code-cleanup' into maint-2.45Junio C Hamano
Code clean-up to remove an unused struct definition. * dg/fetch-pack-code-cleanup: fetch-pack: remove unused 'struct loose_object_iter'
2024-06-28Merge branch 'dm/update-index-doc-fix' into maint-2.45Junio C Hamano
Doc fix. * dm/update-index-doc-fix: documentation: git-update-index: add --show-index-version to synopsis
2024-06-28Merge branch 'ds/scalar-reconfigure-all-fix' into maint-2.45Junio C Hamano
Scalar fix. * ds/scalar-reconfigure-all-fix: scalar: avoid segfault in reconfigure --all
2024-06-28Merge branch 'vd/doc-merge-tree-x-option' into maint-2.45Junio C Hamano
Doc update. * vd/doc-merge-tree-x-option: Documentation/git-merge-tree.txt: document -X
2024-06-28Merge branch 'fa/p4-error' into maint-2.45Junio C Hamano
P4 update. * fa/p4-error: git-p4: show Perforce error to the user
2024-06-28Merge branch 'tb/attr-limits' into maint-2.45Junio C Hamano
The maximum size of attribute files is enforced more consistently. * tb/attr-limits: attr.c: move ATTR_MAX_FILE_SIZE check into read_attr_from_buf()
2024-06-28Merge branch 'rs/diff-parseopts-cleanup' into maint-2.45Junio C Hamano
Code clean-up to remove code that is now a noop. * rs/diff-parseopts-cleanup: diff-lib: stop calling diff_setup_done() in do_diff_cache()