pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan-Peter Seifert <Jan-Peter.Seifert@gmx.de>
To: pgsql-odbc@postgresql.org
Subject: PGAPI_DriverConnect fails if password contains semicolon
Date: Fri, 12 Mar 2010 13:23:26 +0100
Message-ID: <20100312122326.146690@gmx.net> (raw)

Hello,

we are using a call to SQLConnect in our app to connect via ODBC to our databases. A third party tool that is being called by our app is using SQLDriverConnect.
If the user's password contains a ';' the connection with our app is still successful, but the connection with the third party tool fails. It seems that the password/DSN gets truncated at the semicolon in/for function PGAPI_DriverConnect.

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

fails:
.
.
.
conn=04AA7120, PGAPI_DriverConnect( in)='DSN=test_db;UID=test_user;PWD=xxx;',
fDriverCompletion=0
DSN info:
DSN='test_db',server='localhost',port='5432',dbase='test_db',user='test_user',passwd='xxxxx'
         
onlyread='0',protocol='7.4',showoid='0',fakeoidindex='0',showsystable='1'
          conn_settings='', conn_encoding='(null)'
          translation_dll='',translation_option=''
Driver Version='08.04.0200,200912260001' linking 1500 static Multithread
library
Global Options: fetch=100, socket=4096, unknown_sizes=0,
max_varchar_size=32766, max_longvarchar_size=32766
                disable_optimizer=0, ksqo=1, unique_index=1, use_declarefetch=1
                text_as_longvarchar=1, unknowns_as_longvarchar=0,
bools_as_char=1 NAMEDATALEN=64
                extra_systable_prefixes='dd_;', conn_settings=''
conn_encoding=''
CONN ERROR: func=LIBPQ_connect, desc='', errnum=101, errmsg='FATAL:  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 server's standard_conforming_strings setting.

Check into this, please.

Thank you very much,

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



Message-ID: <20100312122326.146690@gmx.net>
Permalink:  ../20100312122326.146690@gmx.net/
Also on:    postgresql.org/message-id/20100312122326.146690@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: Jan-Peter.Seifert@gmx.de
  Subject: Re: PGAPI_DriverConnect fails if password contains semicolon
  In-Reply-To: <20100312122326.146690@gmx.net>
  References: <20100312122326.146690@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox