diff options
author | Hans-Christoph Steiner <hans@eds.org> | 2021-10-15 09:49:57 +0200 |
---|---|---|
committer | Hans-Christoph Steiner <hans@eds.org> | 2021-10-20 14:26:25 +0200 |
commit | 68dae7776caaf910a171f8b18c9480ed762ec73e (patch) | |
tree | 19ad56c323738204fa2427237e2120cf7af642f0 /src/app/config/config.c | |
parent | d455f9e18a9cef290b9976974065c83f13e16832 (diff) | |
download | tor-68dae7776caaf910a171f8b18c9480ed762ec73e.tar.gz tor-68dae7776caaf910a171f8b18c9480ed762ec73e.zip |
do not use SHARE_DATADIR on Android
There is no absolute install path that an app can expect data files on
Android. Everything is expected to be a path inside of the app, and those
paths depend on the Application ID of the app. /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.
This fixes a reproducible issue where the tor-android build harness ended
up including build paths for SHARE_DATADIR.
https://gitlab.torproject.org/tpo/core/tor/-/merge_requests/460
Diffstat (limited to 'src/app/config/config.c')
-rw-r--r-- | src/app/config/config.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c index 15b4585954..aca172cbe7 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -473,6 +473,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"), |