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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user