[network-manager-openswan/dcbw/libreswan: 8/16] 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: 8/16] core: update for non-deprecated libreswan shutdown
- Date: Fri, 12 Dec 2014 19:16:47 +0000 (UTC)
commit dd81aa88a9155c0e709b0c7745e7d722f01e80b2
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 65b8861..769447c 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;
@@ -403,9 +404,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);
}
@@ -1064,6 +1078,9 @@ _connect_common (NMVPNPlugin *plugin,
priv->pluto_path = find_helper_libexec ("pluto", error);
if (!priv->pluto_path)
return FALSE;
+ priv->whack_path = find_helper_libexec ("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]