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