aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services
diff options
context:
space:
mode:
authorMagnus Kroken <mkroken@gmail.com>2016-12-10 12:02:03 +0100
committerFelix Fietkau <nbd@nbd.name>2016-12-12 10:22:19 +0100
commita456dd96e7d2131cac1e7c2cca5e124d43d50f13 (patch)
tree3bac779234d7de3fb3a5fbc6d99aaafe954aa996 /package/network/services
parent4b8c69258e5ff10178638f0503e59175e452a3df (diff)
downloadupstream-a456dd96e7d2131cac1e7c2cca5e124d43d50f13.tar.gz
upstream-a456dd96e7d2131cac1e7c2cca5e124d43d50f13.tar.bz2
upstream-a456dd96e7d2131cac1e7c2cca5e124d43d50f13.zip
openvpn: quote parameters to --push in openvpn config file
OpenVPN requires arguments to --push to be enclosed in double quotes. One set of quotes is stripped when the UCI config is parsed. Change append_params() of openvpn.init to enclose push parameters in double quotes. Unquoted push parameters do not cause errors in OpenVPN 2.3, but OpenVPN 2.4 fails to start with unquoted push parameters. Fixes: FS#290. Signed-off-by: Magnus Kroken <mkroken@gmail.com>
Diffstat (limited to 'package/network/services')
-rw-r--r--package/network/services/openvpn/files/openvpn.init3
1 files changed, 2 insertions, 1 deletions
diff --git a/package/network/services/openvpn/files/openvpn.init b/package/network/services/openvpn/files/openvpn.init
index 4c8f77f92e..0fcdc7eea0 100644
--- a/package/network/services/openvpn/files/openvpn.init
+++ b/package/network/services/openvpn/files/openvpn.init
@@ -42,7 +42,8 @@ append_params() {
config_get v "$s" "$p"
IFS="$LIST_SEP"
for v in $v; do
- [ -n "$v" ] && append_param "$s" "$p" && echo " $v" >> "/var/etc/openvpn-$s.conf"
+ [ -n "$v" ] && [ "$p" != "push" ] && append_param "$s" "$p" && echo " $v" >> "/var/etc/openvpn-$s.conf"
+ [ -n "$v" ] && [ "$p" == "push" ] && append_param "$s" "$p" && echo " \"$v\"" >> "/var/etc/openvpn-$s.conf"
done
unset IFS
done