diff options
| author | Odd Stranne <odd@mullvad.net> | 2018-01-19 10:29:09 +0000 |
|---|---|---|
| committer | Odd Stranne <odd@mullvad.net> | 2018-01-19 11:59:20 +0000 |
| commit | 64b0a9edad9afbef50d0f11e4281f9ff516f104c (patch) | |
| tree | af6a72fb619f6eac4095c5f2fa5a7af9ff90b59b | |
| parent | 1e9ea182530217becbf99c645d3929c6fe9c55db (diff) | |
| download | mullvadvpn-64b0a9edad9afbef50d0f11e4281f9ff516f104c.tar.xz mullvadvpn-64b0a9edad9afbef50d0f11e4281f9ff516f104c.zip | |
Fix names of OpenVPN binary and OpenVPN plugin
| -rw-r--r-- | talpid-core/src/tunnel/mod.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/talpid-core/src/tunnel/mod.rs b/talpid-core/src/tunnel/mod.rs index f5c3618352..40ae2306a8 100644 --- a/talpid-core/src/tunnel/mod.rs +++ b/talpid-core/src/tunnel/mod.rs @@ -177,7 +177,7 @@ impl TunnelMonitor { } fn get_openvpn_bin(resource_dir: &Path) -> OsString { - let bin = OsStr::new("openvpn"); + let bin = if cfg!(windows) { OsStr::new("openvpn.exe") } else { OsStr::new("openvpn") }; let bundled_path = resource_dir.join("openvpn-binaries").join(bin); if bundled_path.exists() { bundled_path.into_os_string() @@ -188,8 +188,8 @@ impl TunnelMonitor { } fn get_plugin_path(resource_dir: &Path) -> Result<PathBuf> { - let lib_ext = Self::get_library_extension().chain_err(|| ErrorKind::PluginNotFound)?; - let path = resource_dir.join(format!("libtalpid_openvpn_plugin.{}", lib_ext)); + let library = Self::get_library_name().chain_err(|| ErrorKind::PluginNotFound)?; + let path = resource_dir.join(library); if path.exists() { debug!("Using OpenVPN plugin at {}", path.to_string_lossy()); @@ -199,13 +199,13 @@ impl TunnelMonitor { } } - fn get_library_extension() -> Result<&'static str> { + fn get_library_name() -> Result<&'static str> { if cfg!(target_os = "macos") { - Ok("dylib") + Ok("libtalpid_openvpn_plugin.dylib") } else if cfg!(unix) { - Ok("so") + Ok("libtalpid_openvpn_plugin.so") } else if cfg!(windows) { - Ok("dll") + Ok("talpid_openvpn_plugin.dll") } else { bail!(ErrorKind::UnsupportedPlatform); } |
