diff options
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/config/config.c | 18 | ||||
-rw-r--r-- | src/app/config/or_options_st.h | 2 | ||||
-rw-r--r-- | src/app/main/main.c | 5 | ||||
-rw-r--r-- | src/app/main/shutdown.c | 1 |
4 files changed, 26 insertions, 0 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c index a10329c552..102d1bbc04 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -483,6 +483,13 @@ static const config_var_t option_vars_[] = { #ifdef _WIN32 V(GeoIPFile, FILENAME, "<default>"), V(GeoIPv6File, FILENAME, "<default>"), +#elif defined(__ANDROID__) + /* Android apps use paths that are configured at runtime. + * /data/local/tmp is guaranteed to exist, but will only be + * usable by the 'shell' and 'root' users, so this fallback is + * for debugging only. */ + V(GeoIPFile, FILENAME, "/data/local/tmp/geoip"), + V(GeoIPv6File, FILENAME, "/data/local/tmp/geoip6"), #else V(GeoIPFile, FILENAME, SHARE_DATADIR PATH_SEPARATOR "tor" PATH_SEPARATOR "geoip"), @@ -637,6 +644,7 @@ static const config_var_t option_vars_[] = { V(RephistTrackTime, INTERVAL, "24 hours"), V_IMMUTABLE(RunAsDaemon, BOOL, "0"), V(ReducedExitPolicy, BOOL, "0"), + V(ReevaluateExitPolicy, BOOL, "0"), OBSOLETE("RunTesting"), // currently unused V_IMMUTABLE(Sandbox, BOOL, "0"), V(SafeLogging, STRING, "1"), @@ -996,6 +1004,7 @@ set_options(or_options_t *new_val, char **msg) config_line_t *changes = config_get_changes(get_options_mgr(), old_options, new_val); control_event_conf_changed(changes); + connection_reapply_exit_policy(changes); config_free_lines(changes); } @@ -6898,6 +6907,15 @@ get_data_directory(const char *val) } else { return tor_strdup(get_windows_conf_root()); } +#elif defined(__ANDROID__) + /* Android apps can only use paths that are configured at runtime. + * /data/local/tmp is guaranteed to exist, but is only usable by the + * 'shell' and 'root' users, so this fallback is for debugging only. */ + if (val) { + return tor_strdup(val); + } else { + return tor_strdup("/data/local/tmp"); + } #else /* !defined(_WIN32) */ const char *d = val; if (!d) diff --git a/src/app/config/or_options_st.h b/src/app/config/or_options_st.h index 36b00662b5..624dc61bc5 100644 --- a/src/app/config/or_options_st.h +++ b/src/app/config/or_options_st.h @@ -141,6 +141,8 @@ struct or_options_t { * Includes OutboundBindAddresses and * configured ports. */ int ReducedExitPolicy; /**<Should we use the Reduced Exit Policy? */ + int ReevaluateExitPolicy; /**<Should we re-evaluate Exit Policy on existing + * connections when it changes? */ struct config_line_t *SocksPolicy; /**< Lists of socks policy components */ struct config_line_t *DirPolicy; /**< Lists of dir policy components */ /** Local address to bind outbound sockets */ diff --git a/src/app/main/main.c b/src/app/main/main.c index a50a0aad6f..6d05bd1f5e 100644 --- a/src/app/main/main.c +++ b/src/app/main/main.c @@ -926,6 +926,11 @@ sandbox_init_filter(void) OPEN_DATADIR("approved-routers"); OPEN_DATADIR_SUFFIX("my-consensus-microdesc", ".tmp"); OPEN_DATADIR_SUFFIX("my-consensus-ns", ".tmp"); + if (options->V3BandwidthsFile) { + log_notice(LD_GENERAL, "Adding V3BandwidthsFile %s to sandboxing set.", + options->V3BandwidthsFile); + OPEN(options->V3BandwidthsFile); + } } if (options->ServerDNSResolvConfFile) diff --git a/src/app/main/shutdown.c b/src/app/main/shutdown.c index 325cb27134..ddbc2ea584 100644 --- a/src/app/main/shutdown.c +++ b/src/app/main/shutdown.c @@ -122,6 +122,7 @@ tor_free_all(int postfork) dirserv_free_all(); rep_hist_free_all(); bwhist_free_all(); + conflux_notify_shutdown(); circuit_free_all(); conflux_pool_free_all(); circpad_machines_free(); |