diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2012-08-22 11:28:01 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-08-23 14:20:10 +0300 |
commit | b852e57ba2f0c69688755aa1df97ec51f5988e3f (patch) | |
tree | d16a8083436897fedb09182b2f5c01b8d9ce9467 /plugins | |
parent | 3a8be9689f01e359a3325b1a9afbfb653883aed1 (diff) | |
download | connman-b852e57ba2f0c69688755aa1df97ec51f5988e3f.tar.gz connman-b852e57ba2f0c69688755aa1df97ec51f5988e3f.tar.bz2 connman-b852e57ba2f0c69688755aa1df97ec51f5988e3f.zip |
vpn: Accept also "true" or "1" as a boolean value
Currently user is able to set the boolean VPN config value
only by setting the variable to "yes". This is not very
intuitive so accept also the value of "true" or "1".
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/l2tp.c | 4 | ||||
-rw-r--r-- | plugins/pptp.c | 4 | ||||
-rw-r--r-- | plugins/vpnc.c | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/plugins/l2tp.c b/plugins/l2tp.c index 5a655e63..39c96181 100644 --- a/plugins/l2tp.c +++ b/plugins/l2tp.c @@ -285,7 +285,9 @@ static ssize_t l2tp_write_bool_option(int fd, ssize_t ret = 0; if (key != NULL && value != NULL) { - if (strcmp(value, "yes") == 0) { + if (strcasecmp(value, "yes") == 0 || + strcasecmp(value, "true") == 0 || + strcmp(value, "1") == 0) { buf = g_strdup_printf("%s\n", key); ret = full_write(fd, buf, strlen(buf)); diff --git a/plugins/pptp.c b/plugins/pptp.c index 9db1b896..365bde7c 100644 --- a/plugins/pptp.c +++ b/plugins/pptp.c @@ -225,7 +225,9 @@ static void pptp_write_bool_option(struct connman_task *task, const char *key, const char *value) { if (key != NULL && value != NULL) { - if (strcmp(value, "yes") == 0) + if (strcasecmp(value, "yes") == 0 || + strcasecmp(value, "true") == 0 || + strcmp(value, "1") == 0) connman_task_add_argument(task, key, NULL); } } diff --git a/plugins/vpnc.c b/plugins/vpnc.c index fea1c15c..6b7a02be 100644 --- a/plugins/vpnc.c +++ b/plugins/vpnc.c @@ -194,7 +194,9 @@ static ssize_t write_bool_option(int fd, const char *key, const char *value) ssize_t ret = 0; if (key != NULL && value != NULL) { - if (strcmp(value, "yes") == 0) { + if (strcasecmp(value, "yes") == 0 || + strcasecmp(value, "true") == 0 || + strcmp(value, "1") == 0) { buf = g_strdup_printf("%s\n", key); ret = full_write(fd, buf, strlen(buf)); |