mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 18:23:31 +00:00
[PM-1674] let node-ipc use individual pipes on Windows (#4020)
* let node-ipc use individual pipes on Windows This fixes an issue with multiple users on Windows. There should be an individual Windows pipe used for communication between browser plugin and desktop for each user. However, the naming scheme used the same name for every user. This change adds some uniqueness with a hash over username and unique directory name. * Fix ipc socket root for native-messaging too * use only homedir as unique
This commit is contained in:
@@ -6,6 +6,7 @@ import * as util from "util";
|
||||
|
||||
import { ipcMain } from "electron";
|
||||
import * as ipc from "node-ipc";
|
||||
import { getIpcSocketRoot } from "../proxy/ipc";
|
||||
|
||||
import { LogService } from "@bitwarden/common/abstractions/log.service";
|
||||
|
||||
@@ -25,11 +26,9 @@ export class NativeMessagingMain {
|
||||
async listen() {
|
||||
ipc.config.id = "bitwarden";
|
||||
ipc.config.retry = 1500;
|
||||
if (process.platform === "darwin") {
|
||||
if (!existsSync(`${homedir()}/tmp`)) {
|
||||
await fs.mkdir(`${homedir()}/tmp`);
|
||||
}
|
||||
ipc.config.socketRoot = `${homedir()}/tmp/`;
|
||||
const ipcSocketRoot = getIpcSocketRoot();
|
||||
if (ipcSocketRoot != null) {
|
||||
ipc.config.socketRoot = ipcSocketRoot;
|
||||
}
|
||||
|
||||
ipc.serve(() => {
|
||||
|
||||
Reference in New Issue
Block a user