SMB2Client: Minor code readability improvement

This commit is contained in:
Tal Aloni 2025-01-10 23:19:48 +02:00
parent ffacfa53fb
commit 143c23c367

View file

@ -273,13 +273,13 @@ namespace SMBLibrary.Client
response = WaitForCommand(request.MessageID); response = WaitForCommand(request.MessageID);
} }
if (response is SessionSetupResponse) if (response is SessionSetupResponse finalSessionSetupResponse)
{ {
m_isLoggedIn = (response.Header.Status == NTStatus.STATUS_SUCCESS); m_isLoggedIn = (response.Header.Status == NTStatus.STATUS_SUCCESS);
if (m_isLoggedIn) if (m_isLoggedIn)
{ {
m_sessionKey = authenticationClient.GetSessionKey(); m_sessionKey = authenticationClient.GetSessionKey();
SessionFlags sessionFlags = ((SessionSetupResponse)response).SessionFlags; SessionFlags sessionFlags = finalSessionSetupResponse.SessionFlags;
if ((sessionFlags & SessionFlags.IsGuest) > 0) if ((sessionFlags & SessionFlags.IsGuest) > 0)
{ {
// [MS-SMB2] 3.2.5.3.1 If the SMB2_SESSION_FLAG_IS_GUEST bit is set in the SessionFlags field of the SMB2 // [MS-SMB2] 3.2.5.3.1 If the SMB2_SESSION_FLAG_IS_GUEST bit is set in the SessionFlags field of the SMB2