passbolt_api
passbolt_api copied to clipboard
Unable to install passbolt if a ' is in the Mysql password.
Installing passbolt with a ' in the Mysql password fails:
+ mysql -u root -e ';' + mysql -u root -e 'UPDATE mysql.user SET Password=PASSWORD('\''ABC'\''DEF'\'') WHERE User='\''root'\''; DELETE FROM mysql.user WHERE User='\'''\''; DELETE FROM mysql.user WHERE User='\''root'\'' AND Host NOT IN ('\''localhost'\'', '\''127.0.0.1'\'', '\''::1'\''); DROP DATABASE IF EXISTS test; DELETE FROM mysql.db WHERE Db='\''test'\'' OR Db='\''test\_%'\''; CREATE DATABASE IF NOT EXISTS passbolt; GRANT ALL ON passbolt.* to passbolt@'\''localhost'\'' identified by '\''ABC.DEF'\''; UPDATE mysql.user SET plugin = '\'''\'' WHERE user = '\''root'\'' AND host = '\''localhost'\''; FLUSH PRIVILEGES;' ERROR at line 1: Unknown command '\_'.
Seems like quoting goes wrong there.
Thank you for the bug report.
I just got an error when updating from Passbolt 2.1.0 to 2.8.3.
./bin/cake passbolt migrate --backup
fails when the password contains a $. I am not sure if this sticks to all special characters, as I cannot test it.
su -s /bin/bash -c "./bin/cake passbolt migrate --backup" nginx
Saving backup file: /var/www/passbolt/tmp/cache/database/backup_1555411772.sql
mysqldump: Got error: 1045: "Access denied for user 'passbolt'@'localhost' (using password: YES)" when trying to connect
Something went wrong!
Is this related to this bugreport or should I open a new one, as this happens on migration?
@maulwurf87 it's related to the database password but it's not the same issue. You can create another ticket, we'll make the follow-up on it.
I had a similar problem thanks to e.g. $
or /
in the database password. Maybe it has something to do with bash string escaping. It could be worth updating the tutorials to mention passwords should be alphanumeric.