The scripts/openconnect-script.c has nothing OpenConnect specific and is
also used by VPNC. Thus, renaming it to generic vpn-script.c clarifies
the purpose of the script.
Changed OpenConnect and VPNC plugins to use vpn-script. Modified
Makefile.plugins also to use the vpn-script..
---
.gitignore | 2 +-
Makefile.plugins | 8 ++++----
scripts/{openconnect-script.c => vpn-script.c} | 8 +++++---
vpn/plugins/openconnect.c | 3 +--
vpn/plugins/vpnc.c | 3 +--
5 files changed, 12 insertions(+), 12 deletions(-)
rename scripts/{openconnect-script.c => vpn-script.c} (95%)
diff --git a/.gitignore b/.gitignore
index b43336c9..3088a92f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,7 +40,7 @@ src/connman-wait-online.service
src/connmand-wait-online
plugins/connman.policy
scripts/connman
-scripts/openconnect-script
+scripts/vpn-script
scripts/openvpn-script
scripts/connman_resolvconf.conf
client/connmanctl
diff --git a/Makefile.plugins b/Makefile.plugins
index 122b2935..87bcc6fc 100644
--- a/Makefile.plugins
+++ b/Makefile.plugins
@@ -191,14 +191,14 @@ plugins_iospm_la_LDFLAGS = $(plugin_ldflags)
endif
if OPENCONNECT
-script_PROGRAMS += scripts/openconnect-script
+script_PROGRAMS += scripts/vpn-script
-scripts_openconnect_script_LDADD = @DBUS_LIBS@
+scripts_vpn_script_LDADD = @DBUS_LIBS@
else
if VPNC
-script_PROGRAMS += scripts/openconnect-script
+script_PROGRAMS += scripts/vpn-script
-scripts_openconnect_script_LDADD = @DBUS_LIBS@
+scripts_vpn_script_LDADD = @DBUS_LIBS@
endif
endif
diff --git a/scripts/openconnect-script.c b/scripts/vpn-script.c
similarity index 95%
rename from scripts/openconnect-script.c
rename to scripts/vpn-script.c
index 5e04144f..6e020e92 100644
--- a/scripts/openconnect-script.c
+++ b/scripts/vpn-script.c
@@ -54,9 +54,11 @@ static void append(DBusMessageIter *dict, const char *pattern)
key = pattern;
value = delim + 1;
- /* We clean the environment before invoking openconnect, but
- might as well still filter out the few things that get
- added that we're not interested in */
+ /*
+ * We clean the environment before invoking openconnect/vpnc,
+ * but might as well still filter out the few things that get
+ * added that we're not interested in
+ */
if (!strcmp(key, "PWD") || !strcmp(key, "_") ||
!strcmp(key, "SHLVL") || !strcmp(key, "connman_busname") ||
!strcmp(key, "connman_network"))
diff --git a/vpn/plugins/openconnect.c b/vpn/plugins/openconnect.c
index 8e74479f..4117471c 100644
--- a/vpn/plugins/openconnect.c
+++ b/vpn/plugins/openconnect.c
@@ -248,8 +248,7 @@ static int run_connect(struct vpn_provider *provider,
connman_task_add_argument(task, "--syslog", NULL);
connman_task_add_argument(task, "--cookie-on-stdin", NULL);
- connman_task_add_argument(task, "--script",
- SCRIPTDIR "/openconnect-script");
+ connman_task_add_argument(task, "--script", SCRIPTDIR
"/vpn-script");
connman_task_add_argument(task, "--interface", if_name);
diff --git a/vpn/plugins/vpnc.c b/vpn/plugins/vpnc.c
index af9dbe76..cd9ff688 100644
--- a/vpn/plugins/vpnc.c
+++ b/vpn/plugins/vpnc.c
@@ -298,8 +298,7 @@ static int vc_connect(struct vpn_provider *provider,
connman_task_add_argument(task, "--ifmode", "tun");
}
- connman_task_add_argument(task, "--script",
- SCRIPTDIR "/openconnect-script");
+ connman_task_add_argument(task, "--script", SCRIPTDIR
"/vpn-script");
option = vpn_provider_get_string(provider, "VPNC.Debug");
if (option)
--
2.20.1
Show replies by date
Hi Jussi,
On Mon, Apr 29, 2019 at 05:32:50PM +0300, Jussi Laakkonen wrote:
The scripts/openconnect-script.c has nothing OpenConnect specific and
is
also used by VPNC. Thus, renaming it to generic vpn-script.c clarifies
the purpose of the script.
Changed OpenConnect and VPNC plugins to use vpn-script. Modified
Makefile.plugins also to use the vpn-script..
Patch applied.
Thanks,
Daniel