I'm providing a simple patch to fix the bug, I'm not sure it is the best possible, maybe a better way is to exit if the user is not root... what do you think Emilio?
Sorry I'm not familiar with sourceforge's bug tracker... I'm listing the patch below
--- interfaces/curses/ec_curses.c 2012-03-20 14:49:16.556356320 +0100
+++ ../../ettercap.old/src/interfaces/curses/ec_curses.c 2012-03-20 14:50:21.724665194 +0100
@@ -577,8 +577,7 @@
/ if the user has not specified an interface, get the first one /
if (GBL_OPTIONS->iface == NULL) {
SAFE_CALLOC(GBL_OPTIONS->iface, IFACE_LEN, sizeof(char));
- if(pcap_lookupdev(err) != NULL)
- strncpy(GBL_OPTIONS->iface, pcap_lookupdev(err), IFACE_LEN - 1);
+ strncpy(GBL_OPTIONS->iface, pcap_lookupdev(err), IFACE_LEN - 1);
}
Will look into it. We're considering dropping the curses interface completely but have not decided yet.
I'm providing a simple patch to fix the bug, I'm not sure it is the best possible, maybe a better way is to exit if the user is not root... what do you think Emilio?
Sorry I'm not familiar with sourceforge's bug tracker... I'm listing the patch below
--- interfaces/curses/ec_curses.c 2012-03-20 14:49:16.556356320 +0100
+++ ../../ettercap.old/src/interfaces/curses/ec_curses.c 2012-03-20 14:50:21.724665194 +0100
@@ -577,8 +577,7 @@
/ if the user has not specified an interface, get the first one /
if (GBL_OPTIONS->iface == NULL) {
SAFE_CALLOC(GBL_OPTIONS->iface, IFACE_LEN, sizeof(char));
- if(pcap_lookupdev(err) != NULL)
- strncpy(GBL_OPTIONS->iface, pcap_lookupdev(err), IFACE_LEN - 1);
+ strncpy(GBL_OPTIONS->iface, pcap_lookupdev(err), IFACE_LEN - 1);
}
Ideally, it should do so for both curses and gtk.
As far as I can see the gtk interface doesn't crash
I believe I fixed it in commit 805852a76b5a898bbdbe79c391dd8fd2aa97dcfd in
Emilio, what do you think about?
you can apply the patch or checkout the devel branch
http://ettercap.git.sourceforge.net/git/gitweb.cgi?p=ettercap/ettercap;a=blob;f=src/interfaces/curses/ec_curses.c;h=aeb0f16b718d2c32b954dd0f1eeb8c65791ed1fa;hb=805852a76b5a898bbdbe79c391dd8fd2aa97dcfd
BTW Emilio I cannot change the status...