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

quote MySQL password #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MegaphoneJon
Copy link
Contributor

If you have globbing characters (e.g. *) in your MySQL password, cv will fail to connect. Quoting the password in the generated defaults-file fixes the problem and seems to have no ill effect.

@@ -137,7 +137,7 @@ public function toMySQLArguments($tmpDir) {
$data = "[client]\n";
$data .= "host={$this->host}\n";
$data .= "user={$this->username}\n";
$data .= "password={$this->password}\n";
$data .= "password='{$this->password}'\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

I suppose one could have a password with a quote mark? Do you happen to know what escaping rules they use MySQL's file-format? Maybe addslashes() or addcslashes() would come closer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants