Added MachineName and CreationDT properties to SMB1Session and SMB2Session

This commit is contained in:
Tal Aloni 2017-03-04 11:25:46 +02:00
parent e3dafa524f
commit 054d537c26
2 changed files with 36 additions and 0 deletions

View file

@ -19,6 +19,7 @@ namespace SMBLibrary.Server
private ushort m_userID;
private byte[] m_sessionKey;
private SecurityContext m_securityContext;
private DateTime m_creationDT;
// Key is TID
private Dictionary<ushort, ISMBShare> m_connectedTrees = new Dictionary<ushort, ISMBShare>();
@ -36,6 +37,7 @@ namespace SMBLibrary.Server
m_userID = userID;
m_sessionKey = sessionKey;
m_securityContext = new SecurityContext(userName, machineName, connection.ClientEndPoint, connection.AuthenticationContext, accessToken);
m_creationDT = DateTime.Now;
}
public ushort? AddConnectedTree(ISMBShare share)
@ -158,5 +160,21 @@ namespace SMBLibrary.Server
return m_securityContext.UserName;
}
}
public string MachineName
{
get
{
return m_securityContext.MachineName;
}
}
public DateTime CreationDT
{
get
{
return m_creationDT;
}
}
}
}

View file

@ -18,6 +18,7 @@ namespace SMBLibrary.Server
private ulong m_sessionID;
private byte[] m_sessionKey;
private SecurityContext m_securityContext;
private DateTime m_creationDT;
// Key is TreeID
private Dictionary<uint, ISMBShare> m_connectedTrees = new Dictionary<uint, ISMBShare>();
@ -35,6 +36,7 @@ namespace SMBLibrary.Server
m_sessionID = sessionID;
m_sessionKey = sessionKey;
m_securityContext = new SecurityContext(userName, machineName, connection.ClientEndPoint, connection.AuthenticationContext, accessToken);
m_creationDT = DateTime.Now;
}
private uint? AllocateTreeID()
@ -163,5 +165,21 @@ namespace SMBLibrary.Server
return m_securityContext.UserName;
}
}
public string MachineName
{
get
{
return m_securityContext.MachineName;
}
}
public DateTime CreationDT
{
get
{
return m_creationDT;
}
}
}
}