mirror of
https://github.com/winscp/winscp.git
synced 2026-10-24 02:28:55 +03:00
@@ -2148,7 +2148,7 @@ TDateTime __fastcall FileTimeToDateTime(const FILETIME & FileTime)
|
||||
{
|
||||
// duplicated in DirView.pas
|
||||
TDateTime Result;
|
||||
// The 0xFFF... is sometime seen for invalid timestamps,
|
||||
// The 0xFFF... is sometimes seen for invalid timestamps,
|
||||
// it would cause failure in SystemTimeToDateTime below
|
||||
if (FileTime.dwLowDateTime == std::numeric_limits<DWORD>::max())
|
||||
{
|
||||
@@ -3416,11 +3416,11 @@ UnicodeString __fastcall TrimVersion(UnicodeString Version)
|
||||
return Version;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
UnicodeString __fastcall FormatVersion(int MajovVersion, int MinorVersion, int Release)
|
||||
UnicodeString __fastcall FormatVersion(int MajorVersion, int MinorVersion, int Release)
|
||||
{
|
||||
return
|
||||
TrimVersion(FORMAT(L"%d.%d.%d",
|
||||
(MajovVersion, MinorVersion, Release)));
|
||||
(MajorVersion, MinorVersion, Release)));
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
TFormatSettings __fastcall GetEngFormatSettings()
|
||||
@@ -4176,9 +4176,9 @@ UnicodeString __fastcall AssemblyNewClassInstanceStart(
|
||||
break;
|
||||
|
||||
case alVBNET:
|
||||
// Historically we use Dim .. With instead of object initilizer.
|
||||
// Historically we use Dim .. With instead of object initializer.
|
||||
// But for inline use, we have to use object initialize.
|
||||
// We should consistently always use object initilizers.
|
||||
// We should consistently always use object initializers.
|
||||
// Unfortunately VB.NET object initializer (contrary to C#) does not allow trailing comma.
|
||||
Result += SpaceOrPara + RtfKeyword(L"With");
|
||||
if (Inline)
|
||||
|
||||
@@ -273,7 +273,7 @@ void __fastcall TConfiguration::Default()
|
||||
FLogActionsRequired = false;
|
||||
FActionsLogFileName = L"%TEMP%\\!S.xml";
|
||||
FPermanentActionsLogFileName = FActionsLogFileName;
|
||||
FProgramIniPathWrittable = -1;
|
||||
FProgramIniPathWritable = -1;
|
||||
FCustomIniFileStorageName = LoadCustomIniFileStorageName();
|
||||
|
||||
Changed();
|
||||
@@ -1462,14 +1462,14 @@ UnicodeString __fastcall TConfiguration::GetAutomaticIniFileStorageName(bool Rea
|
||||
else
|
||||
{
|
||||
// avoid expensive test if we are interested in existing files only
|
||||
if (!ReadingOnly && (FProgramIniPathWrittable < 0))
|
||||
if (!ReadingOnly && (FProgramIniPathWritable < 0))
|
||||
{
|
||||
UnicodeString ProgramDir = ExtractFilePath(ProgramPath);
|
||||
FProgramIniPathWrittable = IsDirectoryWriteable(ProgramDir) ? 1 : 0;
|
||||
FProgramIniPathWritable = IsDirectoryWriteable(ProgramDir) ? 1 : 0;
|
||||
}
|
||||
|
||||
// does not really matter what we return when < 0
|
||||
IniPath = (FProgramIniPathWrittable == 0) ? AppDataIniPath : ProgramIniPath;
|
||||
IniPath = (FProgramIniPathWritable == 0) ? AppDataIniPath : ProgramIniPath;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -636,11 +636,11 @@ void __fastcall CryptographyInitialize()
|
||||
// initialization succeeds. It seems to be because the in_init_config_local recursion fuest is never cleared.
|
||||
// So for example, is the configuration is invalid, the foreground updates check still work,
|
||||
// as the foreground thread always initialized OpenSSL here (via RAND_poll), and the later
|
||||
// OPENSSL_init_crypto from withing updates TLS code succeeds. Similarly scripting TLS connections work.
|
||||
// OPENSSL_init_crypto from within updates TLS code succeeds. Similarly scripting TLS connections work.
|
||||
// But opening GUI TLS connections (WebDAV, S3...) fail, as they are opened on background thread,
|
||||
// and there the OPENSSL_init_crypto is first called from TLS connection.
|
||||
// Clean solution would be to fail any TLS connection,
|
||||
// if OPENSSL_init_crypto failed when called the firts time, but that would be regression.
|
||||
// if OPENSSL_init_crypto failed when called the first time, but that would be regression.
|
||||
// But let's be prepared that this happens if OpenSSL is ever fixed.
|
||||
if (!InitOpenssl())
|
||||
{
|
||||
|
||||
@@ -221,7 +221,7 @@ UnicodeString __fastcall TFileMasks::ComposeMaskStr(
|
||||
}
|
||||
|
||||
// For directories, the above will add slash at the end of masks,
|
||||
// breaking size and time masks and thus circumverting their validation.
|
||||
// breaking size and time masks and thus circumventing their validation.
|
||||
// This performs ad hoc validation to cover the scenario.
|
||||
// For files this makes no difference, but no harm either
|
||||
TFileMasks Temp(Directory ? 1 : 0);
|
||||
@@ -1258,7 +1258,7 @@ void __fastcall TCustomCommandData::operator=(const TCustomCommandData & Data)
|
||||
FSessionData->Assign(Data.SessionData);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
TSessionData * __fastcall TCustomCommandData::GetSesssionData() const
|
||||
TSessionData * __fastcall TCustomCommandData::GetSessionData() const
|
||||
{
|
||||
return FSessionData.get();
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ private:
|
||||
void __fastcall Init(
|
||||
TSessionData * SessionData, const UnicodeString & AUserName,
|
||||
const UnicodeString & Password, const UnicodeString & HostKey);
|
||||
TSessionData * __fastcall GetSesssionData() const;
|
||||
TSessionData * __fastcall GetSessionData() const;
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
class TFileCustomCommand : public TCustomCommand
|
||||
|
||||
@@ -1350,7 +1350,7 @@ bool __fastcall TFTPFileSystem::ConfirmOverwrite(
|
||||
bool CanResume =
|
||||
!OperationProgress->AsciiTransfer &&
|
||||
// when resuming transfer after interrupted connection,
|
||||
// do nothing (dummy resume) when the files has the same size.
|
||||
// do nothing (dummy resume) when the files have the same size.
|
||||
// this is workaround for servers that strangely fails just after successful
|
||||
// upload.
|
||||
(DestIsSmaller || (DestIsSame && CanAutoResume));
|
||||
@@ -1528,7 +1528,7 @@ void __fastcall TFTPFileSystem::DoFileTransferProgress(__int64 TransferSize,
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFTPFileSystem::SetCPSLimit(TFileOperationProgressType * OperationProgress)
|
||||
{
|
||||
// Any reason we use separate field intead of directly using OperationProgress->CPSLimit?
|
||||
// Any reason we use separate field instead of directly using OperationProgress->CPSLimit?
|
||||
// Maybe thread-safety?
|
||||
FFileTransferCPSLimit = OperationProgress->CPSLimit;
|
||||
OperationProgress->SetSpeedCounters();
|
||||
@@ -4703,7 +4703,7 @@ bool __fastcall TFTPFileSystem::GetFileModificationTimeInUtc(const wchar_t * Fil
|
||||
bool Result;
|
||||
try
|
||||
{
|
||||
// error-handling-free and DST-mode-inaware copy of TTerminal::OpenLocalFile
|
||||
// error-handling-free and DST-mode-unaware copy of TTerminal::OpenLocalFile
|
||||
HANDLE Handle = CreateFile(ApiPath(FileName).c_str(), GENERIC_READ,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0);
|
||||
if (Handle == INVALID_HANDLE_VALUE)
|
||||
|
||||
@@ -477,8 +477,8 @@ void __fastcall RetrieveNeonCertificateData(
|
||||
Data.FingerprintSHA1 = StrFromNeon(FingerprintSHA1);
|
||||
}
|
||||
|
||||
char * FingeprintSHA256 = ne_ssl_cert_hdigest(Certificate, NE_HASH_SHA256);
|
||||
if (DebugAlwaysFalse(FingeprintSHA256 == NULL))
|
||||
char * FingerprintSHA256 = ne_ssl_cert_hdigest(Certificate, NE_HASH_SHA256);
|
||||
if (DebugAlwaysFalse(FingerprintSHA256 == NULL))
|
||||
{
|
||||
Data.FingerprintSHA256 = Unknown;
|
||||
}
|
||||
@@ -494,7 +494,7 @@ void __fastcall RetrieveNeonCertificateData(
|
||||
}
|
||||
}
|
||||
Data.FingerprintSHA256 = Buf;
|
||||
ne_free(FingeprintSHA256);
|
||||
ne_free(FingerprintSHA256);
|
||||
}
|
||||
|
||||
Data.AsciiCert = NeonExportCertificate(Certificate);
|
||||
|
||||
@@ -1004,7 +1004,7 @@ Boolean __fastcall TRemoteFile::GetIsThisDirectory() const
|
||||
return (FileName == THISDIRECTORY);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
Boolean __fastcall TRemoteFile::GetIsInaccesibleDirectory() const
|
||||
Boolean __fastcall TRemoteFile::GetIsInaccessibleDirectory() const
|
||||
{
|
||||
Boolean Result;
|
||||
if (IsDirectory)
|
||||
|
||||
@@ -126,7 +126,7 @@ private:
|
||||
void __fastcall SetIsHidden(bool value);
|
||||
bool __fastcall GetIsParentDirectory() const;
|
||||
bool __fastcall GetIsThisDirectory() const;
|
||||
bool __fastcall GetIsInaccesibleDirectory() const;
|
||||
bool __fastcall GetIsInaccessibleDirectory() const;
|
||||
UnicodeString __fastcall GetExtension();
|
||||
UnicodeString __fastcall GetUserModificationStr();
|
||||
void __fastcall LoadTypeInfo();
|
||||
@@ -181,7 +181,7 @@ public:
|
||||
__property bool IsHidden = { read = GetIsHidden, write = SetIsHidden };
|
||||
__property bool IsParentDirectory = { read = GetIsParentDirectory };
|
||||
__property bool IsThisDirectory = { read = GetIsThisDirectory };
|
||||
__property bool IsInaccesibleDirectory = { read=GetIsInaccesibleDirectory };
|
||||
__property bool IsInaccesibleDirectory = { read=GetIsInaccessibleDirectory };
|
||||
__property UnicodeString Extension = { read=GetExtension };
|
||||
__property bool IsEncrypted = { read = FIsEncrypted };
|
||||
};
|
||||
|
||||
@@ -492,7 +492,7 @@ void __fastcall TSCPFileSystem::EnsureLocation()
|
||||
{
|
||||
// when location to cached directory fails, pretend again
|
||||
// location in cached directory
|
||||
// here used to be check (CurrentDirectory != Directory), but it is
|
||||
// here used to check (CurrentDirectory != Directory), but it is
|
||||
// false always (current directory is already set to cached directory),
|
||||
// making the condition below useless. check removed.
|
||||
if (FTerminal->Active)
|
||||
|
||||
@@ -371,7 +371,7 @@ void __fastcall TSessionData::Default()
|
||||
// add also to TSessionLog::AddStartupInfo()
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TSessionData::NonPersistant()
|
||||
void __fastcall TSessionData::NonPersistent()
|
||||
{
|
||||
UpdateDirectories = false;
|
||||
PreserveDirectoryChanges = false;
|
||||
@@ -5476,7 +5476,7 @@ bool __fastcall TStoredSessionList::OpenHostKeysSubKey(THierarchicalStorage * St
|
||||
return Storage->OpenSubKey(Configuration->SshHostKeysSubKey, CanCreate);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
THierarchicalStorage * __fastcall TStoredSessionList::CreateHostKeysStorageForWritting()
|
||||
THierarchicalStorage * __fastcall TStoredSessionList::CreateHostKeysStorageForWriting()
|
||||
{
|
||||
bool SessionList = false;
|
||||
std::unique_ptr<THierarchicalStorage> Storage(Configuration->CreateScpStorage(SessionList));
|
||||
|
||||
@@ -510,7 +510,7 @@ public:
|
||||
TSessionData * __fastcall Clone();
|
||||
void __fastcall Default();
|
||||
void __fastcall DefaultSettings();
|
||||
void __fastcall NonPersistant();
|
||||
void __fastcall NonPersistent();
|
||||
void __fastcall Load(THierarchicalStorage * Storage, bool PuttyImport);
|
||||
void __fastcall ApplyRawSettings(TStrings * RawSettings, bool Unsafe);
|
||||
void __fastcall ApplyRawSettings(THierarchicalStorage * Storage, bool Unsafe, bool RespectDisablePasswordStoring);
|
||||
@@ -819,7 +819,7 @@ private:
|
||||
TSessionData * Data, const UnicodeString & Name);
|
||||
void __fastcall ImportLevelFromFilezilla(_di_IXMLNode Node, const UnicodeString & Path, _di_IXMLNode SettingsNode);
|
||||
void __fastcall DoGetFolderOrWorkspace(const UnicodeString & Name, TList * List, bool NoRecrypt);
|
||||
static THierarchicalStorage * __fastcall CreateHostKeysStorageForWritting();
|
||||
static THierarchicalStorage * __fastcall CreateHostKeysStorageForWriting();
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
UnicodeString GetExpandedLogFileName(UnicodeString LogFileName, TDateTime Started, TSessionData * SessionData);
|
||||
|
||||
@@ -849,9 +849,9 @@ void __fastcall TSessionLog::DoAddToSelf(TLogLineType Type, const UnicodeString
|
||||
UtfLine.Insert('\r', Index);
|
||||
}
|
||||
}
|
||||
int Writting = UtfLine.Length();
|
||||
CheckSize(Writting);
|
||||
FCurrentFileSize += fwrite(UtfLine.c_str(), 1, Writting, (FILE *)FFile);
|
||||
int Writing = UtfLine.Length();
|
||||
CheckSize(Writing);
|
||||
FCurrentFileSize += fwrite(UtfLine.c_str(), 1, Writing, (FILE *)FFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -602,7 +602,7 @@ public:
|
||||
return Result;
|
||||
}
|
||||
|
||||
// For reading strings that are character strings (not byte strings as
|
||||
// For reading strings that are character strings (not byte strings
|
||||
// as file handles), and SFTP spec does not say explicitly that they
|
||||
// are in UTF. For most of them it actually does not matter as
|
||||
// the content should be pure ASCII (e.g. extension names, etc.)
|
||||
@@ -4745,7 +4745,7 @@ void __fastcall TSFTPFileSystem::Source(
|
||||
}
|
||||
else
|
||||
{
|
||||
// partial upload file does not exists, check for full file
|
||||
// partial upload file does not exist, check for full file
|
||||
if (DestFileExists)
|
||||
{
|
||||
UnicodeString PrevDestFileName = DestFileName;
|
||||
|
||||
@@ -874,7 +874,7 @@ void TParallelOperation::Done(
|
||||
|
||||
if (!FParallelFileMerging)
|
||||
{
|
||||
// Once we obtain "merging" semaphor, we won't leave until everything is merged
|
||||
// Once we obtain "merging" semaphore, we won't leave until everything is merged
|
||||
TAutoFlag MergingFlag(FParallelFileMerging);
|
||||
|
||||
try
|
||||
@@ -3199,7 +3199,7 @@ unsigned int __fastcall TTerminal::ConfirmFileOverwrite(
|
||||
break;
|
||||
}
|
||||
|
||||
// we user has not selected another batch overwrite mode,
|
||||
// if user has not selected another batch overwrite mode,
|
||||
// keep the current one. note that we may get here even
|
||||
// when batch overwrite was selected already, but it could not be applied
|
||||
// to current transfer (see condition above)
|
||||
@@ -9067,7 +9067,7 @@ __fastcall TSecondaryTerminal::TSecondaryTerminal(
|
||||
FMainTerminal(MainTerminal)
|
||||
{
|
||||
Log->SetParent(FMainTerminal->Log, Name);
|
||||
SessionData->NonPersistant();
|
||||
SessionData->NonPersistent();
|
||||
DebugAssert(FMainTerminal != NULL);
|
||||
FMainTerminal->FSecondaryTerminals++;
|
||||
if (SessionData->TunnelLocalPortNumber != 0)
|
||||
|
||||
@@ -351,7 +351,7 @@ TWebDAVFileSystem::TSessionContext * TWebDAVFileSystem::NeonOpen(const UnicodeSt
|
||||
|
||||
UpdateNeonDebugMask();
|
||||
|
||||
NeonAddAuthentiation(Result.get(), Ssl);
|
||||
NeonAddAuthentication(Result.get(), Ssl);
|
||||
|
||||
if (Ssl)
|
||||
{
|
||||
@@ -390,7 +390,7 @@ void TWebDAVFileSystem::NeonAuxRequestInit(ne_session * Session, ne_request * /*
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TWebDAVFileSystem::NeonAddAuthentiation(TSessionContext * SessionContext, bool UseNegotiate)
|
||||
void __fastcall TWebDAVFileSystem::NeonAddAuthentication(TSessionContext * SessionContext, bool UseNegotiate)
|
||||
{
|
||||
unsigned int NeonAuthTypes = NE_AUTH_BASIC | NE_AUTH_DIGEST | NE_AUTH_PASSPORT;
|
||||
if (UseNegotiate)
|
||||
@@ -1491,7 +1491,7 @@ void __fastcall TWebDAVFileSystem::Source(
|
||||
// The only server we found that supports this is TradeMicro SafeSync.
|
||||
// But it announces itself as "Server: Apache",
|
||||
// so it's not reliable to autodetect the support.
|
||||
// Microsoft Office alegedly uses <Win32LastModifiedTime>
|
||||
// Microsoft Office allegedly uses <Win32LastModifiedTime>
|
||||
// https://sabre.io/dav/clients/msoffice/
|
||||
// Carot DAV does that too. But we do not know what server does support this.
|
||||
TouchAction.Cancel();
|
||||
@@ -1639,7 +1639,7 @@ void __fastcall TWebDAVFileSystem::HttpAuthenticationFailed(TSessionContext * Se
|
||||
// We have to retry with a fresh request. That's what FAuthenticationRetry does.
|
||||
FTerminal->LogEvent(FORMAT(L"%s challenge failed, will try different challenge", (SessionContext->AuthorizationProtocol)));
|
||||
ne_remove_server_auth(SessionContext->NeonSession);
|
||||
NeonAddAuthentiation(SessionContext, false);
|
||||
NeonAddAuthentication(SessionContext, false);
|
||||
FAuthenticationRetry = true;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -137,7 +137,7 @@ protected:
|
||||
const ne_uri * Uri, const ne_status * Status);
|
||||
void __fastcall RequireLockStore();
|
||||
void InitSslSession(ssl_st * Ssl, ne_session * Session);
|
||||
void __fastcall NeonAddAuthentiation(TSessionContext * SessionContext, bool UseNegotiate);
|
||||
void __fastcall NeonAddAuthentication(TSessionContext * SessionContext, bool UseNegotiate);
|
||||
void __fastcall HttpAuthenticationFailed(TSessionContext * SessionContext);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user