diff options
author | Johannes Sixt <j6t@kdbg.org> | 2025-03-20 19:32:56 +0100 |
---|---|---|
committer | Taylor Blau <me@ttaylorr.com> | 2025-05-23 17:03:30 -0400 |
commit | fe32bf31b8d5dff523543700ab76ecbf423a6d6f (patch) | |
tree | 4e565ae4fa9447c602cd78063d7f1cd7308b4975 /git-gui/lib/commit.tcl | |
parent | 30846b43060c3d57575b59b9aaa80c4bd1688171 (diff) |
gitk: sanitize 'open' arguments: simple commands
Tcl 'open' treats the second argument as a command when it begins
with |. The remainder of the argument is a list comprising the command
and its arguments. It assigns special meaning to these arguments when
they begin with a redirection, pipe or background operator. There are a
number of invocations of 'open' which construct arguments that are
taken from the Git repository or a user input. However, when file names
or ref names are taken from the repository, it is possible to find
names which have these special forms. They must not be interpreted by
'open' lest it redirects input or output, or attempts to build a
pipeline using a command name controlled by the repository.
Introduce a helper function that identifies such arguments and prepends
"./" to force such a name to be regarded as a relative file name.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'git-gui/lib/commit.tcl')
0 files changed, 0 insertions, 0 deletions