|
| 1 | +/data/local/tmp is an ADBism that only works in ADB; the folder |
| 2 | +is inaccessible to the permissions of normal apps like Termux, |
| 3 | +so @TERMUX_PREFIX@/tmp should be used instead in Termux. |
| 4 | + |
| 5 | +--- a/src/app/config/config.c |
| 6 | ++++ b/src/app/config/config.c |
| 7 | +@@ -491,8 +491,8 @@ static const config_var_t option_vars_[] = { |
| 8 | + * /data/local/tmp is guaranteed to exist, but will only be |
| 9 | + * usable by the 'shell' and 'root' users, so this fallback is |
| 10 | + * for debugging only. */ |
| 11 | +- V(GeoIPFile, FILENAME, "/data/local/tmp/geoip"), |
| 12 | +- V(GeoIPv6File, FILENAME, "/data/local/tmp/geoip6"), |
| 13 | ++ V(GeoIPFile, FILENAME, "@TERMUX_PREFIX@/tmp/geoip"), |
| 14 | ++ V(GeoIPv6File, FILENAME, "@TERMUX_PREFIX@/tmp/geoip6"), |
| 15 | + #else |
| 16 | + V(GeoIPFile, FILENAME, |
| 17 | + SHARE_DATADIR PATH_SEPARATOR "tor" PATH_SEPARATOR "geoip"), |
| 18 | +@@ -6927,7 +6927,7 @@ get_data_directory(const char *val) |
| 19 | + if (val) { |
| 20 | + return tor_strdup(val); |
| 21 | + } else { |
| 22 | +- return tor_strdup("/data/local/tmp"); |
| 23 | ++ return tor_strdup("@TERMUX_PREFIX@/tmp"); |
| 24 | + } |
| 25 | + #else /* !defined(_WIN32) */ |
| 26 | + const char *d = val; |
| 27 | +--- a/src/test/testing_common.c |
| 28 | ++++ b/src/test/testing_common.c |
| 29 | +@@ -93,7 +93,7 @@ setup_directory(void) |
| 30 | + #elif defined(__ANDROID__) |
| 31 | + /* tor might not like the default perms, so create a subdir */ |
| 32 | + tor_snprintf(temp_dir, sizeof(temp_dir), |
| 33 | +- "/data/local/tmp/tor_%d_%d_%s", |
| 34 | ++ "@TERMUX_PREFIX@/tmp/tor_%d_%d_%s", |
| 35 | + (int) getuid(), (int) getpid(), rnd32); |
| 36 | + r = mkdir(temp_dir, 0700); |
| 37 | + if (r) { |
0 commit comments