Check handle
MODIFY
WalletWasabi/Microservices/ProcessAsync.cs
WalletWasabi/Microservices/ProcessAsync.cs
@@ -40,6 +40,9 @@ public class ProcessAsync : IDisposable
/// <inheritdoc cref="Process.Id"/>
public int Id => Process.Id;
+ /// <inheritdoc cref="Process.Handle"/>
+ public IntPtr Handle => Process.Handle;
+
/// <inheritdoc cref="Process.StandardInput"/>
public StreamWriter StandardInput => Process.StandardInput;

MODIFY
WalletWasabi/Tor/TorProcessManager.cs
WalletWasabi/Tor/TorProcessManager.cs
@@ -143,6 +143,10 @@ public class TorProcessManager : IAsyncDisposable
controlClient = await InitTorControlAsync(cancellationToken).ConfigureAwait(false);
}
+ // Note: This is a workaround how to check whether we have sufficient permissions for the process.
+ // Especially, we want to make sure that Tor is running under our user and not a different one.
+ nint _ = process.Handle;
+
Logger.LogInfo("Tor is running.");
// Only now we know that Tor process is fully started.

Check handle