[go: up one dir, main page]

Menu

#57 Segfaults if not run as root.

open
5
2012-10-15
2012-03-12
Gwyn Ciesla
No

See Fedora Bug:https://bugzilla.redhat.com/show_bug.cgi?id=783675

Would it be possible to have ettercap check it's privileges, and exit gracefully if not root or equivalent, rather than segfaulting? Thank you!

Discussion

  • Emilio A. Escobar

    Will look into it. We're considering dropping the curses interface completely but have not decided yet.

     
  • Gianfranco Costamagna

    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);
    }

    SAFE_CALLOC(GBL_OPTIONS->iface_bridge, IFACE_LEN, sizeof(char));
    
     
  • Gwyn Ciesla

    Gwyn Ciesla - 2012-03-20

    Ideally, it should do so for both curses and gtk.

     
  • Gianfranco Costamagna

    As far as I can see the gtk interface doesn't crash

     
  • Gianfranco Costamagna

    BTW Emilio I cannot change the status...

     

Log in to post a comment.