Added a helpful flag to ServerContext to indicate to consumers whether it can support impersonation. Added checks to throw exceptions if impersonation is attempted on a ServerContext that does not support impersonation. Also modified the disposal behavior so that if the ServerContext is disposed while impersonation is occurring, impersonation is explicitly reverted. Consumers wishing to perform long-term impersonation must hold valid references to both the context and impersonation handle.

This commit is contained in:
antiduh
2014-07-01 15:52:00 +00:00
parent aed206e1be
commit b8fd4d9a07
2 changed files with 37 additions and 4 deletions

View File

@@ -28,6 +28,8 @@ namespace NSspi.Credentials
this.securityPackage = package;
this.expiry = DateTime.MinValue;
this.PackageInfo = PackageSupport.GetPackageCapabilities( this.SecurityPackage );
}
~Credential()
@@ -35,6 +37,8 @@ namespace NSspi.Credentials
Dispose( false );
}
public SecPkgInfo PackageInfo { get; private set; }
public string SecurityPackage
{
get