Fixed code style.

This commit is contained in:
Kevin Thompson
2019-06-16 17:22:21 -04:00
parent 01ad97b272
commit 002da1559b
2 changed files with 12 additions and 8 deletions

View File

@@ -18,8 +18,9 @@ namespace NSspi.Contexts
/// </remarks>
public class ImpersonationHandle : IDisposable
{
private readonly ServerContext server;
private bool disposed;
private ServerContext server;
/// <summary>
/// Initializes a new instance of the ImpersonationHandle. Does not perform impersonation.

View File

@@ -12,11 +12,11 @@ namespace NSspi.Contexts
/// </summary>
public class ServerContext : Context
{
private ContextAttrib requestedAttribs;
private ContextAttrib finalAttribs;
private readonly ContextAttrib requestedAttribs;
private readonly bool impersonationSetsThreadPrinciple;
private ContextAttrib finalAttribs;
private bool impersonating;
private bool impersonationSetsThreadPrinciple;
/// <summary>
/// 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 )
{
this.requestedAttribs = requestedAttribs;
this.impersonationSetsThreadPrinciple = impersonationSetsThreadPrinciple;
this.finalAttribs = ContextAttrib.Zero;
this.impersonating = false;
this.impersonationSetsThreadPrinciple = impersonationSetsThreadPrinciple;
this.SupportsImpersonate = this.Credential.PackageInfo.Capabilities.HasFlag( SecPkgCapability.Impersonation );
}
@@ -135,8 +136,6 @@ namespace NSspi.Contexts
if( status == SecurityStatus.OK )
{
nextToken = null;
base.Initialize( rawExpiry.ToDateTime() );
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 )
{
// We were disposed while impersonating. This means that the consumer that is currently holding