Преглед на файлове

Bug fix: An open scripting command for FTP session with encrypted client certificate without passphrase but with password is silently ignored

Source commit: c48bd59e4d54260ab853186d335e790f02f02626
Martin Prikryl преди 9 години
родител
ревизия
db48da66df
променени са 2 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 3 1
      source/core/FtpFileSystem.cpp
  2. 1 0
      source/core/FtpFileSystem.h

+ 3 - 1
source/core/FtpFileSystem.cpp

@@ -417,6 +417,7 @@ void __fastcall TFTPFileSystem::Open()
   }
 
   FPasswordFailed = false;
+  FStoredPasswordTried = false;
   bool PromptedForCredentials = false;
 
   do
@@ -2846,7 +2847,7 @@ bool __fastcall TFTPFileSystem::TemporaryTransferFile(const UnicodeString & /*Fi
 //---------------------------------------------------------------------------
 bool __fastcall TFTPFileSystem::GetStoredCredentialsTried()
 {
-  return !FTerminal->SessionData->Password.IsEmpty();
+  return FStoredPasswordTried;
 }
 //---------------------------------------------------------------------------
 UnicodeString __fastcall TFTPFileSystem::GetUserName()
@@ -3600,6 +3601,7 @@ void __fastcall TFTPFileSystem::HandleReplyStatus(UnicodeString Response)
     }
     else if (FLastCommand == PASS)
     {
+      FStoredPasswordTried = true;
       // 530 = "Not logged in."
       if (FLastCode == 530)
       {

+ 1 - 0
source/core/FtpFileSystem.h

@@ -225,6 +225,7 @@ private:
   unsigned int FCommandReply;
   TCommand FLastCommand;
   bool FPasswordFailed;
+  bool FStoredPasswordTried;
   bool FMultineResponse;
   int FLastCode;
   int FLastCodeClass;