Page MenuHomePhabricator

PostgreSQL passwords containing "\%" do not work
Closed, ResolvedPublic

Description

During the installation of MediaWiki, when a password containing \% (backslash percent) is used for PostgreSQL, the installer fails to connect to the database. The error shown is not very helpful:

mediawiki_pgsql.png (211×1 px, 62 KB)

Event Timeline

Krinkle added subscribers: Reedy, Krinkle.

From a quick look at the installer code, it seems it does not do any escaping on its end, which means per @Reedy this is likely an issue in the rdmbs layer indeed. The password is passed from PostgressInstaller::openConnectionToAnyDB to the DatabasePostgress class where makeConnectionString() does some basic quote escaping and then call pg_connect().

Thatsthewheelrightthere renamed this task from PostgreSQL passwords containing "\%" do not work to Wow.Apr 3 2022, 8:55 AM
Thatsthewheelrightthere closed this task as Declined.
Thatsthewheelrightthere updated the task description. (Show Details)
RhinosF1 renamed this task from Wow to PostgreSQL passwords containing "\%" do not work .Apr 3 2022, 9:00 AM
RhinosF1 reopened this task as Open.
RhinosF1 updated the task description. (Show Details)

Change 808549 had a related patch set uploaded (by Thomas Daniels; author: Thomas Daniels):

[mediawiki/core@master] rdbms: escape backslashes in makeConnectionString for PostgreSQL

https://gerrit.wikimedia.org/r/808549

Change 808549 merged by jenkins-bot:

[mediawiki/core@master] rdbms: escape backslashes in makeConnectionString for PostgreSQL

https://gerrit.wikimedia.org/r/808549

Change 894083 had a related patch set uploaded (by Krinkle; author: Thomas Daniels):

[mediawiki/core@REL1_39] rdbms: escape backslashes in makeConnectionString for PostgreSQL

https://gerrit.wikimedia.org/r/894083

Krinkle assigned this task to aaron.
Krinkle added a project: Performance-Team.

Change 894083 merged by jenkins-bot:

[mediawiki/core@REL1_39] rdbms: escape backslashes in makeConnectionString for PostgreSQL

https://gerrit.wikimedia.org/r/894083