summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Farina <zerochaos@gentoo.org>2012-08-19 02:56:27 +0000
committerRick Farina <zerochaos@gentoo.org>2012-08-19 02:56:27 +0000
commit20d82a0f85af05078737283384de8d836957535f (patch)
tree1f6b8ee1b484f2dbdf9adb7babc973caed08ff22 /net-analyzer/ettercap
parentUnrestrict python 3.2 and make pycurl an optional dependency. (diff)
downloadgentoo-2-20d82a0f85af05078737283384de8d836957535f.tar.gz
gentoo-2-20d82a0f85af05078737283384de8d836957535f.tar.bz2
gentoo-2-20d82a0f85af05078737283384de8d836957535f.zip
bugfix from b.g.o #346423
(Portage version: 2.1.11.10/cvs/Linux x86_64)
Diffstat (limited to 'net-analyzer/ettercap')
-rw-r--r--net-analyzer/ettercap/ChangeLog8
-rw-r--r--net-analyzer/ettercap/ettercap-0.7.4.1.ebuild6
-rw-r--r--net-analyzer/ettercap/files/ettercap-0.7.4-use-g-idle.patch321
-rw-r--r--net-analyzer/ettercap/metadata.xml7
4 files changed, 337 insertions, 5 deletions
diff --git a/net-analyzer/ettercap/ChangeLog b/net-analyzer/ettercap/ChangeLog
index fb408a24e80c..56d9d8de7f42 100644
--- a/net-analyzer/ettercap/ChangeLog
+++ b/net-analyzer/ettercap/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for net-analyzer/ettercap
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/ettercap/ChangeLog,v 1.89 2012/05/21 23:24:30 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/ettercap/ChangeLog,v 1.90 2012/08/19 02:56:26 zerochaos Exp $
+
+ 19 Aug 2012; Rick Farina <zerochaos@gentoo.org>
+ +files/ettercap-0.7.4-use-g-idle.patch, ettercap-0.7.4.1.ebuild, metadata.xml:
+ bugfix from b.g.o #346423
21 May 2012; Mike Frysinger <vapier@gentoo.org> ettercap-0.7.3-r4.ebuild:
Inherit eutils for epatch.
@@ -323,5 +327,3 @@
Added new version for ettercap and removed all older versions. The new
version 0.6.4 fix a remote root compromise in version 0.6.3 and earlier.
-
-
diff --git a/net-analyzer/ettercap/ettercap-0.7.4.1.ebuild b/net-analyzer/ettercap/ettercap-0.7.4.1.ebuild
index 17874c1939ee..f0caea63db6e 100644
--- a/net-analyzer/ettercap/ettercap-0.7.4.1.ebuild
+++ b/net-analyzer/ettercap/ettercap-0.7.4.1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/ettercap/ettercap-0.7.4.1.ebuild,v 1.2 2012/05/04 06:08:11 jdhore Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/ettercap/ettercap-0.7.4.1.ebuild,v 1.3 2012/08/19 02:56:26 zerochaos Exp $
EAPI=4
@@ -38,8 +38,12 @@ src_prepare() {
epatch "${FILESDIR}"/${PN}-0.7.3-as-needed.patch
epatch "${FILESDIR}"/${PN}-0.7.4-autotools.patch
epatch "${FILESDIR}"/${PN}-0.7.4-flags.patch
+ epatch "${FILESDIR}"/${PN}-0.7.4-use-g-idle.patch
eautoreconf
+
+ #ettercap defaults to using mozilla so let's try to use xdg-open and pray it works
+ sed -i 's#mozilla -remote openurl(http://%host%url)#xdg-open 'http://%host%url'#' "${S}"/share/etter.conf
}
src_configure() {
diff --git a/net-analyzer/ettercap/files/ettercap-0.7.4-use-g-idle.patch b/net-analyzer/ettercap/files/ettercap-0.7.4-use-g-idle.patch
new file mode 100644
index 000000000000..ef972cc7ad3f
--- /dev/null
+++ b/net-analyzer/ettercap/files/ettercap-0.7.4-use-g-idle.patch
@@ -0,0 +1,321 @@
+=== modified file 'src/interfaces/gtk/ec_gtk.c'
+--- src/interfaces/gtk/ec_gtk.c 2005-06-06 14:07:06 +0000
++++ src/interfaces/gtk/ec_gtk.c 2010-08-08 02:56:21 +0000
+@@ -20,6 +20,8 @@
+ $Id: ettercap-0.7.4-use-g-idle.patch,v 1.1 2012/08/19 02:56:27 zerochaos Exp $
+ */
+
++#include <string.h>
++
+ #include <ec.h>
+
+ #include <ec_gtk.h>
+@@ -45,7 +47,10 @@
+ static GtkTextBuffer *msgbuffer = NULL;
+ static GtkTextMark *endmark = NULL;
+ static GtkAccelGroup *accel_group = NULL;
++
+ static gboolean progress_cancelled = FALSE;
++static GtkWidget *progress_dialog = NULL;
++static GtkWidget *progress_bar = NULL;
+
+ /* proto */
+
+@@ -64,7 +69,7 @@
+ static void gtkui_error(const char *msg);
+ static void gtkui_fatal_error(const char *msg);
+ static gboolean gtkui_flush_msg(gpointer data);
+-static int gtkui_progress(char *title, int value, int max);
++static void gtkui_progress(char *title, int value, int max);
+
+ static void gtkui_setup(void);
+
+@@ -102,6 +107,134 @@
+ static void gtkui_page_defocus_tabs(void);
+ #endif
+
++/* wrapper functions which inject the real function call into the main
++ idle loop, ensuring only the main thread performs GTK operations
++*/
++
++static gboolean gtkui_cleanup_shim(gpointer data) {
++ gtkui_cleanup();
++ return FALSE;
++}
++
++static void gtkui_cleanup_wrap(void) {
++ g_idle_add(gtkui_cleanup_shim, NULL);
++}
++
++static gboolean gtkui_msg_shim(gpointer data) {
++ gtkui_msg(data);
++ free(data);
++ return FALSE;
++}
++
++static void gtkui_msg_wrap(const char *msg) {
++
++ char *copy = strdup(msg);
++ if (msg) {
++ g_idle_add(gtkui_msg_shim, copy);
++ } else {
++ FATAL_ERROR("out of memory");
++ }
++}
++
++static gboolean gtkui_error_shim(gpointer data) {
++ gtkui_error(data);
++ free(data);
++ return FALSE;
++}
++
++static void gtkui_error_wrap(const char *msg) {
++
++ char *copy = strdup(msg);
++ if (msg) {
++ g_idle_add(gtkui_error_shim, copy);
++ } else {
++ FATAL_ERROR("out of memory");
++ }
++}
++
++static gboolean gtkui_fatal_error_shim(gpointer data) {
++ gtkui_fatal_error(data);
++ free(data);
++ return FALSE;
++}
++
++static void gtkui_fatal_error_wrap(const char *msg) {
++
++ char *copy = strdup(msg);
++ if (msg) {
++ g_idle_add(gtkui_fatal_error_shim, copy);
++ } else {
++ FATAL_ERROR("out of memory");
++ }
++}
++
++struct gtkui_input_data {
++ const char *title;
++ char *input;
++ size_t n;
++ void (*callback)(void);
++};
++
++static gboolean gtkui_input_shim(gpointer data) {
++
++ struct gtkui_input_data *gid = data;
++ gtkui_input(gid->title, gid->input, gid->n, gid->callback);
++ free(gid);
++ return FALSE;
++}
++
++static void gtkui_input_wrap(const char *title, char *input, size_t n, void (*callback)(void)) {
++
++ struct gtkui_input_data *gid = malloc(sizeof *gid);
++ if (gid) {
++ gid->title = title;
++ gid->input = input;
++ gid->n = n;
++ gid->callback = callback;
++ g_idle_add(gtkui_input_shim, gid);
++ } else {
++ FATAL_ERROR("out of memory");
++ }
++}
++
++struct gtkui_progress_data {
++ char *title;
++ int value;
++ int max;
++};
++
++static gboolean gtkui_progress_shim(gpointer data) {
++
++ struct gtkui_progress_data *gpd = data;
++ gtkui_progress(gpd->title, gpd->value, gpd->max);
++ free(gpd);
++ return FALSE;
++}
++
++static int gtkui_progress_wrap(char *title, int value, int max) {
++
++ struct gtkui_progress_data *gpd;
++
++ if (progress_cancelled == TRUE) {
++ progress_cancelled = FALSE;
++ return UI_PROGRESS_INTERRUPTED;
++ }
++
++ gpd = malloc(sizeof *gpd);
++ if (gpd) {
++ gpd->title = title;
++ gpd->value = value;
++ gpd->max = max;
++ g_idle_add(gtkui_progress_shim, gpd);
++ } else {
++ FATAL_ERROR("out of memory");
++ }
++
++ return value == max
++ ? UI_PROGRESS_FINISHED
++ : UI_PROGRESS_UPDATED;
++}
++
+ /***#****************************************/
+
+ void set_gtk_interface(void)
+@@ -114,12 +247,12 @@
+ /* register the functions */
+ ops.init = &gtkui_init;
+ ops.start = &gtkui_start;
+- ops.cleanup = &gtkui_cleanup;
+- ops.msg = &gtkui_msg;
+- ops.error = &gtkui_error;
+- ops.fatal_error = &gtkui_fatal_error;
+- ops.input = &gtkui_input;
+- ops.progress = &gtkui_progress;
++ ops.cleanup = &gtkui_cleanup_wrap;
++ ops.msg = &gtkui_msg_wrap;
++ ops.error = &gtkui_error_wrap;
++ ops.fatal_error = &gtkui_fatal_error_wrap;
++ ops.input = &gtkui_input_wrap;
++ ops.progress = &gtkui_progress_wrap;
+ ops.type = UI_GTK;
+
+ ui_register(&ops);
+@@ -134,7 +267,6 @@
+ DEBUG_MSG("gtk_init");
+
+ g_thread_init(NULL);
+- gdk_threads_init();
+
+ if(!gtk_init_check(0, NULL)) {
+ FATAL_ERROR("GTK+ failed to initialize. Is X running?");
+@@ -148,9 +280,7 @@
+ /* gui init loop, calling gtk_main_quit will cause
+ * this to exit so we can proceed to the main loop
+ * later. */
+- gdk_threads_enter();
+ gtk_main();
+- gdk_threads_leave();
+
+ /* remove the keyboard shortcuts for the setup menus */
+ gtk_window_remove_accel_group(GTK_WINDOW (window), accel_group);
+@@ -311,29 +441,10 @@
+ /*
+ * show or update the progress bar
+ */
+-static int gtkui_progress(char *title, int value, int max)
++static void gtkui_progress(char *title, int value, int max)
+ {
+- static GtkWidget *progress_dialog = NULL;
+- static GtkWidget *progress_bar = NULL;
+ static GtkWidget *hbox, *button;
+
+-#ifndef OS_MINGW
+- /* FIXME: try to understand why it does not work under mingw.
+- * (look even in ec_scan.c
+- */
+- gdk_threads_enter();
+-#endif
+-
+- if (progress_cancelled == TRUE) {
+- progress_dialog = NULL;
+- progress_bar = NULL;
+- progress_cancelled = FALSE;
+-#ifndef OS_MINGW
+- gdk_threads_leave();
+-#endif
+- return UI_PROGRESS_INTERRUPTED;
+- }
+-
+ /* the first time, create the object */
+ if (progress_bar == NULL) {
+ progress_dialog = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+@@ -363,14 +474,10 @@
+ gtk_progress_bar_set_text(GTK_PROGRESS_BAR (progress_bar), title);
+ gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR (progress_bar), (gdouble)((gdouble)value / (gdouble)max));
+
+-#ifndef OS_MINGW
+- gdk_threads_leave();
+-#else
+ /* a nasty little loop that lets gtk update the progress bar immediately */
+ while (gtk_events_pending ())
+ gtk_main_iteration ();
+-#endif
+-
++
+ /*
+ * when 100%, destroy it
+ */
+@@ -378,21 +485,18 @@
+ gtk_widget_destroy(progress_dialog);
+ progress_dialog = NULL;
+ progress_bar = NULL;
+-#ifndef OS_MINGW
+- gdk_threads_leave();
+-#endif
+- return UI_PROGRESS_FINISHED;
+ }
+-
+- return UI_PROGRESS_UPDATED;
+ }
+
+ static gboolean gtkui_progress_cancel(GtkWidget *window, gpointer data) {
+ progress_cancelled = TRUE;
+
+ /* the progress dialog must be manually destroyed if the cancel button is used */
+- if(data != NULL && GTK_IS_WIDGET(data))
+- gtk_widget_destroy(data);
++ if(data != NULL && GTK_IS_WIDGET(data)) {
++ gtk_widget_destroy(data);
++ progress_dialog = NULL;
++ progress_bar = NULL;
++ }
+
+ return(FALSE);
+ }
+@@ -437,9 +541,7 @@
+ gtkui_sniff_live();
+
+ /* the main gui loop, once this exits the gui will be destroyed */
+- gdk_threads_enter();
+ gtk_main();
+- gdk_threads_leave();
+
+ gtk_timeout_remove(idle_flush);
+ }
+
+=== modified file 'src/interfaces/gtk/ec_gtk_view_connections.c'
+--- src/interfaces/gtk/ec_gtk_view_connections.c 2005-06-06 14:07:06 +0000
++++ src/interfaces/gtk/ec_gtk_view_connections.c 2010-08-08 02:53:30 +0000
+@@ -900,12 +900,10 @@
+ ret = GBL_FORMAT(po->DATA.disp_data, po->DATA.disp_len, dispbuf);
+ dispbuf[ret] = 0;
+
+- gdk_threads_enter();
+ if (!ip_addr_cmp(&po->L3.src, &curr_conn->L3_addr1))
+ gtkui_data_print(1, dispbuf, 0);
+ else
+ gtkui_data_print(2, dispbuf, 0);
+- gdk_threads_leave();
+ }
+
+ /*
+@@ -1066,13 +1064,11 @@
+ /* format the data */
+ ret = GBL_FORMAT(po->DATA.disp_data, po->DATA.disp_len, dispbuf);
+ dispbuf[ret] = 0;
+-
+- gdk_threads_enter();
++
+ if (!ip_addr_cmp(&po->L3.src, &curr_conn->L3_addr1))
+ gtkui_data_print(3, dispbuf, 1);
+ else
+ gtkui_data_print(3, dispbuf, 2);
+- gdk_threads_leave();
+ }
+
+ /*
+
diff --git a/net-analyzer/ettercap/metadata.xml b/net-analyzer/ettercap/metadata.xml
index 03aa50bab7e3..277aff85ef0e 100644
--- a/net-analyzer/ettercap/metadata.xml
+++ b/net-analyzer/ettercap/metadata.xml
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
-<herd>netmon</herd>
+ <herd>netmon</herd>
+ <maintainer>
+ <email>zerochaos@gentoo.org</email>
+ <name>Rick Farina</name>
+ <description>maintainer</description>
+ </maintainer>
</pkgmetadata>