pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problem with special characters in password when using SQLDriverConnect
5+ messages / 2 participants
[nested] [flat]

* Problem with special characters in password when using SQLDriverConnect
@ 2013-05-13 14:04  Jan-Peter Seifert <Jan-Peter.Seifert@gmx.de>
  0 siblings, 1 reply; 5+ messages in thread

From: Jan-Peter Seifert @ 2013-05-13 14:04 UTC (permalink / raw)
  To: pgsql-odbc


Hello,
 
if you use SQLDriverConnect instead of SQLConnect the connection fails on special characters like ';', '(', ')' and '+'(?) within the password.
 
According to the documentation ( http://msdn.microsoft.com/en-us/library/windows/desktop/ms715433%28v=vs.85%29.aspx ) []{}(),;?*=!@  are special characters.
 
In order to pass the connection string to the driver intact you have to bracket the whole connection string ( or just the values ? - it looks like my English is not good enough for this article ).
 
There already had been a patch in 09.00.0100 but this problem obviously persists in psqlODBC 09.01.0100 Unicode. Maybe this has been patched in the ANSI version only?

Backslashes are still a problem? I wonder whether standard_conforming_strings has an effect on embedded backslashes.
 
Could you check, please?
 
Thank you very much,
 
Peter


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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Problem with special characters in password when using SQLDriverConnect
@ 2013-05-15 15:31  Hiroshi Inoue <inoue@tpf.co.jp>
  parent: Jan-Peter Seifert <Jan-Peter.Seifert@gmx.de>
  0 siblings, 1 reply; 5+ messages in thread

From: Hiroshi Inoue @ 2013-05-15 15:31 UTC (permalink / raw)
  To: Jan-Peter Seifert <Jan-Peter.Seifert@gmx.de>; +Cc: pgsql-odbc

Hi,

(2013/05/13 23:04), Jan-Peter Seifert wrote:
>
> Hello,
>
> if you use SQLDriverConnect instead of SQLConnect the connection fails on special characters like ';', '(', ')' and '+'(?) within the password.
>
> According to the documentation ( http://msdn.microsoft.com/en-us/library/windows/desktop/ms715433%28v=vs.85%29.aspx ) []{}(),;?*=!@  are special characters.
>
> In order to pass the connection string to the driver intact you have to bracket the whole connection string ( or just the values ? - it looks like my English is not good enough for this article ).
>
> There already had been a patch in 09.00.0100 but this problem obviously persists in psqlODBC 09.01.0100 Unicode. Maybe this has been patched in the ANSI version only?

I don't understand why ANSI drivers work.
Could you please try the dll on testing for 9.1.0300 at
   http://www.ne.jp/asahi/inocchichichi/entrance/psqlodbc/index.html
?

regards,
Hiroshi Inoue


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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Problem with special characters in password when using SQLDriverConnect
@ 2013-05-16 13:48  Jan-Peter Seifert <Jan-Peter.Seifert@gmx.de>
  parent: Hiroshi Inoue <inoue@tpf.co.jp>
  0 siblings, 1 reply; 5+ messages in thread

From: Jan-Peter Seifert @ 2013-05-16 13:48 UTC (permalink / raw)
  To: Hiroshi Inoue <inoue@tpf.co.jp>; +Cc: pgsql-odbc


Hello,

> Gesendet: Mittwoch, 15. Mai 2013 um 17:31 Uhr
> Von: "Hiroshi Inoue" <inoue@tpf.co.jp>

> There already had been a patch in 09.00.0100 but this problem obviously persists in psqlODBC 09.01.0100 Unicode. Maybe this has been patched in the ANSI version only?

> I don't understand why ANSI drivers work.

That this has been fixed in the ANSI version only was just an assumption on my side, because the sudden increase of the 'known critical' characters seemed to be connected to the switch to the Unicode version of psqlODBC.
It looks like the Unicode and the ANSI version use the 'same' internal functions though?

> Could you please try the dll on testing for 9.1.0300 at
> http://www.ne.jp/asahi/inocchichichi/entrance/psqlodbc/index.html

Thank you very much for the patch!

We tested several passwords in connection with the SQLDriverConnect function and the Unicode version of psqlODBC:

password: %2  (two chars!)
submitted as:
…;UID=user;PWD=%2;                fails
…;UID=user;PWD={%2};              works

password: %25  (three chars!)
…;UID=user;PWD=%25;               fails
…;UID=user;PWD={%25};            works

password: }{
…;UID=user;PWD={}{};            fails

password: abc
…;UID=user;PWD=abc;               works (as expected)
…;UID=user;PWD={abc};              works

Password: a;bc
…;UID=user;PWD=a;bc;               fails (as expected)
…;UID=user;PWD={a;bc};             works

Best regards,

Peter


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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Problem with special characters in password when using SQLDriverConnect
@ 2013-05-16 14:58  Hiroshi Inoue <inoue@tpf.co.jp>
  parent: Jan-Peter Seifert <Jan-Peter.Seifert@gmx.de>
  0 siblings, 1 reply; 5+ messages in thread

From: Hiroshi Inoue @ 2013-05-16 14:58 UTC (permalink / raw)
  To: Jan-Peter Seifert <Jan-Peter.Seifert@gmx.de>; +Cc: pgsql-odbc

Hi,

(2013/05/16 22:48), Jan-Peter Seifert wrote:
>
> Hello,
>
>> Gesendet: Mittwoch, 15. Mai 2013 um 17:31 Uhr
>> Von: "Hiroshi Inoue" <inoue@tpf.co.jp>
>
>> There already had been a patch in 09.00.0100 but this problem obviously persists in psqlODBC 09.01.0100 Unicode. Maybe this has been patched in the ANSI version only?
>
>> I don't understand why ANSI drivers work.
>
> That this has been fixed in the ANSI version only was just an assumption on my side, because the sudden increase of the 'known critical' characters seemed to be connected to the switch to the Unicode version of psqlODBC.
> It looks like the Unicode and the ANSI version use the 'same' internal functions though?

Yes it's essentially the same code.

>> Could you please try the dll on testing for 9.1.0300 at
>> http://www.ne.jp/asahi/inocchichichi/entrance/psqlodbc/index.html
>
> Thank you very much for the patch!
>
> We tested several passwords in connection with the SQLDriverConnect function and the Unicode version of psqlODBC:
>
> password: %2  (two chars!)
> submitted as:
> …;UID=user;PWD=%2;                fails
> …;UID=user;PWD={%2};              works
>
> password: %25  (three chars!)
> …;UID=user;PWD=%25;               fails
> …;UID=user;PWD={%25};            works

The psqlodbc driver expects Percent-Encoding for the password
option as well as the *Connect Settings* option unless the value
is enclosed with braces.

> password: }{
> …;UID=user;PWD={}{};            fails

The driver can't distinguish the first '}' from the terminating bracket.
Please look at http://msdn.microsoft.com/en-us/library/ms130822.aspx .

> password: abc
> …;UID=user;PWD=abc;               works (as expected)
> …;UID=user;PWD={abc};              works
>
> Password: a;bc
> …;UID=user;PWD=a;bc;               fails (as expected)
> …;UID=user;PWD={a;bc};             works
>
> Best regards,
>
> Peter


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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Problem with special characters in password when using SQLDriverConnect
@ 2013-05-19 19:44  Jan-Peter Seifert <Jan-Peter.Seifert@gmx.de>
  parent: Hiroshi Inoue <inoue@tpf.co.jp>
  0 siblings, 0 replies; 5+ messages in thread

From: Jan-Peter Seifert @ 2013-05-19 19:44 UTC (permalink / raw)
  To: Hiroshi Inoue <inoue@tpf.co.jp>; +Cc: pgsql-odbc

Hello,

Am 16.05.2013 16:58, schrieb Hiroshi Inoue:

> The driver can't distinguish the first '}' from the terminating bracket.
> Please look at http://msdn.microsoft.com/en-us/library/ms130822.aspx .

thank you very much for the link!
We weren't sure whether always enclosing the password in curly braces
would be okay. We'll do so in the future then.

So I guess the hex encoding was the password patch in v09.00.0100.

We switched from v08.04.0200 so I guess it really was just a coincidence
that other new characters caused the same problem when switching to
Unicode 'later on'.

Thank you very much and sorry for the confusion!

Best regards,

Peter





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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2013-05-19 19:44 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-05-13 14:04 Problem with special characters in password when using SQLDriverConnect Jan-Peter Seifert <Jan-Peter.Seifert@gmx.de>
2013-05-15 15:31 ` Hiroshi Inoue <inoue@tpf.co.jp>
2013-05-16 13:48   ` Jan-Peter Seifert <Jan-Peter.Seifert@gmx.de>
2013-05-16 14:58     ` Hiroshi Inoue <inoue@tpf.co.jp>
2013-05-19 19:44       ` Jan-Peter Seifert <Jan-Peter.Seifert@gmx.de>

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