Skip to content

Commit

Permalink
Make the update feature optional and disabled by default
Browse files Browse the repository at this point in the history
  • Loading branch information
LocutusOfBorg committed Jul 21, 2020
1 parent ed7386c commit cc7d03f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ env:
# Debug build
- BUILD_ARGS="-DCMAKE_BUILD_TYPE=Debug"
# Everything that's optional
- BUILD_ARGS="-DENABLE_PDF_DOCS=On -DENABLE_IPV6=On -DENABLE_LUA=On"
- BUILD_ARGS="-DENABLE_PDF_DOCS=On -DENABLE_IPV6=On -DENABLE_UPDATE=On -DENABLE_LUA=On"
# Everything that's optional, in Debug-mode
- BUILD_ARGS="-DENABLE_PDF_DOCS=On -DENABLE_IPV6=On -DENABLE_LUA=On -DCMAKE_BUILD_TYPE=Debug"
- BUILD_ARGS="-DENABLE_PDF_DOCS=On -DENABLE_IPV6=On -DENABLE_UPDATE=On -DENABLE_LUA=On -DCMAKE_BUILD_TYPE=Debug"
# Everything that's optional, GTK2
- BUILD_ARGS="-DENABLE_PDF_DOCS=On -DENABLE_IPV6=On -DENABLE_LUA=On -DGTK_BUILD_TYPE=GTK2"
- BUILD_ARGS="-DENABLE_PDF_DOCS=On -DENABLE_IPV6=On -DENABLE_UPDATE=On -DENABLE_LUA=On -DGTK_BUILD_TYPE=GTK2"
# Everything that's optional, GTK2 in Debug-mode
- BUILD_ARGS="-DENABLE_PDF_DOCS=On -DENABLE_IPV6=On -DENABLE_LUA=On -DGTK_BUILD_TYPE=GTK2 -DCMAKE_BUILD_TYPE=Debug"
- BUILD_ARGS="-DENABLE_PDF_DOCS=On -DENABLE_IPV6=On -DENABLE_UPDATE=On -DENABLE_LUA=On -DGTK_BUILD_TYPE=GTK2 -DCMAKE_BUILD_TYPE=Debug"
# IPV6 + system libnet
- BUILD_ARGS="-DENABLE_IPV6=On -DBUNDLED_LIBNET=Off"
# IPV6 + bundled libnet
Expand Down Expand Up @@ -107,16 +107,16 @@ matrix:
env: BUILD_ARGS="-DCMAKE_BUILD_TYPE=Debug"
- os: osx
compiler: gcc
env: BUILD_ARGS="-DENABLE_PDF_DOCS=On -DENABLE_IPV6=On -DENABLE_LUA=On"
env: BUILD_ARGS="-DENABLE_PDF_DOCS=On -DENABLE_IPV6=On -DENABLE_UPDATE=On -DENABLE_LUA=On"
- os: osx
compiler: gcc
env: BUILD_ARGS="-DENABLE_PDF_DOCS=On -DENABLE_IPV6=On -DENABLE_LUA=On -DCMAKE_BUILD_TYPE=Debug"
env: BUILD_ARGS="-DENABLE_PDF_DOCS=On -DENABLE_IPV6=On -DENABLE_UPDATE=On -DENABLE_LUA=On -DCMAKE_BUILD_TYPE=Debug"
- os: osx
compiler: gcc
env: BUILD_ARGS="-DENABLE_PDF_DOCS=On -DENABLE_IPV6=On -DENABLE_LUA=On -DGTK_BUILD_TYPE=GTK2"
env: BUILD_ARGS="-DENABLE_PDF_DOCS=On -DENABLE_IPV6=On -DENABLE_UPDATE=On -DENABLE_LUA=On -DGTK_BUILD_TYPE=GTK2"
- os: osx
compiler: gcc
env: BUILD_ARGS="-DENABLE_PDF_DOCS=On -DENABLE_IPV6=On -DENABLE_LUA=On -DGTK_BUILD_TYPE=GTK2 -DCMAKE_BUILD_TYPE=Debug"
env: BUILD_ARGS="-DENABLE_PDF_DOCS=On -DENABLE_IPV6=On -DENABLE_UPDATE=On -DENABLE_LUA=On -DGTK_BUILD_TYPE=GTK2 -DCMAKE_BUILD_TYPE=Debug"
- os: osx
env: BUILD_ARGS="-DENABLE_IPV6=On -DBUNDLED_LIBNET=Off"
- os: osx
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME}
option(ENABLE_CURSES "Enable curses interface" ON)
option(ENABLE_GTK "Enable GTK interface" ON)
option(ENABLE_PLUGINS "Enable plugins support" ON)
option(ENABLE_UPDATE "Enable Self-Update support" OFF)
option(ENABLE_IPV6 "Enable IPv6 support" OFF)
option(ENABLE_LUA "Enable LUA support (EXPERIMENTAL)" OFF)
option(ENABLE_PDF_DOCS "Enable PDF document generation" OFF)
Expand Down Expand Up @@ -187,6 +188,10 @@ add_subdirectory(utils)
add_subdirectory(share)
add_subdirectory(man)

if(ENABLE_UPDATE)
set(WITH_UPDATE TRUE)
endif()

if(ENABLE_IPV6)
set(WITH_IPV6 TRUE)
endif()
Expand Down
1 change: 1 addition & 0 deletions include/config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#cmakedefine HAVE_UTF8
#cmakedefine HAVE_PLUGINS
#cmakedefine WITH_IPV6
#cmakedefine WITH_UPDATE
#cmakedefine HAVE_GEOIP
#cmakedefine HAVE_EC_LUA

Expand Down
4 changes: 3 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ set(EC_SRC
ec_strings.c
ec_threads.c
ec_ui.c
ec_update.c
ec_utils.c

dissectors/ec_bgp.c
Expand Down Expand Up @@ -126,6 +125,9 @@ set(EC_SRC
protocols/ec_wifi_radiotap.c
)

if(ENABLE_UPDATE)
set(EC_SRC ${EC_SRC} ec_update.c)
endif()

if(HAVE_GEOIP)
set(EC_SRC ${EC_SRC} ec_geoip.c)
Expand Down
6 changes: 6 additions & 0 deletions src/ec_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ void ec_usage(void)
fprintf(stdout, " -a, --config <config> use the alternative config file <config>\n");

fprintf(stdout, "\nStandard options:\n");
#ifdef WITH_UPDATE
fprintf(stdout, " -U, --update updates the databases from ettercap website\n");
#endif
fprintf(stdout, " -v, --version prints the version and exit\n");
fprintf(stdout, " -h, --help this help screen\n");

Expand All @@ -143,7 +145,9 @@ void parse_options(int argc, char **argv)
int c;

static struct option long_options[] = {
#ifdef WITH_UPDATE
{ "update", no_argument, NULL, 'U' },
#endif
{ "version", no_argument, NULL, 'v' },
{ "help", no_argument, NULL, 'h' },

Expand Down Expand Up @@ -403,12 +407,14 @@ void parse_options(int argc, char **argv)
set_conf_file(optarg);
break;

#ifdef WITH_UPDATE
case 'U':
/* load the conf for the connect timeout value */
libettercap_load_conf();
global_update();
/* NOT REACHED */
break;
#endif

case 'h':
ec_usage();
Expand Down

0 comments on commit cc7d03f

Please sign in to comment.