From 251fd06738471e7e10aa6b344ffcd7aab9fa76d8 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sat, 6 Dec 2014 16:55:40 -0800 Subject: [PATCH] Set GIT_TERMINAL_PROMPT=0 when running Git This will cause any prompts in response to remote 401 errors to be suppressed and fail immediately (if running a version of Git which supports GIT_TERMINAL_PROMPT=0). Since we do not provide a mechanism to interactively supply passwords when fetching from a mirror this is a good thing and will cause the fetch to die right away rather than waiting for its 15m timeout to get killed. --- Girocco/Config.pm | 1 + bin/git-shell-verify | 6 ++++-- shlib.sh | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Girocco/Config.pm b/Girocco/Config.pm index dbd07e2..59761ed 100644 --- a/Girocco/Config.pm +++ b/Girocco/Config.pm @@ -529,5 +529,6 @@ $ENV{'XDG_CONFIG_HOME'} = $chroot.'/var/empty'; $ENV{'HOME'} = $chroot.'/etc/girocco'; $ENV{'GIT_CONFIG_NOSYSTEM'} = 1; $ENV{'GIT_ATTR_NOSYSTEM'} = 1; +$ENV{'GIT_TERMINAL_PROMPT'} = 0; 1; diff --git a/bin/git-shell-verify b/bin/git-shell-verify index d93c0f2..a918ab6 100755 --- a/bin/git-shell-verify +++ b/bin/git-shell-verify @@ -10,6 +10,7 @@ set -e GIT_CONFIG_NOSYSTEM=1 GIT_ATTR_NOSYSTEM=1 +GIT_TERMINAL_PROMPT=0 if ! [ -x /usr/bin/perl ]; then # We are INSIDE the chroot @@ -25,10 +26,11 @@ fi mob=@mob@ webadmurl=@webadmurl@ -export GIT_CONFIG_NOSYSTEM -export GIT_ATTR_NOSYSTEM export XDG_CONFIG_HOME export HOME +export GIT_CONFIG_NOSYSTEM +export GIT_ATTR_NOSYSTEM +export GIT_TERMINAL_PROMPT # Only the following commands are allowed: # diff --git a/shlib.sh b/shlib.sh index e594023..fcfe660 100644 --- a/shlib.sh +++ b/shlib.sh @@ -43,10 +43,12 @@ XDG_CONFIG_HOME="$cfg_chroot/var/empty" HOME="$cfg_chroot/etc/girocco" GIT_CONFIG_NOSYSTEM=1 GIT_ATTR_NOSYSTEM=1 +GIT_TERMINAL_PROMPT=0 export XDG_CONFIG_HOME export HOME export GIT_CONFIG_NOSYSTEM export GIT_ATTR_NOSYSTEM +export GIT_TERMINAL_PROMPT # We cannot use a git() {} or nc_openbsd() {} function to redirect git # and nc_openbsd to the desired executables because when using -- 2.11.4.GIT