[network-manager-openswan/dcbw/libreswan: 3/12] core: update for non-deprecated libreswan shutdown
- From: Dan Williams <dcbw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openswan/dcbw/libreswan: 3/12] core: update for non-deprecated libreswan shutdown
- Date: Tue, 2 Dec 2014 01:02:32 +0000 (UTC)
commit d5fa02c3c790a29f2cbd39b5d9082ec5a27b44e0
Author: Dan Williams <dcbw redhat com>
Date: Mon Oct 20 14:41:38 2014 -0500
core: update for non-deprecated libreswan shutdown
Based on the systmed service file:
ExecStop=/usr/libexec/ipsec/whack --shutdown
src/nm-openswan-service.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/src/nm-openswan-service.c b/src/nm-openswan-service.c
index 9dcdf1c..a98c4c8 100644
--- a/src/nm-openswan-service.c
+++ b/src/nm-openswan-service.c
@@ -78,6 +78,7 @@ typedef struct {
typedef struct {
const char *ipsec_path;
const char *pluto_path;
+ const char *whack_path;
char *secrets_path;
gboolean libreswan;
@@ -384,9 +385,22 @@ static gboolean
ipsec_stop (NMOpenSwanPlugin *self, GError **error)
{
NMOpenSwanPluginPrivate *priv = NM_OPENSWAN_PLUGIN_GET_PRIVATE (self);
- const char *argv[4] = { priv->ipsec_path, "setup", "stop", NULL };
+ const char *argv[4];
+ guint i = 0;
delete_secrets_file (self);
+
+ if (priv->libreswan) {
+ argv[i++] = priv->whack_path;
+ argv[i++] = "--shutdown";
+ argv[i++] = NULL;
+ } else {
+ argv[i++] = priv->ipsec_path;
+ argv[i++] = "setup";
+ argv[i++] = "stop";
+ argv[i++] = NULL;
+ }
+
return g_spawn_sync (NULL, (char **) argv, NULL, 0, NULL, NULL, NULL, NULL, NULL, error);
}
@@ -1045,6 +1059,9 @@ _connect_common (NMVPNPlugin *plugin,
priv->pluto_path = find_helper ("pluto", error);
if (!priv->pluto_path)
return FALSE;
+ priv->whack_path = find_helper ("whack", error);
+ if (!priv->whack_path)
+ return FALSE;
}
priv->password = g_strdup (nm_setting_vpn_get_secret (s_vpn, NM_OPENSWAN_XAUTH_PASSWORD));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]