summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net-misc/networkmanager-openvpn/ChangeLog12
-rw-r--r--net-misc/networkmanager-openvpn/files/networkmanager-openvpn-0.7.1-glibc2.10.fix.patch119
-rw-r--r--net-misc/networkmanager-openvpn/networkmanager-openvpn-0.7.0.ebuild49
-rw-r--r--net-misc/networkmanager-openvpn/networkmanager-openvpn-0.7.1-r1.ebuild (renamed from net-misc/networkmanager-openvpn/networkmanager-openvpn-0.7.1.ebuild)8
4 files changed, 137 insertions, 51 deletions
diff --git a/net-misc/networkmanager-openvpn/ChangeLog b/net-misc/networkmanager-openvpn/ChangeLog
index f804ec4e8775..788335ea774b 100644
--- a/net-misc/networkmanager-openvpn/ChangeLog
+++ b/net-misc/networkmanager-openvpn/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for net-misc/networkmanager-openvpn
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager-openvpn/ChangeLog,v 1.6 2009/04/22 14:22:08 rbu Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager-openvpn/ChangeLog,v 1.7 2009/08/24 14:11:40 dagger Exp $
+
+*networkmanager-openvpn-0.7.1-r1 (24 Aug 2009)
+
+ 24 Aug 2009; Robert Piasek <dagger@gentoo.org>
+ -networkmanager-openvpn-0.7.0.ebuild,
+ -networkmanager-openvpn-0.7.1.ebuild,
+ +networkmanager-openvpn-0.7.1-r1.ebuild,
+ +files/networkmanager-openvpn-0.7.1-glibc2.10.fix.patch:
+ Fixes bug #282428. Thanks for patrakov@gmail.com for providing link
+ to upstream patch
*networkmanager-openvpn-0.7.1 (22 Apr 2009)
diff --git a/net-misc/networkmanager-openvpn/files/networkmanager-openvpn-0.7.1-glibc2.10.fix.patch b/net-misc/networkmanager-openvpn/files/networkmanager-openvpn-0.7.1-glibc2.10.fix.patch
new file mode 100644
index 000000000000..f630476a1648
--- /dev/null
+++ b/net-misc/networkmanager-openvpn/files/networkmanager-openvpn-0.7.1-glibc2.10.fix.patch
@@ -0,0 +1,119 @@
+From 27192957d887915a23f186a34c3bb85af3faba3a Mon Sep 17 00:00:00 2001
+From: Dan Williams <dcbw@redhat.com>
+Date: Tue, 14 Jul 2009 10:51:33 +0000
+Subject: don't use sscanf
+
+besides the fact that for some reason sscanf wasn't working, it's evil
+and confusing, and we don't even need to use it. Also add the ability
+to set OPENVPN_DEBUG to get more info out of openvpn.
+---
+diff --git a/src/nm-openvpn-service.c b/src/nm-openvpn-service.c
+index 346df20..6cde642 100644
+--- a/src/nm-openvpn-service.c
++++ b/src/nm-openvpn-service.c
+@@ -287,6 +287,35 @@ ovpn_quote_string (const char *unquoted)
+ return quoted;
+ }
+
++/* sscanf is evil, and since we can't use glib regexp stuff since it's still
++ * too new for some distros, do a simple match here.
++ */
++static char *
++get_detail (const char *input, const char *prefix)
++{
++ char *ret = NULL;
++ guint32 i = 0;
++ const char *p, *start;
++
++ g_return_val_if_fail (prefix != NULL, NULL);
++
++ if (!g_str_has_prefix (input, prefix))
++ return NULL;
++
++ /* Grab characters until the next ' */
++ p = start = input + strlen (prefix);
++ while (*p) {
++ if (*p == '\'') {
++ ret = g_malloc0 (i + 1);
++ strncpy (ret, start, i);
++ break;
++ }
++ p++, i++;
++ }
++
++ return ret;
++}
++
+ static gboolean
+ handle_management_socket (NMVPNPlugin *plugin,
+ GIOChannel *source,
+@@ -295,7 +324,7 @@ handle_management_socket (NMVPNPlugin *plugin,
+ {
+ NMOpenvpnPluginIOData *io_data = NM_OPENVPN_PLUGIN_GET_PRIVATE (plugin)->io_data;
+ gboolean again = TRUE;
+- char *str = NULL, *auth, *buf;
++ char *str = NULL, *auth = NULL, *buf;
+ gsize written;
+
+ if (!(condition & G_IO_IN))
+@@ -307,7 +336,8 @@ handle_management_socket (NMVPNPlugin *plugin,
+ if (strlen (str) < 1)
+ goto out;
+
+- if (sscanf (str, ">PASSWORD:Need '%a[^']'", &auth) > 0) {
++ auth = get_detail (str, ">PASSWORD:Need '");
++ if (auth) {
+ if (strcmp (auth, "Auth") == 0) {
+ if (io_data->username != NULL && io_data->password != NULL) {
+ char *quser, *qpass;
+@@ -351,8 +381,11 @@ handle_management_socket (NMVPNPlugin *plugin,
+ *out_failure = NM_VPN_PLUGIN_FAILURE_CONNECT_FAILED;
+ again = FALSE;
+ }
+- free (auth);
+- } else if (sscanf (str, ">PASSWORD:Verification Failed: '%a[^']'", &auth) > 0) {
++ g_free (auth);
++ }
++
++ auth = get_detail (str, ">PASSWORD:Verification Failed: '");
++ if (auth) {
+ if (!strcmp (auth, "Auth"))
+ nm_warning ("Password verification failed");
+ else if (!strcmp (auth, "Private Key"))
+@@ -360,7 +393,7 @@ handle_management_socket (NMVPNPlugin *plugin,
+ else
+ nm_warning ("Unknown verification failed: %s", auth);
+
+- free (auth);
++ g_free (auth);
+
+ if (out_failure)
+ *out_failure = NM_VPN_PLUGIN_FAILURE_LOGIN_FAILED;
+@@ -688,6 +721,7 @@ nm_openvpn_start_openvpn_binary (NMOpenvpnPlugin *plugin,
+ add_openvpn_arg (args, "--auth");
+ add_openvpn_arg (args, auth);
+ }
++ add_openvpn_arg (args, "--auth-nocache");
+
+ /* TA */
+ tmp = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_TA);
+@@ -700,9 +734,14 @@ nm_openvpn_start_openvpn_binary (NMOpenvpnPlugin *plugin,
+ add_openvpn_arg (args, tmp);
+ }
+
+- /* Syslog */
+- add_openvpn_arg (args, "--syslog");
+- add_openvpn_arg (args, "nm-openvpn");
++ if (getenv ("OPENVPN_DEBUG")) {
++ add_openvpn_arg (args, "--verb");
++ add_openvpn_arg (args, "10");
++ } else {
++ /* Syslog */
++ add_openvpn_arg (args, "--syslog");
++ add_openvpn_arg (args, "nm-openvpn");
++ }
+
+ /* Punch script security in the face; this option was added to OpenVPN 2.1-rc9
+ * and defaults to disallowing any scripts, a behavior change from previous
+--
+cgit v0.8.2
diff --git a/net-misc/networkmanager-openvpn/networkmanager-openvpn-0.7.0.ebuild b/net-misc/networkmanager-openvpn/networkmanager-openvpn-0.7.0.ebuild
deleted file mode 100644
index 43601f41de1c..000000000000
--- a/net-misc/networkmanager-openvpn/networkmanager-openvpn-0.7.0.ebuild
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager-openvpn/networkmanager-openvpn-0.7.0.ebuild,v 1.2 2009/04/22 14:22:08 rbu Exp $
-
-inherit eutils versionator
-
-# NetworkManager likes itself with capital letters
-MY_P=${P/networkmanager/NetworkManager}
-MYPV_MINOR=$(get_version_component_range 1-2)
-
-DESCRIPTION="NetworkManager OpenVPN plugin."
-HOMEPAGE="http://www.gnome.org/projects/NetworkManager/"
-SRC_URI="mirror://gnome/sources/NetworkManager-openvpn/0.7/${MY_P}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~arm ~amd64 ~ppc ~x86"
-IUSE="gnome"
-
-RDEPEND="
- =net-misc/networkmanager-${MYPV_MINOR}*
- >=net-misc/openvpn-2.1_rc9
- gnome? (
- >=gnome-base/gconf-2.20
- >=gnome-base/gnome-keyring-2.20
- >=gnome-base/libglade-2
- >=gnome-base/libgnomeui-2.20
- >=x11-libs/gtk+-2.10
- )"
-
-DEPEND="${RDEPEND}
- dev-util/intltool
- dev-util/pkgconfig"
-
-S=${WORKDIR}/${MY_P}
-
-src_compile() {
- ECONF="--disable-more-warnings \
- $(use_with gnome)"
-
- econf ${ECONF}
- emake || die "emake failed"
-}
-
-src_install() {
- emake DESTDIR="${D}" install || die "emake install failed"
-
- dodoc AUTHORS ChangeLog NEWS README || die "dodoc failed"
-}
diff --git a/net-misc/networkmanager-openvpn/networkmanager-openvpn-0.7.1.ebuild b/net-misc/networkmanager-openvpn/networkmanager-openvpn-0.7.1-r1.ebuild
index 7be965128572..309acbead37b 100644
--- a/net-misc/networkmanager-openvpn/networkmanager-openvpn-0.7.1.ebuild
+++ b/net-misc/networkmanager-openvpn/networkmanager-openvpn-0.7.1-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager-openvpn/networkmanager-openvpn-0.7.1.ebuild,v 1.1 2009/04/22 14:22:08 rbu Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager-openvpn/networkmanager-openvpn-0.7.1-r1.ebuild,v 1.1 2009/08/24 14:11:40 dagger Exp $
EAPI=2
inherit eutils versionator
@@ -35,6 +35,12 @@ DEPEND="${RDEPEND}
S=${WORKDIR}/${MY_P}
+src_prepare() {
+
+ # fixes bug #282428
+ epatch "${FILESDIR}"/${P}-glibc2.10.fix.patch
+}
+
src_configure() {
ECONF="--disable-more-warnings \
$(use_with gnome)"