Skip to content

Commit

Permalink
Fix enabling SMB2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
jmk-foofus committed Mar 23, 2024
1 parent 2ee0e9a commit dd0bd18
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ AC_ARG_ENABLE(module-smbnt-smb2,

AM_CONDITIONAL(BUILD_MODULE_SMBNT_SMB2, test x"$enable_module_smbnt_smb2" = "xtrue")
if test x"$enable_module_smbnt_smb2" = "xtrue"; then
AC_DEFINE(SMBNT_SMB2_SUPPORT_ENABLED, 1, [SMBNT SMBv2 Support Enabled])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
Expand Down
2 changes: 1 addition & 1 deletion src/modsrc/smbnt-smb2.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "smbnt.h"

#ifdef BUILD_MODULE_SMBNT_SMB2
#ifdef SMBNT_SMB2_SUPPORT_ENABLED

#define SMBv2 16

Expand Down
6 changes: 3 additions & 3 deletions src/modsrc/smbnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ int initModule(sLogin* psLogin, _SMBNT_DATA *_psSessionData)
if (hSocket > 0)
medusaDisconnect(hSocket);
hSocket = -1;
#ifdef BUILD_MODULE_SMBNT_SMB2
#ifdef SMBNT_SMB2_SUPPORT_ENABLED
smb2_destroy_context(_psSessionData->smb2);
#endif
nState = MSTATE_COMPLETE;
Expand All @@ -430,7 +430,7 @@ int initModule(sLogin* psLogin, _SMBNT_DATA *_psSessionData)
if (hSocket > 0)
medusaDisconnect(hSocket);
hSocket = -1;
#ifdef BUILD_MODULE_SMBNT_SMB2
#ifdef SMBNT_SMB2_SUPPORT_ENABLED
smb2_destroy_context(_psSessionData->smb2);
#endif
psLogin->iResult = LOGIN_RESULT_UNKNOWN;
Expand Down Expand Up @@ -517,7 +517,7 @@ int tryLogin(int hSocket, sLogin** psLogin, _SMBNT_DATA* _psSessionData, char* s
} else {
SMBSessionRet = SMBSessionSetup(hSocket, psLogin, _psSessionData, szLogin, szPassword);
}

SMBerr = (unsigned long) SMBSessionRet & 0x00FFFFFF;
SMBaction = ((unsigned long) SMBSessionRet & 0xFF000000) >> 24;

Expand Down

0 comments on commit dd0bd18

Please sign in to comment.