Fixed code style.
This commit is contained in:
@@ -18,8 +18,9 @@ namespace NSspi.Contexts
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public class ImpersonationHandle : IDisposable
|
public class ImpersonationHandle : IDisposable
|
||||||
{
|
{
|
||||||
|
private readonly ServerContext server;
|
||||||
|
|
||||||
private bool disposed;
|
private bool disposed;
|
||||||
private ServerContext server;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the ImpersonationHandle. Does not perform impersonation.
|
/// Initializes a new instance of the ImpersonationHandle. Does not perform impersonation.
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ namespace NSspi.Contexts
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class ServerContext : Context
|
public class ServerContext : Context
|
||||||
{
|
{
|
||||||
private ContextAttrib requestedAttribs;
|
private readonly ContextAttrib requestedAttribs;
|
||||||
private ContextAttrib finalAttribs;
|
private readonly bool impersonationSetsThreadPrinciple;
|
||||||
|
|
||||||
|
private ContextAttrib finalAttribs;
|
||||||
private bool impersonating;
|
private bool impersonating;
|
||||||
private bool impersonationSetsThreadPrinciple;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Performs basic initialization of a new instance of the ServerContext class. The
|
/// Performs basic initialization of a new instance of the ServerContext class. The
|
||||||
@@ -31,11 +31,12 @@ namespace NSspi.Contexts
|
|||||||
public ServerContext( Credential cred, ContextAttrib requestedAttribs, bool impersonationSetsThreadPrinciple = false ) : base( cred )
|
public ServerContext( Credential cred, ContextAttrib requestedAttribs, bool impersonationSetsThreadPrinciple = false ) : base( cred )
|
||||||
{
|
{
|
||||||
this.requestedAttribs = requestedAttribs;
|
this.requestedAttribs = requestedAttribs;
|
||||||
|
this.impersonationSetsThreadPrinciple = impersonationSetsThreadPrinciple;
|
||||||
|
|
||||||
this.finalAttribs = ContextAttrib.Zero;
|
this.finalAttribs = ContextAttrib.Zero;
|
||||||
|
|
||||||
this.impersonating = false;
|
this.impersonating = false;
|
||||||
this.impersonationSetsThreadPrinciple = impersonationSetsThreadPrinciple;
|
|
||||||
|
|
||||||
this.SupportsImpersonate = this.Credential.PackageInfo.Capabilities.HasFlag( SecPkgCapability.Impersonation );
|
this.SupportsImpersonate = this.Credential.PackageInfo.Capabilities.HasFlag( SecPkgCapability.Impersonation );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,8 +136,6 @@ namespace NSspi.Contexts
|
|||||||
|
|
||||||
if( status == SecurityStatus.OK )
|
if( status == SecurityStatus.OK )
|
||||||
{
|
{
|
||||||
nextToken = null;
|
|
||||||
|
|
||||||
base.Initialize( rawExpiry.ToDateTime() );
|
base.Initialize( rawExpiry.ToDateTime() );
|
||||||
|
|
||||||
if( outBuffer.Length != 0 )
|
if( outBuffer.Length != 0 )
|
||||||
@@ -295,6 +294,10 @@ namespace NSspi.Contexts
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Releases all resources associted with the ServerContext.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing"></param>
|
||||||
protected override void Dispose( bool disposing )
|
protected override void Dispose( bool disposing )
|
||||||
{
|
{
|
||||||
// We were disposed while impersonating. This means that the consumer that is currently holding
|
// We were disposed while impersonating. This means that the consumer that is currently holding
|
||||||
|
|||||||
Reference in New Issue
Block a user