Browse Source

Logging when SFTP server returns higher version than asked for

(cherry picked from commit b2465d9bc57ca88ca1290d64ba891f6cd5a9b3e6)

Source commit: 28c649884c8523c492124a0ac9bdc78d9c49aa5b
Martin Prikryl 4 years ago
parent
commit
2e516809f2
1 changed files with 6 additions and 0 deletions
  1. 6 0
      source/core/SftpFileSystem.cpp

+ 6 - 0
source/core/SftpFileSystem.cpp

@@ -2985,6 +2985,12 @@ void __fastcall TSFTPFileSystem::DoStartup()
 
   FVersion = Packet.GetCardinal();
   FTerminal->LogEvent(FORMAT(L"SFTP version %d negotiated.", (FVersion)));
+  if (FVersion > MaxVersion)
+  {
+    // This happens with ProFTPD:
+    // https://github.com/proftpd/proftpd/issues/1200
+    FTerminal->LogEvent(L"Got higher version than asked for.");
+  }
   if (FVersion < SFTPMinVersion || FVersion > SFTPMaxVersion)
   {
     FTerminal->FatalError(NULL, FMTLOAD(SFTP_VERSION_NOT_SUPPORTED,