diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-10-28 11:34:30 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-10-28 11:34:30 -0400 |
commit | 3f442987f194d96a842fd15808e5d40f784cfca4 (patch) | |
tree | 9f3c51a663a41df1fe80a399a2270250e62c82e0 /src/app/main/main.c | |
parent | 2edda444da8d66cbbe86af3c97352ab9b89d651d (diff) | |
download | tor-3f442987f194d96a842fd15808e5d40f784cfca4.tar.gz tor-3f442987f194d96a842fd15808e5d40f784cfca4.zip |
Log a warning if Tor was built with any "risky" compile-time options
These options are meant for testing builds only, and are likely to
cause trouble if used in a production environment.
Closes #18888.
Diffstat (limited to 'src/app/main/main.c')
-rw-r--r-- | src/app/main/main.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/app/main/main.c b/src/app/main/main.c index ff530c0ad0..589d365add 100644 --- a/src/app/main/main.c +++ b/src/app/main/main.c @@ -16,6 +16,7 @@ #include "app/config/quiet_level.h" #include "app/main/main.h" #include "app/main/ntmain.h" +#include "app/main/risky_options.h" #include "app/main/shutdown.h" #include "app/main/subsysmgr.h" #include "core/mainloop/connection.h" @@ -539,6 +540,7 @@ tor_init(int argc, char *argv[]) { char progname[256]; quiet_level_t quiet = QUIET_NONE; + bool running_tor = false; time_of_process_start = time(NULL); tor_init_connection_lists(); @@ -562,8 +564,10 @@ tor_init(int argc, char *argv[]) whether we log anything at all to stdout. */ parsed_cmdline_t *cmdline; cmdline = config_parse_commandline(argc, argv, 1); - if (cmdline) + if (cmdline) { quiet = cmdline->quiet_level; + running_tor = (cmdline->command == CMD_RUN_TOR); + } parsed_cmdline_free(cmdline); } @@ -599,6 +603,12 @@ tor_init(int argc, char *argv[]) log_notice(LD_GENERAL, "This version is not a stable Tor release. " "Expect more bugs than usual."); + if (strlen(risky_option_list) && running_tor) { + log_warn(LD_GENERAL, "This build of Tor has been compiled with one " + "or more options that might make it less reliable or secure! " + "They are:%s", risky_option_list); + } + tor_compress_log_init_warnings(); } |