Skip to content

Commit aa8a45d

Browse files
eighthaveuniqx
authored andcommitted
On Android, get_data_directory() should not use LOCALSTATEDIR
closes https://gitlab.torproject.org/tpo/core/tor/-/issues/40487
1 parent 5968567 commit aa8a45d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/app/config/config.c

+9
Original file line numberDiff line numberDiff line change
@@ -6905,6 +6905,15 @@ get_data_directory(const char *val)
69056905
} else {
69066906
return tor_strdup(get_windows_conf_root());
69076907
}
6908+
#elif defined(__ANDROID__)
6909+
/* Android apps can only use paths that are configured at runtime.
6910+
* /data/local/tmp is guaranteed to exist, but is only usable by the
6911+
* 'shell' and 'root' users, so this fallback is for debugging only. */
6912+
if (val) {
6913+
return tor_strdup(val);
6914+
} else {
6915+
return tor_strdup("/data/local/tmp");
6916+
}
69086917
#else /* !defined(_WIN32) */
69096918
const char *d = val;
69106919
if (!d)

0 commit comments

Comments
 (0)