From rhair@bowmansystems.com Mon Oct 16 23:14:13 2006 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-- From inoue@tpf.co.jp Tue Oct 17 16:35:21 2006 Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id D38EF9FB550 for ; Tue, 17 Oct 2006 13:35:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 40881-03-2 for ; Tue, 17 Oct 2006 13:35:11 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by postgresql.org (Postfix) with SMTP id 3E6E49FB56F for ; Tue, 17 Oct 2006 13:13:48 -0300 (ADT) Received: (qmail 22833 invoked from network); 18 Oct 2006 01:13:46 +0900 X-Authentication: inoue was authenticated by ftp.tpf.co.jp at 18 Oct 2006 01:13:46 +0900 Received: from unknown (HELO ?192.168.11.2?) (219.61.40.6) by ftp.tpf.co.jp with SMTP; 18 Oct 2006 01:13:46 +0900 Message-ID: <45350139.4080408@tpf.co.jp> Date: Wed, 18 Oct 2006 01:13:45 +0900 From: Hiroshi Inoue User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: Rick Hair CC: pgsql-odbc@postgresql.org Subject: Re: Username and password from DSN being overwritten (fix References: <005301c6f176$4e4111c0$1103000a@RickHair> In-Reply-To: <005301c6f176$4e4111c0$1103000a@RickHair> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.02 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200610/46 X-Sequence-Number: 8309 Rick Hair wrote: > 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. > > ! if (cbUID > 0) > > ! make_string(szUID, cbUID, ci->username, sizeof(ci->username)); > > ! if (cbAuthStr > 0) > > ! make_string(szAuthStr, cbAuthStr, ci->password, > sizeof(ci->password)); > The above patch seems to be wrong because cbUID(cvAuthStr) can be SQL_NTS. OK I would take care of this case. Please try the snapshot dll at http://www.geocities.jp/inocchichichi/psqlodbc/index.html . regards, Hiroshi Inoue From rhair@bowmansystems.com Thu Oct 19 13:30:29 2006 Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 80CF49FA376 for ; Thu, 19 Oct 2006 10:30:29 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 81771-09 for ; Thu, 19 Oct 2006 10:30:25 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id DE03B9FA332 for ; Thu, 19 Oct 2006 10:30:24 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 5F504308E7; Thu, 19 Oct 2006 15:30:23 +0200 (MET DST) From: rhair@bowmansystems.com X-Newsgroups: pgsql.interfaces.odbc Subject: Re: Username and password from DSN being overwritten (fix Date: 19 Oct 2006 06:30:16 -0700 Organization: http://groups.google.com Lines: 23 Message-ID: <1161264616.511206.309370@m73g2000cwd.googlegroups.com> References: <005301c6f176$4e4111c0$1103000a@RickHair> <45350139.4080408@tpf.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Complaints-To: groups-abuse@google.com User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: m73g2000cwd.googlegroups.com; posting-host=65.166.193.11; posting-account=_Tis5Q0AAAAINTIyDLtO80rCu6aT1_q3 To: pgsql-odbc@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.961 tagged_above=0 required=5 tests=NO_REAL_NAME X-Spam-Level: X-Archive-Number: 200610/53 X-Sequence-Number: 8316 That did the trick; Business Objects seems to be working fine with the new snapshot. Thanks, Rick Hair Hiroshi Inoue wrote: > > The above patch seems to be wrong because cbUID(cvAuthStr) can be SQL_NTS. > OK I would take care of this case. > Please try the snapshot dll at > http://www.geocities.jp/inocchichichi/psqlodbc/index.html > . > > regards, > Hiroshi Inoue > > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match