Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1020671

Summary: connect() method should forward password down to libpq correctly
Product: Red Hat Enterprise Linux 6 Reporter: Pavel Raiskup <praiskup>
Component: python-psycopg2Assignee: Pavel Raiskup <praiskup>
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.6CC: bmcclain, databases-maint, hhorak, iheim, jneedle, ovasik, praiskup, tdosek
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-25 08:09:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 811234, 1070830, 1159820    
Attachments:
Description Flags
Proposed downstream fix.
none
Proposed downstream fix.
none
Proposed downstream fix.
none
exporting PSYCOPG2_RHEL_CONNECT_FIXUP=0 will opt-out this fix none

Description Pavel Raiskup 2013-10-18 07:15:21 UTC
Currently, if using "connect(user='user', password='PASS :')", psycopg2 module
is not able to parse 'password' parameter correctly.  Spaces and colons cause
problems and to fix that - these symbols should be properly escaped (or whole
password should be wrapped by ' symbol).

Initially created based on discussion in bug #968532.

Comment 2 Pavel Raiskup 2013-10-22 08:15:20 UTC
Created attachment 814886 [details]
Proposed downstream fix.

In the time 2.0.14 was released, the 'connect()' method was not wrapped by
python function — it was direct 'C' plugin call.  So the upstream patch
(commit 625cc1b402b33) is not usable at all for RHEL6.

Proposed patch escapes single quote characters inside parameter value of
connect() method and wraps each parameter value by single quotes.  This patch
does not make sense to send (or consult with) upstream as they are too far
from 2.0.14.

Comment 4 Pavel Raiskup 2013-10-22 08:18:48 UTC
Created attachment 814888 [details]
Proposed downstream fix.

I have uploaded bad (upstream) fix, now it is correct.

Comment 6 Pavel Raiskup 2013-10-22 08:40:17 UTC
Created attachment 814904 [details]
Proposed downstream fix.

Escape also backslashes.

Comment 12 Pavel Raiskup 2013-10-22 11:40:36 UTC
Created attachment 814946 [details]
exporting PSYCOPG2_RHEL_CONNECT_FIXUP=0 will opt-out this fix

Comment 17 Mike McCune 2016-03-28 23:21:47 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions