Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 888896 Details for
Bug 1083317
networkmanager crashes on openvpn restart
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch for NM-openvpn dist-git for f20
0001-fix-disconnect-on-openvpn-soft-restart.patch (text/plain), 22.76 KB, created by
Thomas Haller
on 2014-04-23 12:45:31 UTC
(
hide
)
Description:
Patch for NM-openvpn dist-git for f20
Filename:
MIME Type:
Creator:
Thomas Haller
Created:
2014-04-23 12:45:31 UTC
Size:
22.76 KB
patch
obsolete
>From fb93865c7cc40221110125b65af83efc1df2d595 Mon Sep 17 00:00:00 2001 >From: Thomas Haller <thaller@redhat.com> >Date: Wed, 23 Apr 2014 14:40:59 +0200 >Subject: [PATCH 1/1] fix disconnect on openvpn soft-restart > >Resolves: 1083317 >--- > 0001-backport-from-upstream.patch | 632 ++++++++++++++++++++++++++++++++++++++ > NetworkManager-openvpn.spec | 8 +- > 2 files changed, 639 insertions(+), 1 deletion(-) > create mode 100644 0001-backport-from-upstream.patch > >diff --git a/0001-backport-from-upstream.patch b/0001-backport-from-upstream.patch >new file mode 100644 >index 0000000..4761da3 >--- /dev/null >+++ b/0001-backport-from-upstream.patch >@@ -0,0 +1,632 @@ >+From 009c055039a441f827392dc57a134a16d3e1fdb9 Mon Sep 17 00:00:00 2001 >+From: =?UTF-8?q?Bal=C3=A1zs=20=C3=9Ar?= <urbalazs@src.gnome.org> >+Date: Thu, 20 Mar 2014 18:06:16 +0100 >+Subject: [PATCH 1/9] Updated Hungarian translation >+ >+(cherry picked from commit 009c055039a441f827392dc57a134a16d3e1fdb9) >+--- >+ po/hu.po | 82 ++++++++++++++++++++++++++++++++++++---------------------------- >+ 1 file changed, 46 insertions(+), 36 deletions(-) >+ >+diff --git a/po/hu.po b/po/hu.po >+index 258f1b2..dac4bbc 100644 >+--- a/po/hu.po >++++ b/po/hu.po >+@@ -5,19 +5,21 @@ >+ # Gabor Halaszvari <g.halaszvari at portmax dot hu>, 2006. >+ # Gabor Kelemen <kelemeng at gnome dot hu>, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013. >+ # Mate Ory <orymate at ubuntu dot com>, 2011. >++# Balázs Ãr <urbalazs@gmail.com>, 2014. >+ msgid "" >+ msgstr "" >+ "Project-Id-Version: network-manager-openvpn master\n" >+-"Report-Msgid-Bugs-To: \n" >+-"POT-Creation-Date: 2013-09-19 16:12+0200\n" >+-"PO-Revision-Date: 2013-09-19 16:11+0200\n" >+-"Last-Translator: Gabor Kelemen <kelemeng at gnome dot hu>\n" >++"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" >++"product=NetworkManager&keywords=I18N+L10N&component=VPN: openvpn\n" >++"POT-Creation-Date: 2014-03-20 11:09+0000\n" >++"PO-Revision-Date: 2014-03-20 18:05+0100\n" >++"Last-Translator: Balázs Ãr <urbalazs@gmail.com>\n" >+ "Language-Team: Hungarian <openscope at googlegroups dot com>\n" >+ "Language: hu\n" >+ "MIME-Version: 1.0\n" >+ "Content-Type: text/plain; charset=UTF-8\n" >+ "Content-Transfer-Encoding: 8bit\n" >+-"X-Generator: Lokalize 1.5\n" >++"X-Generator: Lokalize 1.2\n" >+ "Plural-Forms: nplurals=2; plural=(n != 1);\n" >+ >+ #: ../auth-dialog/main.c:175 >+@@ -25,125 +27,133 @@ msgstr "" >+ msgid "Authenticate VPN %s" >+ msgstr "%s VPN azonosÃtása" >+ >+-#: ../auth-dialog/main.c:183 ../properties/nm-openvpn-dialog.ui.h:100 >++#: ../auth-dialog/main.c:182 ../properties/nm-openvpn-dialog.ui.h:100 >+ msgid "Password:" >+ msgstr "Jelszó:" >+ >+-#: ../auth-dialog/main.c:192 ../auth-dialog/main.c:240 >++#: ../auth-dialog/main.c:189 ../auth-dialog/main.c:236 >+ msgid "Certificate password:" >+ msgstr "TanúsÃtvány jelszava:" >+ >+-#: ../auth-dialog/main.c:226 >++#: ../auth-dialog/main.c:222 >+ msgid "Authenticate VPN" >+ msgstr "VPN azonosÃtás" >+ >+-#: ../auth-dialog/main.c:231 >++#: ../auth-dialog/main.c:227 >+ msgid "Certificate pass_word:" >+ msgstr "TanúsÃtvány _jelszava:" >+ >+-#: ../auth-dialog/main.c:478 >++#: ../auth-dialog/main.c:474 >+ #, c-format >+ msgid "You need to authenticate to access the Virtual Private Network '%s'." >+ msgstr "AzonosÃtania kell magát a(z) â%sâ virtuális magánhálózat eléréséhez." >+ >+-#: ../properties/auth-helpers.c:148 >++#: ../nm-openvpn.desktop.in.h:1 >++msgid "VPN Connection Manager (OpenVPN)" >++msgstr "VPN kapcsolatkezelÅ (OpenVPN)" >++ >++#: ../nm-openvpn.desktop.in.h:2 >++msgid "Add, Remove, and Edit VPN Connections" >++msgstr "VPN kapcsolatok hozzáadása, szerkesztése és eltávolÃtása" >++ >++#: ../properties/auth-helpers.c:158 >+ msgid "Choose your personal certificate..." >+ msgstr "Válassza ki a személyes tanúsÃtványátâ¦" >+ >+-#: ../properties/auth-helpers.c:166 >++#: ../properties/auth-helpers.c:176 >+ msgid "Choose your private key..." >+ msgstr "Válassza ki a személyes kulcsátâ¦" >+ >+-#: ../properties/auth-helpers.c:238 >++#: ../properties/auth-helpers.c:253 >+ msgid "Saved" >+ msgstr "Mentett" >+ >+-#: ../properties/auth-helpers.c:246 >++#: ../properties/auth-helpers.c:261 >+ msgid "Always Ask" >+ msgstr "Mindig kérdezzen" >+ >+-#: ../properties/auth-helpers.c:251 >++#: ../properties/auth-helpers.c:266 >+ msgid "Not Required" >+ msgstr "Nem szükséges" >+ >+-#: ../properties/auth-helpers.c:341 >++#: ../properties/auth-helpers.c:356 >+ msgid "Choose a Certificate Authority certificate..." >+ msgstr "Válasszon hitelesÃtésszolgáltatói tanúsÃtványtâ¦" >+ >+-#: ../properties/auth-helpers.c:385 >++#: ../properties/auth-helpers.c:400 >+ msgid "Choose an OpenVPN static key..." >+ msgstr "Válassza ki az OpenVPN statikus kulcsátâ¦" >+ >+-#: ../properties/auth-helpers.c:409 ../properties/auth-helpers.c:1140 >+-#: ../properties/auth-helpers.c:1636 >++#: ../properties/auth-helpers.c:424 ../properties/auth-helpers.c:1155 >++#: ../properties/auth-helpers.c:1651 >+ msgid "None" >+ msgstr "Nincs" >+ >+-#: ../properties/auth-helpers.c:865 >++#: ../properties/auth-helpers.c:880 >+ msgid "PEM or PKCS#12 certificates (*.pem, *.crt, *.key, *.cer, *.p12)" >+ msgstr "PEM vagy PKCS#12 tanúsÃtványok (*.pem, *.crt, *.key, *.cer, *.p12)" >+ >+-#: ../properties/auth-helpers.c:866 >++#: ../properties/auth-helpers.c:881 >+ msgid "PEM certificates (*.pem, *.crt, *.key, *.cer)" >+ msgstr "PEM tanúsÃtványok (*.pem, *.crt, *.key, *.cer)" >+ >+-#: ../properties/auth-helpers.c:926 >++#: ../properties/auth-helpers.c:941 >+ msgid "OpenVPN Static Keys (*.key)" >+ msgstr "OpenVPN statikus kulcsok (*.key)" >+ >+-#: ../properties/auth-helpers.c:1056 ../properties/auth-helpers.c:1132 >++#: ../properties/auth-helpers.c:1071 ../properties/auth-helpers.c:1147 >+ msgid "Default" >+ msgstr "Alapértelmezett" >+ >+-#: ../properties/auth-helpers.c:1142 >++#: ../properties/auth-helpers.c:1157 >+ msgid "RSA MD-4" >+ msgstr "RSA MD-4" >+ >+-#: ../properties/auth-helpers.c:1144 >++#: ../properties/auth-helpers.c:1159 >+ msgid "MD-5" >+ msgstr "MD-5" >+ >+-#: ../properties/auth-helpers.c:1146 >++#: ../properties/auth-helpers.c:1161 >+ msgid "SHA-1" >+ msgstr "SHA-1" >+ >+-#: ../properties/auth-helpers.c:1148 >++#: ../properties/auth-helpers.c:1163 >+ msgid "SHA-224" >+ msgstr "SHA-224" >+ >+-#: ../properties/auth-helpers.c:1150 >++#: ../properties/auth-helpers.c:1165 >+ msgid "SHA-256" >+ msgstr "SHA-256" >+ >+-#: ../properties/auth-helpers.c:1152 >++#: ../properties/auth-helpers.c:1167 >+ msgid "SHA-384" >+ msgstr "SHA-384" >+ >+-#: ../properties/auth-helpers.c:1154 >++#: ../properties/auth-helpers.c:1169 >+ msgid "SHA-512" >+ msgstr "SHA-512" >+ >+-#: ../properties/auth-helpers.c:1156 >++#: ../properties/auth-helpers.c:1171 >+ msgid "RIPEMD-160" >+ msgstr "RIPEMD-160" >+ >+-#: ../properties/auth-helpers.c:1207 >++#: ../properties/auth-helpers.c:1222 >+ msgid "Server" >+ msgstr "Kiszolgáló" >+ >+-#: ../properties/auth-helpers.c:1212 >++#: ../properties/auth-helpers.c:1227 >+ msgid "Client" >+ msgstr "Kliens" >+ >+-#: ../properties/auth-helpers.c:1379 ../properties/nm-openvpn-dialog.ui.h:2 >++#: ../properties/auth-helpers.c:1394 ../properties/nm-openvpn-dialog.ui.h:2 >+ msgid "Not required" >+ msgstr "Nem szükséges" >+ >+-#: ../properties/auth-helpers.c:1381 >++#: ../properties/auth-helpers.c:1396 >+ msgid "HTTP" >+ msgstr "HTTP" >+ >+-#: ../properties/auth-helpers.c:1383 >++#: ../properties/auth-helpers.c:1398 >+ msgid "SOCKS" >+ msgstr "SOCKS" >+ >+-- >+1.9.0 >+ >+ >+From 0bda37998f1c506ad9d29126bd263d7a7588f747 Mon Sep 17 00:00:00 2001 >+From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com> >+Date: Thu, 20 Mar 2014 16:03:30 +0100 >+Subject: [PATCH 2/9] properties: fix a memory leak in import code >+ >+(cherry picked from commit 0bda37998f1c506ad9d29126bd263d7a7588f747) >+--- >+ properties/import-export.c | 4 +--- >+ 1 file changed, 1 insertion(+), 3 deletions(-) >+ >+diff --git a/properties/import-export.c b/properties/import-export.c >+index 804fc3c..a4b2560 100644 >+--- a/properties/import-export.c >++++ b/properties/import-export.c >+@@ -432,9 +432,7 @@ do_import (const char *path, char **lines, GError **error) >+ >+ if ( !strncmp (*line, HTTP_PROXY_RETRY_TAG, strlen (HTTP_PROXY_RETRY_TAG)) >+ || !strncmp (*line, SOCKS_PROXY_RETRY_TAG, strlen (SOCKS_PROXY_RETRY_TAG))) { >+- nm_setting_vpn_add_data_item (s_vpn, >+- g_strdup (NM_OPENVPN_KEY_PROXY_RETRY), >+- g_strdup ("yes")); >++ nm_setting_vpn_add_data_item (s_vpn, NM_OPENVPN_KEY_PROXY_RETRY, "yes"); >+ continue; >+ } >+ >+-- >+1.9.0 >+ >+ >+From a39781d88eac42781dacd7f959117bb6922f9f83 Mon Sep 17 00:00:00 2001 >+From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com> >+Date: Mon, 24 Mar 2014 12:45:19 +0100 >+Subject: [PATCH 3/9] trivial: fix error messages for tests >+ >+(cherry picked from commit a39781d88eac42781dacd7f959117bb6922f9f83) >+--- >+ properties/tests/test-import-export.c | 6 +++--- >+ 1 file changed, 3 insertions(+), 3 deletions(-) >+ >+diff --git a/properties/tests/test-import-export.c b/properties/tests/test-import-export.c >+index 8031f65..0232c91 100644 >+--- a/properties/tests/test-import-export.c >++++ b/properties/tests/test-import-export.c >+@@ -71,14 +71,14 @@ test_item (const char *test, >+ >+ value = nm_setting_vpn_get_data_item (s_vpn, item); >+ if (expected == NULL) { >+- ASSERT (value == NULL, test, "unexpected '%s' item value (found '%s', expected NULL", >++ ASSERT (value == NULL, test, "unexpected '%s' item value (found '%s', expected NULL)", >+ item, value); >+ return; >+ } >+ >+ ASSERT (value != NULL, test, "missing '%s' item value", item); >+ ASSERT (strcmp (value, expected) == 0, test, >+- "unexpected '%s' secret value (found '%s', expected '%s')", >++ "unexpected '%s' item value (found '%s', expected '%s')", >+ item, value, expected); >+ } >+ >+@@ -94,7 +94,7 @@ test_secret (const char *test, >+ >+ value = nm_setting_vpn_get_secret (s_vpn, item); >+ if (expected == NULL) { >+- ASSERT (value == NULL, test, "unexpected '%s' secret value (found '%s', expected NULL", >++ ASSERT (value == NULL, test, "unexpected '%s' secret value (found '%s', expected NULL)", >+ item, value); >+ return; >+ } >+-- >+1.9.0 >+ >+ >+From 8a41f0af3d435ef17ab77d0394e92fba33a6b9d5 Mon Sep 17 00:00:00 2001 >+From: Thomas Haller <thaller@redhat.com> >+Date: Tue, 18 Mar 2014 15:32:25 +0100 >+Subject: [PATCH 5/9] helper: improve parsing of command line arguments >+ >+Allow a separator argument "--" to separate arguments >+provided by openvpn from the arguments provided by the >+plugin. >+ >+Signed-off-by: Thomas Haller <thaller@redhat.com> >+ >+(cherry picked from commit 8a41f0af3d435ef17ab77d0394e92fba33a6b9d5) >+--- >+ src/nm-openvpn-service-openvpn-helper.c | 30 +++++++++++++++++++++++++----- >+ src/nm-openvpn-service.c | 8 ++++---- >+ 2 files changed, 29 insertions(+), 9 deletions(-) >+ >+diff --git a/src/nm-openvpn-service-openvpn-helper.c b/src/nm-openvpn-service-openvpn-helper.c >+index 601229e..3b752b3 100644 >+--- a/src/nm-openvpn-service-openvpn-helper.c >++++ b/src/nm-openvpn-service-openvpn-helper.c >+@@ -57,6 +57,8 @@ extern char **environ; >+ #define DBUS_TYPE_G_IP6_ROUTE (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, G_TYPE_INVALID)) >+ #define DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_IP6_ROUTE)) >+ >++static gboolean helper_debug = FALSE; >++ >+ static void >+ helper_failed (DBusGConnection *connection, const char *reason) >+ { >+@@ -535,18 +537,25 @@ main (int argc, char *argv[]) >+ struct in_addr temp_addr; >+ gboolean tapdev = FALSE; >+ char **iter; >++ int shift = 0; >+ >+ #if !GLIB_CHECK_VERSION (2, 35, 0) >+ g_type_init (); >+ #endif >+ >+- connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &err); >+- if (!connection) { >+- g_warning ("Could not get the system bus: %s", err->message); >+- exit (1); >++ for (i = 1; i < argc; i++) { >++ if (!strcmp (argv[i], "--")) { >++ i++; >++ break; >++ } >++ if (!strcmp (argv[i], "--helper-debug")) >++ helper_debug = TRUE; >++ else >++ break; >+ } >++ shift = i - 1; >+ >+- if (argc >= 2 && !g_strcmp0 (argv[1], "--helper-debug")) { >++ if (helper_debug) { >+ g_message ("openvpn script environment ---------------------------"); >+ iter = environ; >+ while (iter && *iter) >+@@ -554,6 +563,17 @@ main (int argc, char *argv[]) >+ g_message ("------------------------------------------------------"); >+ } >+ >++ /* shift the arguments to the right leaving only those provided by openvpn */ >++ argv[shift] = argv[0]; >++ argv += shift; >++ argc -= shift; >++ >++ connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &err); >++ if (!connection) { >++ g_warning ("Could not get the system bus: %s", err->message); >++ exit (1); >++ } >++ >+ config = g_hash_table_new (g_str_hash, g_str_equal); >+ ip4config = g_hash_table_new (g_str_hash, g_str_equal); >+ ip6config = g_hash_table_new (g_str_hash, g_str_equal); >+diff --git a/src/nm-openvpn-service.c b/src/nm-openvpn-service.c >+index 66f2118..fc3fd84 100644 >+--- a/src/nm-openvpn-service.c >++++ b/src/nm-openvpn-service.c >+@@ -866,6 +866,7 @@ nm_openvpn_start_openvpn_binary (NMOpenvpnPlugin *plugin, >+ GPtrArray *args; >+ GSource *openvpn_watch; >+ GPid pid; >++ char *stmp; >+ >+ /* Find openvpn */ >+ openvpn_binary = nm_find_openvpn (); >+@@ -1110,10 +1111,9 @@ nm_openvpn_start_openvpn_binary (NMOpenvpnPlugin *plugin, >+ >+ /* Up script, called when connection has been established or has been restarted */ >+ add_openvpn_arg (args, "--up"); >+- if (debug) >+- add_openvpn_arg (args, NM_OPENVPN_HELPER_PATH " --helper-debug"); >+- else >+- add_openvpn_arg (args, NM_OPENVPN_HELPER_PATH); >++ stmp = g_strdup_printf ("%s%s --", NM_OPENVPN_HELPER_PATH, debug ? " --helper-debug" : ""); >++ add_openvpn_arg (args, stmp); >++ g_free (stmp); >+ add_openvpn_arg (args, "--up-restart"); >+ >+ /* Keep key and tun if restart is needed */ >+-- >+1.9.0 >+ >+ >+From 38c4273ad269cca254e4e7687917d34bf050e04b Mon Sep 17 00:00:00 2001 >+From: Thomas Haller <thaller@redhat.com> >+Date: Tue, 18 Mar 2014 15:39:56 +0100 >+Subject: [PATCH 6/9] helper: log the command line arguments for >+ "--helper-debug" >+ >+Signed-off-by: Thomas Haller <thaller@redhat.com> >+ >+(cherry picked from commit 38c4273ad269cca254e4e7687917d34bf050e04b) >+--- >+ src/nm-openvpn-service-openvpn-helper.c | 17 ++++++++++++++++- >+ 1 file changed, 16 insertions(+), 1 deletion(-) >+ >+diff --git a/src/nm-openvpn-service-openvpn-helper.c b/src/nm-openvpn-service-openvpn-helper.c >+index 3b752b3..1094d80 100644 >+--- a/src/nm-openvpn-service-openvpn-helper.c >++++ b/src/nm-openvpn-service-openvpn-helper.c >+@@ -556,10 +556,25 @@ main (int argc, char *argv[]) >+ shift = i - 1; >+ >+ if (helper_debug) { >++ GString *args; >++ >++ args = g_string_new (NULL); >++ for (i = 0; i < argc; i++) { >++ if (i > 0) >++ g_string_append_c (args, ' '); >++ if (shift && 1 + shift == i) >++ g_string_append (args, " "); >++ tmp = g_strescape (argv[i], NULL); >++ g_string_append_printf (args, "\"%s\"", tmp); >++ g_free (tmp); >++ } >++ >++ g_message ("command line: %s", args->str); >++ g_string_free (args, TRUE); >+ g_message ("openvpn script environment ---------------------------"); >+ iter = environ; >+ while (iter && *iter) >+- g_print ("%s\n", *iter++); >++ g_message ("%s", *iter++); >+ g_message ("------------------------------------------------------"); >+ } >+ >+-- >+1.9.0 >+ >+ >+From 17a837d0e36df086bf842d1ebd6abef2585585f5 Mon Sep 17 00:00:00 2001 >+From: Thomas Haller <thaller@redhat.com> >+Date: Tue, 18 Mar 2014 15:40:41 +0100 >+Subject: [PATCH 7/9] helper: pass device type to helper script as command line >+ argument >+ >+The device name can be changed, so we should not use it do detect >+the device type. Instead pass it to the helper script as argument. >+ >+Signed-off-by: Thomas Haller <thaller@redhat.com> >+ >+(cherry picked from commit 17a837d0e36df086bf842d1ebd6abef2585585f5) >+--- >+ src/nm-openvpn-service-openvpn-helper.c | 10 +++++++--- >+ src/nm-openvpn-service.c | 10 +++++----- >+ 2 files changed, 12 insertions(+), 8 deletions(-) >+ >+diff --git a/src/nm-openvpn-service-openvpn-helper.c b/src/nm-openvpn-service-openvpn-helper.c >+index 1094d80..edf44e7 100644 >+--- a/src/nm-openvpn-service-openvpn-helper.c >++++ b/src/nm-openvpn-service-openvpn-helper.c >+@@ -535,7 +535,7 @@ main (int argc, char *argv[]) >+ GValue *nbns_list = NULL; >+ GPtrArray *dns_domains = NULL; >+ struct in_addr temp_addr; >+- gboolean tapdev = FALSE; >++ int tapdev = -1; >+ char **iter; >+ int shift = 0; >+ >+@@ -550,6 +550,10 @@ main (int argc, char *argv[]) >+ } >+ if (!strcmp (argv[i], "--helper-debug")) >+ helper_debug = TRUE; >++ else if (!strcmp (argv[i], "--tun")) >++ tapdev = 0; >++ else if (!strcmp (argv[i], "--tap")) >++ tapdev = 1; >+ else >+ break; >+ } >+@@ -619,8 +623,8 @@ main (int argc, char *argv[]) >+ else >+ helper_failed (connection, "Tunnel Device"); >+ >+- if (strncmp (tmp, "tap", 3) == 0) >+- tapdev = TRUE; >++ if (tapdev == -1) >++ tapdev = strncmp (tmp, "tap", 3) == 0; >+ >+ /* IPv4 address */ >+ tmp = getenv ("ifconfig_local"); >+diff --git a/src/nm-openvpn-service.c b/src/nm-openvpn-service.c >+index fc3fd84..f2f013c 100644 >+--- a/src/nm-openvpn-service.c >++++ b/src/nm-openvpn-service.c >+@@ -866,6 +866,7 @@ nm_openvpn_start_openvpn_binary (NMOpenvpnPlugin *plugin, >+ GPtrArray *args; >+ GSource *openvpn_watch; >+ GPid pid; >++ gboolean dev_type_is_tap; >+ char *stmp; >+ >+ /* Find openvpn */ >+@@ -957,10 +958,8 @@ nm_openvpn_start_openvpn_binary (NMOpenvpnPlugin *plugin, >+ /* Device, either tun or tap */ >+ add_openvpn_arg (args, "--dev"); >+ tmp = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_TAP_DEV); >+- if (tmp && !strcmp (tmp, "yes")) >+- add_openvpn_arg (args, "tap"); >+- else >+- add_openvpn_arg (args, "tun"); >++ dev_type_is_tap = !g_strcmp0 (tmp, "yes"); >++ add_openvpn_arg (args, dev_type_is_tap ? "tap" : "tun"); >+ >+ /* Protocol, either tcp or udp */ >+ add_openvpn_arg (args, "--proto"); >+@@ -1111,7 +1110,8 @@ nm_openvpn_start_openvpn_binary (NMOpenvpnPlugin *plugin, >+ >+ /* Up script, called when connection has been established or has been restarted */ >+ add_openvpn_arg (args, "--up"); >+- stmp = g_strdup_printf ("%s%s --", NM_OPENVPN_HELPER_PATH, debug ? " --helper-debug" : ""); >++ stmp = g_strdup_printf ("%s%s %s --", NM_OPENVPN_HELPER_PATH, debug ? " --helper-debug" : "", >++ dev_type_is_tap ? "--tap" : "--tun"); >+ add_openvpn_arg (args, stmp); >+ g_free (stmp); >+ add_openvpn_arg (args, "--up-restart"); >+-- >+1.9.0 >+ >+ >+From 39e9437fa6f1e3271776aae632f5b3a34d0ac5f9 Mon Sep 17 00:00:00 2001 >+From: Thomas Haller <thaller@redhat.com> >+Date: Tue, 18 Mar 2014 15:42:13 +0100 >+Subject: [PATCH 8/9] helper: gracefully handle missing environment variables >+ in --up-restart invocations >+ >+When calling the script during restart, some environment variables are >+not set properly. Work around this by taking the values from the >+command line arguments instead. >+ >+https://bugzilla.gnome.org/show_bug.cgi?id=556134 >+https://bugs.launchpad.net/ubuntu/+source/network-manager-openvpn/+bug/280160/ >+https://bugzilla.redhat.com/show_bug.cgi?id=766340 >+https://bugzilla.redhat.com/show_bug.cgi?id=1083317 >+ >+Signed-off-by: Thomas Haller <thaller@redhat.com> >+ >+(cherry picked from commit 39e9437fa6f1e3271776aae632f5b3a34d0ac5f9) >+--- >+ src/nm-openvpn-service-openvpn-helper.c | 11 +++++++++-- >+ 1 file changed, 9 insertions(+), 2 deletions(-) >+ >+diff --git a/src/nm-openvpn-service-openvpn-helper.c b/src/nm-openvpn-service-openvpn-helper.c >+index edf44e7..2c07cff 100644 >+--- a/src/nm-openvpn-service-openvpn-helper.c >++++ b/src/nm-openvpn-service-openvpn-helper.c >+@@ -538,6 +538,7 @@ main (int argc, char *argv[]) >+ int tapdev = -1; >+ char **iter; >+ int shift = 0; >++ gboolean is_restart; >+ >+ #if !GLIB_CHECK_VERSION (2, 35, 0) >+ g_type_init (); >+@@ -587,6 +588,8 @@ main (int argc, char *argv[]) >+ argv += shift; >+ argc -= shift; >+ >++ is_restart = argc >= 7 && !g_strcmp0 (argv[6], "restart"); >++ >+ connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &err); >+ if (!connection) { >+ g_warning ("Could not get the system bus: %s", err->message); >+@@ -628,6 +631,8 @@ main (int argc, char *argv[]) >+ >+ /* IPv4 address */ >+ tmp = getenv ("ifconfig_local"); >++ if (!tmp && is_restart) >++ tmp = argv[4]; >+ if (tmp && strlen (tmp)) { >+ val = addr4_to_gvalue (tmp); >+ if (val) >+@@ -637,13 +642,15 @@ main (int argc, char *argv[]) >+ } >+ >+ /* PTP address; for vpnc PTP address == internal IP4 address */ >+- val = addr4_to_gvalue (getenv ("ifconfig_remote")); >++ tmp = getenv ("ifconfig_remote"); >++ if (!tmp && is_restart) >++ tmp = argv[5]; >++ val = addr4_to_gvalue (tmp); >+ if (val) { >+ /* Sigh. Openvpn added 'topology' stuff in 2.1 that changes the meaning >+ * of the ifconfig bits without actually telling you what they are >+ * supposed to mean; basically relying on specific 'ifconfig' behavior. >+ */ >+- tmp = getenv ("ifconfig_remote"); >+ if (tmp && !strncmp (tmp, "255.", 4)) { >+ guint32 addr; >+ >+-- >+1.9.0 >+ >+ >+From 62d535c10bbe35196d5f0c8f00656e071b64ead0 Mon Sep 17 00:00:00 2001 >+From: Thomas Haller <thaller@redhat.com> >+Date: Mon, 24 Mar 2014 14:46:35 +0100 >+Subject: [PATCH 9/9] set G_LOG_DOMAIN to nm-openvpn >+ >+Signed-off-by: Thomas Haller <thaller@redhat.com> >+ >+(cherry picked from commit 62d535c10bbe35196d5f0c8f00656e071b64ead0) >+--- >+ src/Makefile.am | 1 + >+ 1 file changed, 1 insertion(+) >+ >+diff --git a/src/Makefile.am b/src/Makefile.am >+index e5a0b7e..700f0d9 100644 >+--- a/src/Makefile.am >++++ b/src/Makefile.am >+@@ -12,6 +12,7 @@ AM_CPPFLAGS = \ >+ -DLOCALSTATEDIR=\""$(localstatedir)"\" \ >+ -DDATADIR=\"$(datadir)\" \ >+ -DNM_OPENVPN_LOCALEDIR=\"$(datadir)/locale\" \ >++ -DG_LOG_DOMAIN=\"nm-openvpn\" \ >+ -I$(top_srcdir) >+ >+ libexec_PROGRAMS = nm-openvpn-service nm-openvpn-service-openvpn-helper >+-- >+1.9.0 >+ >diff --git a/NetworkManager-openvpn.spec b/NetworkManager-openvpn.spec >index 2879159..8497423 100644 >--- a/NetworkManager-openvpn.spec >+++ b/NetworkManager-openvpn.spec >@@ -4,11 +4,12 @@ Summary: NetworkManager VPN plugin for OpenVPN > Name: NetworkManager-openvpn > Epoch: 1 > Version: 0.9.9.0 >-Release: 0.1%{snapshot}%{?dist} >+Release: 0.1.test1%{snapshot}%{?dist} > License: GPLv2+ > URL: http://www.gnome.org/projects/NetworkManager/ > Group: System Environment/Base > Source0: http://ftp.gnome.org/pub/GNOME/sources/%{name}/0.9/%{name}-%{version}%{snapshot}.tar.bz2 >+Patch1: 0001-backport-from-upstream.patch > > BuildRequires: gtk3-devel > BuildRequires: dbus-devel >@@ -55,6 +56,8 @@ the OpenVPN server with NetworkManager (GNOME files). > %prep > %setup -q -n %{name}-%{version} > >+%patch1 -p1 -b .0001-backport-from-upstream.orig >+ > %build > if [ ! -f configure ]; then > ./autogen.sh >@@ -91,6 +94,9 @@ rm -f %{buildroot}%{_libdir}/NetworkManager/lib*.la > %{_datadir}/gnome-vpn-properties/openvpn/nm-openvpn-dialog.ui > > %changelog >+* Wed Apr 23 2014 Thomas Haller <thaller@redhat.com> - 1:0.9.9.0-0.1.test1 >+- fix disconnects on openvpn soft-restarts (bgo #556134, rh #1083317) >+ > * Tue Jan 28 2014 Dan Williams <dcbw@redhat.com> - 1:0.9.9.0-0.1 > - core: add support for IPv6 inside tunnels (rh #1033868) > - auth: add support for interactive mode >-- >1.9.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
thaller
: review-
Actions:
View
|
Diff
Attachments on
bug 1083317
: 888896 |
888908