From 058ef33173a3d4b6c0902b9b212a3c03bf984cc0 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Thu, 8 Feb 2018 14:12:47 -0800 Subject: [PATCH] jailsetup.sh: provide minimal Girocco ssh client config Normally Girocco does not use ssh. However, if a manually configured baseurl or perhaps a custom foreign VCS mirror is in use it might use it indirectly. Provide a bare minimal config for the ssh client when run under Girocco to attempt to suppress interactive prompts that could hang the fetch (ultimately resulting in it being killed anyway). Signed-off-by: Kyle J. McKay --- jailsetup.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/jailsetup.sh b/jailsetup.sh index 056730d..f4d3d1b 100755 --- a/jailsetup.sh +++ b/jailsetup.sh @@ -194,6 +194,29 @@ update_config_item http.lowSpeedTime 600 update_config_item receive.advertisePushOptions false 1 update_config_item receive.maxInputSize "${cfg_max_receive_size:-0}" 1 update_config_item girocco.notifyHook "${cfg_default_notifyhook}" 2 + +# set up some default ssh client config just in case (e.g. git-svn) +if [ -e etc/girocco/.ssh ] && ! [ -d etc/girocco/.ssh ]; then + echo "*** Error: chroot etc/girocco/.ssh exists but is not a directory." >&2 + exit 1 +fi +if [ -e etc/girocco/.ssh/config ] && ! [ -f etc/girocco/.ssh/config ]; then + echo "*** Error: chroot etc/girocco/.ssh/config exists but is not a file." >&2 + exit 1 +fi +if ! [ -s etc/girocco/.ssh/config ]; then + chmod u+w etc/girocco + didchmod=1 + [ -d etc/girocco/.ssh ] || mkdir etc/girocco/.ssh + cat >etc/girocco/.ssh/config </dev/null || -- 2.11.4.GIT