mirror of
https://github.com/bitwarden/browser
synced 2026-02-26 01:23:24 +00:00
Always use app group for IPC connection
This commit is contained in:
@@ -56,19 +56,19 @@ pub fn path(name: &str) -> std::path::PathBuf {
|
||||
.position(|c| c.as_os_str() == "Containers");
|
||||
|
||||
// If the app is sanboxed, we need to use the App Group directory
|
||||
if let Some(position) = containers_position {
|
||||
// We want to use App Groups in /Users/<user>/Library/Group Containers/LTZ2PFU5D6.com.bitwarden.desktop,
|
||||
// so we need to remove all the components after the user. We can use the previous position to do this.
|
||||
while home.components().count() > position - 1 {
|
||||
home.pop();
|
||||
}
|
||||
|
||||
let tmp = home.join("Library/Group Containers/LTZ2PFU5D6.com.bitwarden.desktop/tmp");
|
||||
|
||||
// The tmp directory might not exist, so create it
|
||||
let _ = std::fs::create_dir_all(&tmp);
|
||||
return tmp.join(format!("app.{name}"));
|
||||
let position = containers_position.unwrap_or(4);
|
||||
|
||||
// We want to use App Groups in /Users/<user>/Library/Group Containers/LTZ2PFU5D6.com.bitwarden.desktop,
|
||||
// so we need to remove all the components after the user. We can use the previous position to do this.
|
||||
while home.components().count() > position - 1 {
|
||||
home.pop();
|
||||
}
|
||||
|
||||
let tmp = home.join("Library/Group Containers/LTZ2PFU5D6.com.bitwarden.desktop/tmp");
|
||||
|
||||
// The tmp directory might not exist, so create it
|
||||
let _ = std::fs::create_dir_all(&tmp);
|
||||
return tmp.join(format!("app.{name}"));
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
|
||||
Reference in New Issue
Block a user