summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-11-26Git 2.46.3v2.46.3Johannes Schindelin
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-11-26Sync with 2.45.3Johannes Schindelin
* maint-2.45: Git 2.45.3 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.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-09-23Git 2.46.2v2.46.2Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-09-23Merge branch 'ma/test-libcurl-prereq' into maint-2.46Junio C Hamano
Test portability fix. * ma/test-libcurl-prereq: t0211: add missing LIBCURL prereq t1517: add missing LIBCURL prereq
2024-09-23Merge branch 'jc/doc-skip-fetch-all-and-prefetch' into maint-2.46Junio C Hamano
Doc updates. * jc/doc-skip-fetch-all-and-prefetch: doc: remote.*.skip{DefaultUpdate,FetchAll} stops prefetch
2024-09-23Merge branch 'bl/trailers-and-incomplete-last-line-fix' into maint-2.46Junio C Hamano
The interpret-trailers command failed to recognise the end of the message when the commit log ends in an incomplete line. * bl/trailers-and-incomplete-last-line-fix: interpret-trailers: handle message without trailing newline
2024-09-23Merge branch 'rj/cygwin-has-dev-tty' into maint-2.46Junio C Hamano
Cygwin does have /dev/tty support that is needed by things like single-key input mode. * rj/cygwin-has-dev-tty: config.mak.uname: add HAVE_DEV_TTY to cygwin config section
2024-09-23Merge branch 'rs/diff-exit-code-fix' into maint-2.46Junio C Hamano
In a few corner cases "git diff --exit-code" failed to report "changes" (e.g., renamed without any content change), which has been corrected. * rs/diff-exit-code-fix: diff: report dirty submodules as changes in builtin_diff() diff: report copies and renames as changes in run_diff_cmd()
2024-09-16Start preparing for Git 2.46.2Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-09-16Merge branch 'jk/ci-linux32-update' into maint-2.46Junio C Hamano
CI updates * jk/ci-linux32-update: ci: add Ubuntu 16.04 job to GitLab CI ci: use regular action versions for linux32 job ci: use more recent linux32 image ci: unify ubuntu and ubuntu32 dependencies ci: drop run-docker scripts
2024-09-16Merge branch 'jc/ci-upload-artifact-and-linux32' into maint-2.46Junio C Hamano
CI started failing completely for linux32 jobs, as the step to upload failed test directory uses GitHub actions that is deprecated and is now disabled. Remove the step so at least we will know if the tests are passing. * jc/ci-upload-artifact-and-linux32: ci: remove 'Upload failed tests' directories' step from linux32 jobs
2024-09-16Revert "Merge branch 'jc/patch-id' into maint-2.46"Junio C Hamano
This reverts commit 41c952ebacf7e3369e7bee721f768114d65e50c4, reversing changes made to 712d970c0145b95ce655773e7cd1676f09dfd215. Keeping a known breakage for now is better than introducing new regression(s).
2024-09-13Git 2.46.1v2.46.1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-09-13Merge branch 'rj/compat-terminal-unused-fix' into maint-2.46Junio C Hamano
Build fix. * rj/compat-terminal-unused-fix: compat/terminal: mark parameter of git_terminal_prompt() UNUSED
2024-09-13Merge branch 'jc/config-doc-update' into maint-2.46Junio C Hamano
Docfix. * jc/config-doc-update: git-config.1: fix description of --regexp in synopsis git-config.1: --get-all description update
2024-09-13Merge branch 'aa/cat-file-batch-output-doc' into maint-2.46Junio C Hamano
Docfix. * aa/cat-file-batch-output-doc: docs: explain the order of output in the batched mode of git-cat-file(1)
2024-09-13Merge branch 'cl/config-regexp-docfix' into maint-2.46Junio C Hamano
Docfix. * cl/config-regexp-docfix: doc: replace 3 dash with correct 2 dash in git-config(1)
2024-09-13Merge branch 'jc/coding-style-c-operator-with-spaces' into maint-2.46Junio C Hamano
Write down whitespacing rules around C opeators. * jc/coding-style-c-operator-with-spaces: CodingGuidelines: spaces around C operators
2024-09-13Merge branch 'ps/stash-keep-untrack-empty-fix' into maint-2.46Junio C Hamano
A corner case bug in "git stash" was fixed. * ps/stash-keep-untrack-empty-fix: builtin/stash: fix `--keep-index --include-untracked` with empty HEAD
2024-09-13Merge branch 'ps/index-pack-outside-repo-fix' into maint-2.46Junio C Hamano
"git verify-pack" and "git index-pack" started dying outside a repository, which has been corrected. * ps/index-pack-outside-repo-fix: builtin/index-pack: fix segfaults when running outside of a repo
2024-09-13Merge branch 'jk/free-commit-buffer-of-skipped-commits' into maint-2.46Junio C Hamano
The code forgot to discard unnecessary in-core commit buffer data for commits that "git log --skip=<number>" traversed but omitted from the output, which has been corrected. * jk/free-commit-buffer-of-skipped-commits: revision: free commit buffers for skipped commits
2024-09-13ci: add Ubuntu 16.04 job to GitLab CIPatrick Steinhardt
In the preceding commits we had to convert the linux32 job to be based on Ubuntu 20.04 instead of Ubuntu 16.04 due to a limitation in GitHub Workflows. This was the only job left that still tested against this old but supported Ubuntu version, and we have no other jobs that test with a comparatively old Linux distribution. Add a new job to GitLab CI that tests with Ubuntu 16.04 to cover the resulting test gap. GitLab doesn't modify Docker images in the same way GitHub does and thus doesn't fall prey to the same issue. There are two compatibility issues uncovered by this: - Ubuntu 16.04 does not support HTTP/2 in Apache. We thus cannot set `GIT_TEST_HTTPD=true`, which would otherwise cause us to fail when Apache fails to start. - Ubuntu 16.04 cannot use recent JGit versions as they depend on a more recent Java runtime than we have available. We thus disable installing any kind of optional dependencies that do not come from the package manager. These two restrictions are fine though, as we only really care about whether Git compiles and runs on such old distributions in the first place. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-09-12Another batch of topics for 2.46.1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-09-12Merge branch 'jc/grammo-fixes' into maint-2.46Junio C Hamano
Doc updates. * jc/grammo-fixes: doc: grammofix in git-diff-tree tutorial: grammofix
2024-09-12Merge branch 'jc/tests-no-useless-tee' into maint-2.46Junio C Hamano
Test fixes. * jc/tests-no-useless-tee: tests: drop use of 'tee' that hides exit status
2024-09-12Merge branch 'jc/how-to-maintain-updates' into maint-2.46Junio C Hamano
Doc updates. * jc/how-to-maintain-updates: howto-maintain: mention preformatted docs
2024-09-12Merge branch 'ps/bundle-outside-repo-fix' into maint-2.46Junio C Hamano
"git bundle unbundle" outside a repository triggered a BUG() unnecessarily, which has been corrected. * ps/bundle-outside-repo-fix: bundle: default to SHA1 when reading bundle headers builtin/bundle: have unbundle check for repo before opening its bundle
2024-09-12Merge branch 'jc/patch-id' into maint-2.46Junio C Hamano
The patch parser in "git patch-id" has been tightened to avoid getting confused by lines that look like a patch header in the log message. cf. <Zqh2T_2RLt0SeKF7@tanuki> * jc/patch-id: patch-id: tighten code to detect the patch header patch-id: rewrite code that detects the beginning of a patch patch-id: make get_one_patchid() more extensible patch-id: call flush_current_id() only when needed t4204: patch-id supports various input format
2024-09-12Merge branch 'jk/apply-patch-mode-check-fix' into maint-2.46Junio C Hamano
Test fix. * jk/apply-patch-mode-check-fix: t4129: fix racy index when calling chmod after git-add apply: canonicalize modes read from patches
2024-09-12ci: use regular action versions for linux32 jobJeff King
The linux32 job runs inside a docker container with a 32-bit libc, etc. This breaks any GitHub Actions scripts that are implemented in javascript, because they ship with their own 64-bit version of Node.js that's dynamically linked. They'll fail with a message like: exec /__e/node20/bin/node: no such file or directory because they can't find the runtime linker. This hasn't been a problem until recently because we special-case older, non-javascript versions of these actions for the linux32 job. But it recently became an issue when our old version of actions/upload-artifact was deprecated, causing the job to fail. We worked around that in 90f2c7240c (ci: remove 'Upload failed tests' directories' step from linux32 jobs, 2024-09-09), but it meant a loss of functionality for that job. And we may eventually run into the same deprecation problem with actions/checkout, which can't just be removed. We can solve the linking issue by installing the 64-bit libc and stdc++ packages before doing anything else. Coupled with the switch to a more recent image in the previous patch, that lets us remove the special-casing of the action scripts entirely. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>