Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 40E809FA6B3 for ; Mon, 16 Oct 2006 20:14:13 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 95127-03 for ; Mon, 16 Oct 2006 23:14:07 +0000 (UTC) X-Greylist: delayed 00:17:01.478356 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id B08059FB29F for ; Mon, 16 Oct 2006 20:14:06 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from www.bowmansystems.com (www.bowmansystems.com [65.166.193.20]) by svr4.postgresql.org (Postfix) with ESMTP id 11D0C5AF898 for ; Mon, 16 Oct 2006 22:57:04 +0000 (GMT) Received: from RickHair (unknown [65.166.193.11]) by www.bowmansystems.com (Postfix) with ESMTP id 53ED5D932 for ; Mon, 16 Oct 2006 17:56:59 -0500 (CDT) From: "Rick Hair" To: Subject: Username and password from DSN being overwritten (fix included) Date: Mon, 16 Oct 2006 17:56:24 -0500 Message-ID: <005301c6f176$4e4111c0$1103000a@RickHair> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0054_01C6F14C.656D7AC0" X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 Thread-Index: Acbxdk4akxEn/ArETVCqB+5mtJA0tQ== X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.293 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, HTML_MESSAGE, SPF_SOFTFAIL X-Spam-Level: *** X-Archive-Number: 200610/45 X-Sequence-Number: 8308 This 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

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--