Skip to content

Commit 646ca89

Browse files
committed
Merge branch 'jk/http-test-cgipassauth-unavailable-in-older-apache'
We started unconditionally testing with CGIPassAuth directive but it is unavailable in older Apache that ships with CentOS 7 that has about a year of shelf-life still left. The test has conditionally been disabled when running with an ancient Apache. This was a fix for a recent regression caught before the release, so no need to mention it in the release notes. * jk/http-test-cgipassauth-unavailable-in-older-apache: t/lib-httpd: make CGIPassAuth support conditional
2 parents 633390b + eb1c42d commit 646ca89

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

t/lib-httpd.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,20 @@ enable_http2 () {
191191
test_set_prereq HTTP2
192192
}
193193

194+
enable_cgipassauth () {
195+
# We are looking for 2.4.13 or more recent. Since we only support
196+
# 2.4 and up, no need to check for older major/minor.
197+
if test "$HTTPD_VERSION_MAJOR" = 2 &&
198+
test "$HTTPD_VERSION_MINOR" = 4 &&
199+
test "$(echo $HTTPD_VERSION | cut -d. -f3)" -lt 13
200+
then
201+
echo >&4 "apache $HTTPD_VERSION too old for CGIPassAuth"
202+
return
203+
fi
204+
HTTPD_PARA="$HTTPD_PARA -DUSE_CGIPASSAUTH"
205+
test_set_prereq CGIPASSAUTH
206+
}
207+
194208
start_httpd() {
195209
prepare_httpd >&3 2>&4
196210

t/lib-httpd/apache.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ SetEnv PERL_PATH ${PERL_PATH}
146146
<LocationMatch /custom_auth/>
147147
SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
148148
SetEnv GIT_HTTP_EXPORT_ALL
149+
<IfDefine USE_CGIPASSAUTH>
149150
CGIPassAuth on
151+
</IfDefine>
150152
</LocationMatch>
151153
ScriptAlias /smart/incomplete_length/git-upload-pack incomplete-length-upload-pack-v2-http.sh/
152154
ScriptAlias /smart/incomplete_body/git-upload-pack incomplete-body-upload-pack-v2-http.sh/

t/t5563-simple-http-auth.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ test_description='test http auth header and credential helper interop'
55
. ./test-lib.sh
66
. "$TEST_DIRECTORY"/lib-httpd.sh
77

8+
enable_cgipassauth
9+
if ! test_have_prereq CGIPASSAUTH
10+
then
11+
skip_all="no CGIPassAuth support"
12+
test_done
13+
fi
814
start_httpd
915

1016
test_expect_success 'setup_credential_helper' '

0 commit comments

Comments
 (0)