mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 08:33:19 +01:00
Workaround for https://github.com/dotnet/corefx/issues/31841
This commit is contained in:
@@ -62,7 +62,13 @@ namespace Tgstation.Server.Host.Security
|
||||
public ISystemIdentity Clone()
|
||||
{
|
||||
if (identity != null)
|
||||
return new WindowsSystemIdentity((WindowsIdentity)identity.Clone());
|
||||
{
|
||||
//var newIdentity = (WindowsIdentity)identity.Clone(); //doesn't work because of https://github.com/dotnet/corefx/issues/31841
|
||||
|
||||
var newIdentity = new WindowsIdentity(identity.Token); //the handle is cloned internally
|
||||
|
||||
return new WindowsSystemIdentity(newIdentity);
|
||||
}
|
||||
//can't clone a UP, shouldn't be trying to anyway, cloning is for impersonation
|
||||
throw new InvalidOperationException("Cannot clone a UserPrincipal based WindowsSystemIdentity!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user