FAILED: Rebase shears/seen (#24488333900)#128
Draft
gitforwindowshelper[bot] wants to merge 5 commits intobase/shears/seen-24488333900from
Draft
FAILED: Rebase shears/seen (#24488333900)#128gitforwindowshelper[bot] wants to merge 5 commits intobase/shears/seen-24488333900from
gitforwindowshelper[bot] wants to merge 5 commits intobase/shears/seen-24488333900from
Conversation
When a Unix socket is initialized, the current directory's path is stored so that the cleanup code can `chdir()` back to where it was before exit. If the path that needs to be stored exceeds the default size of the `sun_path` attribute of `struct sockaddr_un` (which is defined as a 108-sized byte array on Linux), a larger buffer needs to be allocated so that it can hold the path, and it is the responsibility of the `unix_sockaddr_cleanup()` function to release that allocated memory. In Git's CI, this stack allocation is not necessary because the code is checked out to `/home/runner/work/git/git`. Concatenate the path `t/trash directory.t0301-credential-cache/.cache/git/credential/socket` and a terminating NUL, and you end up with 96 bytes, 12 shy of the default `sun_path` size. However, I use worktrees with slightly longer paths: `/home/me/projects/git/yes/i/nest/worktrees/to/organize/them/` is more in line with what I have. When I recently tried to locally reproduce a failure of the `linux-leaks` CI job, this t0301 test failed (where it had not failed in CI). The reason: When `credential-cache` tries to reach its daemon initially by calling `unix_sockaddr_init()`, it is expected that the daemon cannot be reached (the idea is to spin up the daemon in that case and try again). However, when this first call to `unix_sockaddr_init()` fails, the code returns early from the `unix_stream_connect()` function _without_ giving the cleanup code a chance to run, skipping the deallocation of above-mentioned path. The fix is easy: do not return early but instead go directly to the cleanup code. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Author
|
Artifacts: release assets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Workflow run failed to rebase shears/seen.
Rebase Summary: seen
From: 7d8b4efad6 (Merge 'readme' into HEAD, 2018-06-07) (9a274180f1..7d8b4efad6)
Skipped: 679b1fc (sideband: mask control characters, 2024-11-06)
Upstream equivalent: 0494953 (sideband: mask control characters, 2026-03-05)
Range-diff
1: 679b1fc ! 1: 0494953 sideband: mask control characters
@@ Commit message There is likely a need for more fine-grained controls instead of using a "heavy hammer" like this, which will be introduced subsequently. + Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> + Signed-off-by: Junio C Hamano <gitster@pobox.com> ## sideband.c ## @@ sideband.c: void list_config_color_sideband_slots(struct string_list *list, const char *pref @@ sideband.c: void list_config_color_sideband_slots(struct string_list *list, cons +{ + strbuf_grow(dest, n); + for (; n && *src; src++, n--) { -+ if (!iscntrl(*src) || *src == '\t' || *src == '\n') ++ if (!iscntrl(*src) || *src == '\t' || *src == '\n') { + strbuf_addch(dest, *src); -+ else { ++ } else { + strbuf_addch(dest, '^'); -+ strbuf_addch(dest, 0x40 + *src); ++ strbuf_addch(dest, *src == 0x7f ? '?' : 0x40 + *src); + } + } +} @@ t/t5409-colorize-remote-messages.sh: test_expect_success 'fallback to color.ui' + printf "error: Have you \\033[31mread\\033[m this?\\n" >&2 + exec "$@" + EOF -+ test_config_global uploadPack.packObjectshook ./color-me-surprised && ++ test_config_global uploadPack.packObjectsHook ./color-me-surprised && + test_commit need-at-least-one-commit && + git clone --no-local . throw-away 2>stderr && + test_decode_color <stderr >decoded &&Skipped: 7227785 (sideband: introduce an "escape hatch" to allow control characters, 2024-11-06)
Upstream equivalent: 9ed1625 (sideband: introduce an "escape hatch" to allow control characters, 2026-03-05)
Range-diff
1: 7227785 ! 1: 9ed1625 sideband: introduce an "escape hatch" to allow control characters
@@ Commit message To help with those use cases, give users a way to opt-out of the protections: `sideband.allowControlCharacters`. + Suggested-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> + Signed-off-by: Junio C Hamano <gitster@pobox.com> ## Documentation/config.adoc ## @@ Documentation/config.adoc: include::config/sequencer.adoc[] @@ sideband.c: void list_config_color_sideband_slots(struct string_list *list, cons + strbuf_grow(dest, n); for (; n && *src; src++, n--) { - if (!iscntrl(*src) || *src == '\t' || *src == '\n') + if (!iscntrl(*src) || *src == '\t' || *src == '\n') { ## t/t5409-colorize-remote-messages.sh ## @@ t/t5409-colorize-remote-messages.sh: test_expect_success 'disallow (color) control sequences in sideband' ' EOF - test_config_global uploadPack.packObjectshook ./color-me-surprised && + test_config_global uploadPack.packObjectsHook ./color-me-surprised && test_commit need-at-least-one-commit && + git clone --no-local . throw-away 2>stderr &&Skipped: eb92506 (sideband: do allow ANSI color sequences by default, 2024-11-18)
Upstream equivalent: 12f0fda (sideband: do allow ANSI color sequences by default, 2026-03-05)
Range-diff
1: eb92506 ! 1: 12f0fda sideband: do allow ANSI color sequences by default
@@ Commit message to the terminal, and `sideband.allowControlCharacters` to override that behavior. - However, some `pre-receive` hooks that are actively used in practice - want to color their messages and therefore rely on the fact that Git - passes them through to the terminal. + However, as reported by brian m. carlson, some `pre-receive` hooks that + are actively used in practice want to color their messages and therefore + rely on the fact that Git passes them through to the terminal, even + though they have no way to determine whether the receiving side can + actually handle Escape sequences (think e.g. about the practice + recommended by Git that third-party applications wishing to use Git + functionality parse the output of Git commands). In contrast to other ANSI escape sequences, it is highly unlikely that coloring sequences can be essential tools in attack vectors that mislead Git users e.g. by hiding crucial information. Therefore we can have both: Continue to allow ANSI coloring sequences to - be passed to the terminal, and neutralize all other ANSI escape - sequences. + be passed to the terminal by default, and neutralize all other ANSI + Escape sequences. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> + Signed-off-by: Junio C Hamano <gitster@pobox.com> ## Documentation/config/sideband.adoc ## @@ @@ Documentation/config/sideband.adoc + this config setting to override this behavior: ++ +-- -+ color:: ++ `default`:: ++ `color`:: + Allow ANSI color sequences, line feeds and horizontal tabs, + but mask all other control characters. This is the default. -+ false:: ++ `false`:: + Mask all control characters other than line feeds and + horizontal tabs. -+ true:: ++ `true`:: + Allow all control characters to be sent to the terminal. +-- @@ sideband.c: static struct keyword_entry keywords[] = { -static int allow_control_characters; +static enum { -+ ALLOW_NO_CONTROL_CHARACTERS = 0, -+ ALLOW_ALL_CONTROL_CHARACTERS = 1, -+ ALLOW_ANSI_COLOR_SEQUENCES = 2 ++ ALLOW_NO_CONTROL_CHARACTERS = 0, ++ ALLOW_ANSI_COLOR_SEQUENCES = 1<<0, ++ ALLOW_DEFAULT_ANSI_SEQUENCES = ALLOW_ANSI_COLOR_SEQUENCES, ++ ALLOW_ALL_CONTROL_CHARACTERS = 1<<1, +} allow_control_characters = ALLOW_ANSI_COLOR_SEQUENCES; /* Returns a color setting (GIT_COLOR_NEVER, etc). */ @@ sideband.c: static enum git_colorbool use_sideband_colors(void) + if (repo_config_get_string_tmp(the_repository, "sideband.allowcontrolcharacters", + &value)) + ; /* huh? `get_maybe_bool()` returned -1 */ ++ else if (!strcmp(value, "default")) ++ allow_control_characters = ALLOW_DEFAULT_ANSI_SEQUENCES; + else if (!strcmp(value, "color")) + allow_control_characters = ALLOW_ANSI_COLOR_SEQUENCES; + else @@ sideband.c: void list_config_color_sideband_slots(struct string_list *list, cons + * Valid ANSI color sequences are of the form + * + * ESC [ [<n> [; <n>]*] m ++ * ++ * These are part of the Select Graphic Rendition sequences which ++ * contain more than just color sequences, for more details see ++ * https://en.wikipedia.org/wiki/ANSI_escape_code#SGR. + */ + + if (allow_control_characters != ALLOW_ANSI_COLOR_SEQUENCES || @@ sideband.c: void list_config_color_sideband_slots(struct string_list *list, cons } @@ sideband.c: static void strbuf_add_sanitized(struct strbuf *dest, const char *src, int n) for (; n && *src; src++, n--) { - if (!iscntrl(*src) || *src == '\t' || *src == '\n') + if (!iscntrl(*src) || *src == '\t' || *src == '\n') { strbuf_addch(dest, *src); -- else { -+ else if ((i = handle_ansi_color_sequence(dest, src, n))) { ++ } else if ((i = handle_ansi_color_sequence(dest, src, n))) { + src += i; + n -= i; -+ } else { + } else { strbuf_addch(dest, '^'); - strbuf_addch(dest, 0x40 + *src); - } + strbuf_addch(dest, *src == 0x7f ? '?' : 0x40 + *src); ## t/t5409-colorize-remote-messages.sh ## @@ t/t5409-colorize-remote-messages.sh: test_expect_success 'fallback to color.ui' ' @@ t/t5409-colorize-remote-messages.sh: test_expect_success 'fallback to color.ui' + printf "error: Have you \\033[31mread\\033[m this?\\a\\n" >&2 exec "$@" EOF - test_config_global uploadPack.packObjectshook ./color-me-surprised && + test_config_global uploadPack.packObjectsHook ./color-me-surprised && @@ t/t5409-colorize-remote-messages.sh: test_expect_success 'disallow (color) control sequences in sideband' ' git clone --no-local . throw-away 2>stderr &&BUILD FAILED: c5281e4 (Merge branch 'v2.53.0.windows.3', 2026-04-14)
Build failed after conflict resolution. Last 50 lines: