Slightly older version of master from https://github.com/j6t/gitk
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

gitk: sanitize 'open' arguments: simple commands, readable and writable

As in the previous commits, introduce a function that sanitizes
arguments and also keeps the returned file handle writable to pass
data to stdin.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>

authored by

Johannes Sixt and committed by
Taylor Blau
2aeb4484 42a64b41

+9 -2
+9 -2
gitk
··· 66 66 open |[make_arglist_safe $cmd] r 67 67 } 68 68 69 + # opens a command pipeline for reading and writing 70 + # cmd is a list that specifies the command and its arguments 71 + # calls `open` and returns the file id 72 + proc safe_open_command_rw {cmd} { 73 + open |[make_arglist_safe $cmd] r+ 74 + } 75 + 69 76 # opens a command pipeline for reading with redirections 70 77 # cmd is a list that specifies the command and its arguments 71 78 # redir is a list that specifies redirections ··· 4897 4904 # must be "containing:", i.e. we're searching commit info 4898 4905 return 4899 4906 } 4900 - set cmd [concat | git diff-tree -r -s --stdin $gdtargs] 4901 - set filehighlight [open $cmd r+] 4907 + set cmd [concat git diff-tree -r -s --stdin $gdtargs] 4908 + set filehighlight [safe_open_command_rw $cmd] 4902 4909 fconfigure $filehighlight -blocking 0 4903 4910 filerun $filehighlight readfhighlight 4904 4911 set fhl_list {}