Commit ab67ab07 authored by alice's avatar alice 😈
Browse files

setup-proxy: fix empty proxy

the while loop loops until the value of proxyurl is none or a http*://
scheme. however, when proxyurl is set to 'none', it then gets unset here
(`proxyurl= ;`), but the following `if` block checks if it is 'none' and
fails, so we configure an empty http_proxy= in the proxy.sh profile
script. this is then read by some software, and it causes it to crash.
for instance, flatpak via glib reads `http_proxy` from the environment,
and an empty variable is illegal.
parent 2b6126d6
Pipeline #126427 passed with stage
in 23 seconds
......@@ -41,7 +41,7 @@ suggest=${http_proxy:-none}
while [ $# -eq 0 ]; do
case "$proxyurl" in
http://*|https://*) break;;
none) proxyurl= ; break;;
none) break;;
esac
ask "HTTP/FTP proxy URL? (e.g. 'http://proxy:8080', or 'none')" $suggest
proxyurl=$resp
......
......@@ -4,7 +4,8 @@
init_tests \
setup_proxy_usage \
setup_proxy_url \
setup_proxy_none
setup_proxy_none \
setup_proxy_interactive_none
setup_proxy_usage_body() {
test_usage setup-proxy
......@@ -35,3 +36,18 @@ setup_proxy_none_body() {
fi
}
setup_proxy_interactive_none_body() {
init_env
mkdir -p etc/profile.d
touch etc/profile.d/proxy.sh
echo none | atf_check -s exit:0 \
-o match:"HTTP/FTP proxy URL" \
-e empty \
setup-proxy
if test -e etc/profile.d/proxy.sh; then
atf_fail "etc/profile.d/proxy.sh was not removed"
fi
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment