summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAdrien Bustany <adrien.bustany@nokia.com>2012-04-27 10:59:04 +0300
committerMarcel Holtmann <marcel@holtmann.org>2012-04-27 14:07:15 +0200
commitf5db9e8c5eb5061052b84a29631fafb802d25a6f (patch)
treeca92b56dfb2dd7ff8dfd1c9087909baca8f4810d /plugins
parenta197db1179af88c16e8208e68a3cedf8a6067ec7 (diff)
downloadconnman-f5db9e8c5eb5061052b84a29631fafb802d25a6f.tar.gz
connman-f5db9e8c5eb5061052b84a29631fafb802d25a6f.tar.bz2
connman-f5db9e8c5eb5061052b84a29631fafb802d25a6f.zip
openvpn: Fix --comp-lzo parameter handling
The previous code would assume all commandline options to have a value, whereas --comp-lzo does not. As a result, openvpn's argv would have a spurious empty string in its argv, and openvpn would not launch.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/openvpn.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/plugins/openvpn.c b/plugins/openvpn.c
index 2f7decf2..8df8a3f3 100644
--- a/plugins/openvpn.c
+++ b/plugins/openvpn.c
@@ -48,20 +48,21 @@ static DBusConnection *connection;
struct {
const char *cm_opt;
const char *ov_opt;
+ char has_value;
} ov_options[] = {
- { "Host", "--remote" },
- { "OpenVPN.CACert", "--ca" },
- { "OpenVPN.Cert", "--cert" },
- { "OpenVPN.Key", "--key" },
- { "OpenVPN.MTU", "--mtu" },
- { "OpenVPN.Proto", "--proto" },
- { "OpenVPN.Port", "--port" },
- { "OpenVPN.AuthUserPass", "--auth-user-pass" },
- { "OpenVPN.TLSRemote", "--tls-remote" },
- { "OpenVPN.Cipher", "--cipher" },
- { "OpenVPN.Auth", "--auth" },
- { "OpenVPN.CompLZO", "--comp-lzo" },
- { "OpenVPN.RemoteCertTls", "--remote-cert-tls" },
+ { "Host", "--remote", 1 },
+ { "OpenVPN.CACert", "--ca", 1 },
+ { "OpenVPN.Cert", "--cert", 1 },
+ { "OpenVPN.Key", "--key", 1 },
+ { "OpenVPN.MTU", "--mtu", 1 },
+ { "OpenVPN.Proto", "--proto", 1 },
+ { "OpenVPN.Port", "--port", 1 },
+ { "OpenVPN.AuthUserPass", "--auth-user-pass", 1 },
+ { "OpenVPN.TLSRemote", "--tls-remote", 1 },
+ { "OpenVPN.Cipher", "--cipher", 1 },
+ { "OpenVPN.Auth", "--auth", 1 },
+ { "OpenVPN.CompLZO", "--comp-lzo", 0 },
+ { "OpenVPN.RemoteCertTls", "--remote-cert-tls", 1 },
};
static void ov_append_dns_entries(const char *key, const char *value,
@@ -208,7 +209,8 @@ static int task_append_config_data(struct connman_provider *provider,
continue;
if (connman_task_add_argument(task,
- ov_options[i].ov_opt, option) < 0) {
+ ov_options[i].ov_opt,
+ ov_options[i].has_value ? option : NULL) < 0) {
return -EIO;
}
}