forked from msysgit/git
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sideband: do allow ANSI color sequences by default
The preceding two commits introduced special handling of the sideband channel to neutralize ANSI escape sequences before sending the payload 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. 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. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
- Loading branch information
Showing
3 changed files
with
84 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
sideband.allowControlCharacters:: | ||
By default, control characters that are delivered via the sideband | ||
are masked, to prevent potentially unwanted ANSI escape sequences | ||
from being sent to the terminal. Use this config setting to override | ||
this behavior. | ||
are masked, except ANSI color sequences. This prevents potentially | ||
unwanted ANSI escape sequences from being sent to the terminal. Use | ||
this config setting to override this behavior: | ||
+ | ||
-- | ||
color:: | ||
Allow ANSI color sequences, line feeds and horizontal tabs, | ||
but mask all other control characters. This is the default. | ||
false:: | ||
Mask all control characters other than line feeds and | ||
horizontal tabs. | ||
true:: | ||
Allow all control characters to be sent to the terminal. | ||
-- |
This file contains 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
This file contains 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