From f09367a61407eba314159625ddae3106d92f0c81 Mon Sep 17 00:00:00 2001 From: cdammanintopix <63319198+cdammanintopix@users.noreply.github.com> Date: Fri, 25 Apr 2025 10:56:28 +0200 Subject: [PATCH] fix: Append UserName to the SourceGitIPCChannel NamedPipeServerStream to allow multiple users usage on the same server (#1244) (#1246) --- src/Models/IpcChannel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Models/IpcChannel.cs b/src/Models/IpcChannel.cs index 2ecfb771..d47a46bd 100644 --- a/src/Models/IpcChannel.cs +++ b/src/Models/IpcChannel.cs @@ -22,7 +22,7 @@ namespace SourceGit.Models _singletoneLock = File.Open(Path.Combine(Native.OS.DataDir, "process.lock"), FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None); _isFirstInstance = true; _server = new NamedPipeServerStream( - "SourceGitIPCChannel", + "SourceGitIPCChannel" + Environment.UserName, PipeDirection.In, -1, PipeTransmissionMode.Byte, @@ -40,7 +40,7 @@ namespace SourceGit.Models { try { - using (var client = new NamedPipeClientStream(".", "SourceGitIPCChannel", PipeDirection.Out)) + using (var client = new NamedPipeClientStream(".", "SourceGitIPCChannel" + Environment.UserName, PipeDirection.Out, PipeOptions.Asynchronous | PipeOptions.CurrentUserOnly)) { client.Connect(1000); if (!client.IsConnected)