Username and password from DSN being overwritten (fix included)
am 17.10.2006 00:56:24 von Rick HairThis is a multi-part message in MIME format.
------=_NextPart_000_0054_01C6F14C.656D7AC0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Hi all,
I ran into a problem recently trying to use the latest CVS version of the
ODBC driver with Business Objects XI Release 2. The username and password
specified for a connection in the ODBC setup panel were being ignored by the
driver. I discovered that after some recent changes to the make_string()
function in misc.c, the DSN defaults were always being overwritten by
whatever username and password were passed to PGAPI_Connect(), even if they
were empty strings.
Below is a (very small) patch to connection.c to work around the issue.
Thanks,
Rick Hair
*** psqlodbc.old/connection.c 2006-10-13 08:13:31.000000000 -0500
--- psqlodbc.new/connection.c 2006-10-16 17:09:31.000000000 -0500
***************
*** 127,134 ****
* override values from DSN info with UID and authStr(pwd) This only
* occurs if the values are actually there.
*/
! make_string(szUID, cbUID, ci->username, sizeof(ci->username));
! make_string(szAuthStr, cbAuthStr, ci->password, sizeof(ci->password));
/* fill in any defaults */
getDSNdefaults(ci);
--- 127,136 ----
* override values from DSN info with UID and authStr(pwd) This only
* occurs if the values are actually there.
*/
! if (cbUID > 0)
! make_string(szUID, cbUID, ci->username, sizeof(ci->username));
! if (cbAuthStr > 0)
! make_string(szAuthStr, cbAuthStr, ci->password,
sizeof(ci->password));
/* fill in any defaults */
getDSNdefaults(ci);
------=_NextPart_000_0054_01C6F14C.656D7AC0
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
xmlns=3D"http://www.w3.org/TR/REC-html40">
charset=3Dus-ascii">
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'>Hi =
all,
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans =
Typewriter"'>
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'>I ran =
into a
problem recently trying to use the latest CVS version of the ODBC driver =
with
Business Objects XI Release 2. The username and password specified for a
connection in the ODBC setup panel were being ignored by the driver. I
discovered that after some recent changes to the make_string() function =
in
misc.c, the DSN defaults were always being overwritten by whatever =
username and
password were passed to PGAPI_Connect(), even if they were empty =
strings.
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans =
Typewriter"'>
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'>Below is =
a (very small)
patch to connection.c to work around the =
issue.
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans =
Typewriter"'>
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans =
Typewriter"'>Thanks,
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'>Rick =
Hair
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans =
Typewriter"'>
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans =
Typewriter"'>
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans =
Typewriter"'>
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'>***
psqlodbc.old/connection.c 2006-10-13 08:13:31.000000000 =
-0500
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'>---
psqlodbc.new/connection.c 2006-10-16 17:09:31.000000000 =
-0500
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans =
Typewriter"'>***************
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'>*** =
127,134 ****
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'> =
*
override values from DSN info with UID and authStr(pwd) This =
only
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'> =
*
occurs if the values are actually there.
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'> =
*/
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'>! =
make_string(szUID,
cbUID, ci->username, =
sizeof(ci->username));
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'>! =
make_string(szAuthStr,
cbAuthStr, ci->password, =
sizeof(ci->password));
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'> =
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'> =
/*
fill in any defaults */
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'> =
getDSNdefaults(ci);
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'>--- =
127,136 ----
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'> =
*
override values from DSN info with UID and authStr(pwd) This =
only
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'> =
*
occurs if the values are actually there.
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'> =
*/
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'>! =
if
(cbUID > 0)
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'>! =
=
make_string(szUID,
cbUID, ci->username, =
sizeof(ci->username));
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'>! =
if
(cbAuthStr > 0)
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'>! =
=
make_string(szAuthStr,
cbAuthStr, ci->password, =
sizeof(ci->password));
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'> =
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'> =
/*
fill in any defaults */
Typewriter">
style=3D'font-size:10.0pt;font-family:"Lucida Sans Typewriter"'> =
getDSNdefaults(ci);
------=_NextPart_000_0054_01C6F14C.656D7AC0--