Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH Connection fails with upper quotation mark in passwords #261

Closed
EvilKarter opened this issue May 7, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@EvilKarter
Copy link

commented May 7, 2018

Steps to reproduce this issue

  1. Create a new Connection with type: MySQL (SSH tunnel)
  2. On Tab SSH Tunnel enter your data. Important is that there has to be an upper quotation mark (") in the password
  3. Save Settings and try to connect
  4. Then I get an Failure

Current behavior

If I want to use an upper quotation mark (") in the SSH Tunnel Settings I can't connect to the Server.

Expected behavior

It should be possible to use upper quotation mark (") in the pasword of the SSH tunnel Settings.
If I use the same credentials in putty it works.

Possible solution

correct escaping of passwords with upper quotation mark (")

Environment

  • HeidiSQL version:
    9.5.0.5278 (64 Bit)
  • Database system and version:
    MySQL 5.7.21
  • Operating system:
    Win 10 64 Bit
@ansgarbecker

This comment has been minimized.

Copy link
Collaborator

commented May 7, 2018

Could you please give a hint on how I should escape double quotes? I find quite some references on the net, but highly insonsistent. Some say it has to be a duplicated double quote, some say it needs to be escaped by several (up to 3) backslashes, plus an additional double quote. I'm confused.

@danitxo

This comment has been minimized.

Copy link

commented May 7, 2018

It looks like there is a function in Delphi that do the job (the escaping method in Delphi is something curious).

But the problem may be on the SSH client side, so you need to escape with a backslash (more commonly used approach) only if is using the same type of quotation mark for the string. For example:
$var = 'te\'xt'; // it's ok, we escape the ' because the string is enclosed with the '
$var = "te'xt"; // it's ok, we don't escape the ' because the string is enclosed with the "
$var = "te\"xt"; // it's ok
$var = 'te"xt'; // it's ok
$var = 'te'xt'; // it's NOT ok!
$var = "te"xt"; // it's NOT ok!

Here you have an example for bash, the closest approach (I think) for the solution.

PS: Only for informational porpouses, in some special scenarios like handling with regular expressions, you would have to escape the backslash with the backslash too :) (only one backslash would escape the next character on the regular expression, and not act like a backslash character)

@ansgarbecker

This comment has been minimized.

Copy link
Collaborator

commented Jun 29, 2019

@danitxo or @EvilKarter could someone please update to the latest build and check if double quotes in passwords are now working?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.