Topic "Mintty (Cygwin) and version 5.9 error : mintty syntax error in position 'w'"

Author Message
toto21
[View user's profile]

Joined: 2016-07-27
Posts: 6
Location: Marseille France
The latest version 5.9 prevents execution of mintty (Cygwin) via Options> Prerences> Integration> Applications> Client PuTTYerminal path:
Code:
C:\cygwin\bin\mintty.exe -t  !@ /bin/bash -ile /home/user/winscpscript/ssh.sh !U !@ !P


Error :
Quote:
mintty syntax error in position 'w'


My sh script to manage exotic ports such as ssh 15322 ... and the passing of my password to my clipboard (I know it's not good but so practical)

Code:
#/bin/sh
echo "Connection $1@$2"
# copy pwd in clipboard - Once connected thinking (for security) to select anything to crush mintty clipboard
printf  $3 >/dev/clipboard
if [ $1 ==  'user_name_ssh' ]
then
   ssh -p 15322 ${1}@${2}
....

else
   ssh ${1}@${2}
fi


Thank you to consider this in the next version of winscp
cf other post : https://winscp.net/forum/viewtopic.php?t=16243
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Sorry, I do not understand what is the problem. Can you explain?
toto21
[View user's profile]

Joined: 2016-07-27
Posts: 6
Location: Marseille France
Hello Martin,
Thanks for your response.
Now, with latest version 5.9 when Ctrl P to open ssh session i have this error message :

mintty syntax error in position 'w'
So i downgrad to 5.7 version and it's ok.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
So can you please find out what does WinSCP 5.9 differently that it breaks the script? It's not obvious to me. And I do not have mintty.
_________________
Martin Prikryl
toto21
[View user's profile]

Joined: 2016-07-27
Posts: 6
Location: Marseille France
Yes,
Whatever sh script is the interpretation of Client PuTTY/Terminal path
that changed with the verson 5.9 (I have not tested 5.8)

In fact it is as if the 5.9 add a plus option mintty (certainly for putty) - this is what is new with this version of winscp
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
What do you mean by "add a plus option mintty"?
toto21
[View user's profile]

Joined: 2016-07-27
Posts: 6
Location: Marseille France
Sorry indeed it was not very clear (my english is bad),
In fact it is as if Winscp 5.9 added an option (certainly for putty) to the command line that triggers an error for mintty
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Please hold down Shift + Ctrl while clicking the Open in PuTTY command.
It will make WinSCP copy the resolved command to the clipboard.
Please post the command here.
toto21
[View user's profile]

Joined: 2016-07-27
Posts: 6
Location: Marseille France
Hello Martin,
I think I understand what changed.
Before (4.7 version) when checked option Remember session password and it pass it to Putty(SSH) (in Preferences>Integration>Applications) it did not add -pw password to the command line options (for mintty the -p option expects coordinated and not a letter (here w) - which causes an error see https://mintty.github.io/mintty.1.html).
In my case :
Code:
C:\cygwin\bin\mintty.exe -t  !@ /bin/bash -ile /home/user/winscpscript/ssh.sh !U !@ !P

becomes
Code:
C:\cygwin\bin\mintty.exe -pw mypassword -t  myhost /bin/bash -ile /home/user/winscpscript/ssh.sh myuser myhost mypassword


When the option Remember session password and it pass it to Putty(SSH) is not checked the command becomes :
Code:
C:\cygwin\bin\mintty.exe -t  myhost /bin/bash -ile /home/user/winscpscript/ssh.sh myuser myhost
in this case it is script shell the script that bugs (mising third argument : mypassword).

To correct this behavior would have when the pattern !P is present in Putty/Terminal client path (logically Remember session password and it pass it to Putty(SSH) is not checked)
then the password is sent (I hope in 5.9.1)

Martin thank you again for all the energy that you put to reply to this post.
Regards
Claude
toto21
[View user's profile]

Joined: 2016-07-27
Posts: 6
Location: Marseille France
I really understand after reinstall 5.7 for my jog Embarassed

Code:
C:\cygwin\bin\mintty.exe -t  !@ /bin/bash -ile /home/user/winscpscript/ssh.sh !U !@ !P

becomes on 5.9
Code:
C:\cygwin\bin\mintty.exe -pw mypassword -t  myhost /bin/bash -ile /home/user/winscpscript/ssh.sh myuser myhost mypassword

-pw is sent before other arguments

becomes on 5.7
Code:
C:\cygwin\bin\mintty.exe -t  myhost /bin/bash -ile /home/user/winscpscript/ssh.sh myuser myhost mypassword -pw mypassword

-pw is sent after other arguments

This is the real change between the two versions Sad
_________________
Everyone knew that it was impossible. He came a fool who did not know and who did it.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Thanks for all the details.

toto21 wrote:
To correct this behavior would have when the pattern !P is present in Putty/Terminal client path (logically Remember session password and it pass it to Putty(SSH) is not checked)
then the password is sent (I hope in 5.9.1)

It should have behaved like this, but it didn't.
This bug has been added to the tracker:
https://winscp.net/tracker/show_bug.cgi?id=1443

I'm sending you an email with a development version of WinSCP to the address you have used to register on this forum.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License