Skip to content

Commit

Permalink
Fixed cacheable root process algorithm when invoked via Shim #237
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardog committed Mar 2, 2023
1 parent 7a54115 commit ce4bd32
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/gsudo/Helpers/ProcessHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -341,21 +341,16 @@ static internal int GetProcessIntegrityLevel(IntPtr processHandle)
/// <returns></returns>
private static bool IsShim(string fileName)
{
Console.Write($"Is Shim {fileName} ");
try
{
if (!fileName.Equals(ProcessHelper.GetOwnExeName(), StringComparison.OrdinalIgnoreCase)
&& (fileName.EndsWith("\\SUDO.EXE", StringComparison.OrdinalIgnoreCase) ||
fileName.EndsWith("\\GSUDO.EXE", StringComparison.OrdinalIgnoreCase)
))
{
Console.WriteLine($"true");
return true;
}
}
catch { } // fails to get parent.MainModule if our parent process is elevated and we are not.

Console.WriteLine($"false");
return false;
}
}
Expand Down

0 comments on commit ce4bd32

Please sign in to comment.