PGAPI_DriverConnect fails if password contains semicolon

PGAPI_DriverConnect fails if password contains semicolon

am 12.03.2010 13:23:26 von Jan-Peter.Seifert

Hello,

we are using a call to SQLConnect in our app to connect via ODBC to our d=
atabases. A third party tool that is being called by our app is using SQL=
DriverConnect.
If the user's password contains a ';' the connection with our app is stil=
l successful, but the connection with the third party tool fails. It seem=
s that the password/DSN gets truncated at the semicolon in/for function P=
GAPI_DriverConnect.

successful:
..
..
..
DSN info:
DSN=3D'test_db',server=3D'localhost',port=3D'5432',dbase=3D' test_db',user=
=3D'test_user',passwd=3D'xxxxx'
=20
onlyread=3D'0',protocol=3D'7.4',showoid=3D'0',fakeoidindex=3 D'0',showsyst=
able=3D'1'
conn_settings=3D'', conn_encoding=3D'(null)'
translation_dll=3D'',translation_option=3D''
conn =3D 032C42A0, PGAPI_Connect(DSN=3D'test_db', UID=3D'test_user', PWD=3D=
'xxxxx')=20
..
..
..
-----------------------------------------------------

fails:
..
..
..
conn=3D04AA7120, PGAPI_DriverConnect( in)=3D'DSN=3Dtest_db;UID=3Dtest_use=
r;PWD=3Dxxx;',
fDriverCompletion=3D0
DSN info:
DSN=3D'test_db',server=3D'localhost',port=3D'5432',dbase=3D' test_db',user=
=3D'test_user',passwd=3D'xxxxx'
=20
onlyread=3D'0',protocol=3D'7.4',showoid=3D'0',fakeoidindex=3 D'0',showsyst=
able=3D'1'
conn_settings=3D'', conn_encoding=3D'(null)'
translation_dll=3D'',translation_option=3D''
Driver Version=3D'08.04.0200,200912260001' linking 1500 static Multithrea=
d
library
Global Options: fetch=3D100, socket=3D4096, unknown_sizes=3D0,
max_varchar_size=3D32766, max_longvarchar_size=3D32766
disable_optimizer=3D0, ksqo=3D1, unique_index=3D1, use_de=
clarefetch=3D1
text_as_longvarchar=3D1, unknowns_as_longvarchar=3D0,
bools_as_char=3D1 NAMEDATALEN=3D64
extra_systable_prefixes=3D'dd_;', conn_settings=3D''
conn_encoding=3D''
CONN ERROR: func=3DLIBPQ_connect, desc=3D'', errnum=3D101, errmsg=3D'FATA=
L: password
authentication failed for user "test_user"
..
..
..
-----------------------------------------------------------

Backslashes in the password that aren't masked by a second backslash let =
the authentication fail in both psqlODBC functions - regardless of the se=
rver's standard_conforming_strings setting.

Check into this, please.

Thank you very much,

Peter
--=20
GMX DSL: Internet, Telefon und Entertainment für nur 19,99 EUR/mtl.!
http://portal.gmx.net/de/go/dsl02

--=20
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc