setup: make sure Git never runs a pager
commitd7b662268778d8bbce438209828f609d1f9a934f
authorKyle J. McKay <mackyle@gmail.com>
Mon, 20 Nov 2017 22:47:39 +0000 (20 14:47 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Mon, 20 Nov 2017 22:47:39 +0000 (20 14:47 -0800)
tree9216e1bb092db8441dad7960e78558e8ae1658bf
parent19697ec6efd3ad50330de16f717fc4b3e32fe0fb
setup: make sure Git never runs a pager

Normally nothing in Girocco would ever cause Git to run
any command that would invoke a pager.

Furthermore, the alleged "exploits" that might persuade
Git to use a pager where it normally would not are not
viable with Girocco.

Nevertheless, hedge against this possibility by explicitly
setting the pager to "cat" so that if somehow all the
safety checks are bypassed and a pager does get run, it's
not a pager that allows one to escape to a subshell by
using a magic keystroke.

In addition, when running a command on behalf of a
remote client that has connected over ssh, abort the
connection if somehow it managed to set up a pseudo tty
on any of STDIN, STDOUT or STDERR.  This should not be
possible with a normal Girocco deployment, but the
fallback check doesn't hurt and provides an additional
layer of safety just in case.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
bin/git-shell-verify
jailsetup.sh
shlib.sh