summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2020-05-18 18:40:15 +0200
committerArne Schwabe <arne@rfc2549.org>2020-05-18 18:40:15 +0200
commit9ffa99d5ae76eca272cc46fe160e4d048bbb4d97 (patch)
treeb5733af74d4ac492177de05f91bc1d223feefe72
parent0afb0dcdd4da46b83a836b926c71cf35b410fc46 (diff)
Change code to account for removal of --disable-server in openvpn2
-rw-r--r--main/src/main/cpp/CMakeLists.txt3
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java9
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java5
3 files changed, 14 insertions, 3 deletions
diff --git a/main/src/main/cpp/CMakeLists.txt b/main/src/main/cpp/CMakeLists.txt
index 1003517a..bfd06fba 100644
--- a/main/src/main/cpp/CMakeLists.txt
+++ b/main/src/main/cpp/CMakeLists.txt
@@ -199,6 +199,7 @@ set(openvpn_srcs
src/openvpn/status.c
src/openvpn/tls_crypt.c
src/openvpn/tun.c
+ src/openvpn/vlan.c
src/openvpn/comp-lz4.c
src/openvpn/comp.c
src/openvpn/compstub.c
@@ -221,7 +222,7 @@ target_compile_definitions(openvpn PRIVATE
-DCONFIGURE_GIT_REVISION=\"${OPENVPN2_GIT}\"
-DCONFIGURE_GIT_FLAGS=\"\"
-DTARGET_ABI=\"${ANDROID_ABI}\"
- -DOPENSSL_API_COMPAT=0x10200000L
+ -DOPENSSL_API_COMPAT=0x11000000L
)
if (${OPENVPN2MBED})
diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
index 137840e4..51add1cd 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
@@ -590,6 +590,13 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac
return;
}
String nativeLibraryDirectory = getApplicationInfo().nativeLibraryDir;
+ String tmpDir;
+ try {
+ tmpDir = getApplication().getCacheDir().getCanonicalPath();
+ } catch (IOException e) {
+ e.printStackTrace();
+ tmpDir = "/tmp";
+ }
// Write OpenVPN binary
String[] argv = VPNLaunchHelper.buildOpenvpnArgv(this);
@@ -627,7 +634,7 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac
processThread = (Runnable) mOpenVPN3;
mManagement = mOpenVPN3;
} else {
- processThread = new OpenVPNThread(this, argv, nativeLibraryDirectory);
+ processThread = new OpenVPNThread(this, argv, nativeLibraryDirectory, tmpDir);
mOpenVPNThread = processThread;
}
diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java
index 56eff75f..c43b3ea6 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java
@@ -39,14 +39,16 @@ public class OpenVPNThread implements Runnable {
private String[] mArgv;
private Process mProcess;
private String mNativeDir;
+ private String mTmpDir;
private OpenVPNService mService;
private String mDumpPath;
private boolean mBrokenPie = false;
private boolean mNoProcessExitStatus = false;
- public OpenVPNThread(OpenVPNService service, String[] argv, String nativelibdir) {
+ public OpenVPNThread(OpenVPNService service, String[] argv, String nativelibdir, String tmpdir) {
mArgv = argv;
mNativeDir = nativelibdir;
+ mTmpDir = tmpdir;
mService = service;
}
@@ -130,6 +132,7 @@ public class OpenVPNThread implements Runnable {
String lbpath = genLibraryPath(argv, pb);
pb.environment().put("LD_LIBRARY_PATH", lbpath);
+ pb.environment().put("TMPDIR", mTmpDir);
pb.redirectErrorStream(true);
try {