mirror of
https://github.com/winscp/winscp.git
synced 2026-10-24 02:28:55 +03:00
Bug 1906" *nix shell special characters were unintentionally escaped in in PuTTY/SSH terminal command patterns
https://winscp.net/tracker/1906 Source commit: de45a015f542df489fea2045683e3a74b8ee1edc
This commit is contained in:
@@ -171,16 +171,16 @@ void __fastcall OpenSessionInPutty(const UnicodeString PuttyPath,
|
||||
Password = SessionData->Password;
|
||||
}
|
||||
}
|
||||
TCustomCommandData Data(SessionData, SessionData->UserName, Password);
|
||||
TRemoteCustomCommand RemoteCustomCommand(Data, SessionData->RemoteDirectory);
|
||||
TCustomCommandData Data(SessionData, L"domain\\username"/*SessionData->UserName*/, Password);
|
||||
TLocalCustomCommand LocalCustomCommand(Data, SessionData->RemoteDirectory, SessionData->LocalDirectory);
|
||||
TWinInteractiveCustomCommand InteractiveCustomCommand(
|
||||
&RemoteCustomCommand, L"PuTTY", UnicodeString());
|
||||
&LocalCustomCommand, L"PuTTY", UnicodeString());
|
||||
|
||||
UnicodeString Params =
|
||||
RemoteCustomCommand.Complete(InteractiveCustomCommand.Complete(AParams, false), true);
|
||||
LocalCustomCommand.Complete(InteractiveCustomCommand.Complete(AParams, false), true);
|
||||
UnicodeString PuttyParams;
|
||||
|
||||
if (!RemoteCustomCommand.IsSiteCommand(AParams))
|
||||
if (!LocalCustomCommand.IsSiteCommand(AParams))
|
||||
{
|
||||
{
|
||||
bool SessionList = false;
|
||||
@@ -272,7 +272,7 @@ void __fastcall OpenSessionInPutty(const UnicodeString PuttyPath,
|
||||
}
|
||||
}
|
||||
|
||||
if (!Password.IsEmpty() && !RemoteCustomCommand.IsPasswordCommand(AParams))
|
||||
if (!Password.IsEmpty() && !LocalCustomCommand.IsPasswordCommand(AParams))
|
||||
{
|
||||
Password = NormalizeString(Password); // if password is empty, we should quote it always
|
||||
AddToList(PuttyParams, FORMAT(L"-pw %s", (EscapePuttyCommandParam(Password))), L" ");
|
||||
|
||||
Reference in New Issue
Block a user