Received: from nemeton.com.au (202-76-170-92.ppp.dialup.net.au [202.76.170.92] (may be forged)) by postgresql.org (8.11.3/8.11.1) with SMTP id f3F10Yu72754 for ; Sat, 14 Apr 2001 21:00:35 -0400 (EDT) (envelope-from giles@nemeton.com.au) Received: (qmail 17241 invoked from network); 15 Apr 2001 00:59:26 -0000 Received: from nemeton.com.au (203.8.3.33) by nemeton.com.au with SMTP; 15 Apr 2001 00:59:26 -0000 To: "Brett W. McCoy" cc: pgsql-interfaces@postgresql.org Subject: Re: DBD::Pg 0.96 and DBI 1.15 ignoring username and password In-Reply-To: Message from "Brett W. McCoy" of "Sat, 14 Apr 2001 20:41:09 -0400." Date: Sun, 15 Apr 2001 10:59:26 +1000 Message-ID: <17239.987296366@nemeton.com.au> From: Giles Lean X-Archive-Number: 200104/37 X-Sequence-Number: 1420 > If I change pg_hba.conf to 'trust' on localhost, (and unset $PGHOST) and I > run the same script, it tells me that 'bmccoy' (who I am logged in as) > does not exist as a user (which is true). It looks like the user and > password fields are being completely ignored by DBD::Pg. > > What happened? New bug introduced. Here's an (unofficial) fix. I just sent it to the dbi-users list and Edmund Mergl in reply to a message on the dbi-users list, so I've dropped that list from this reply. Regards, Giles *** DBD-Pg-0.96/Pg.pm-orig Tue Apr 10 03:44:18 2001 --- DBD-Pg-0.96/Pg.pm Sun Apr 15 10:26:16 2001 *************** *** 79,89 **** $Name =~ s/^.*dbname\s*=\s*//; $Name =~ s/\s*;.*$//; ! $user = "" unless defined($user); ! $auth = "" unless defined($auth); ! ! $user = $ENV{DBI_USER} unless $user eq ""; ! $auth = $ENV{DBI_PASS} unless $auth eq ""; my($dbh) = DBI::_new_dbh($drh, { 'Name' => $Name, --- 79,88 ---- $Name =~ s/^.*dbname\s*=\s*//; $Name =~ s/\s*;.*$//; ! $user ||= $ENV{DBI_USER}; ! $auth ||= $ENV{DBI_PASS}; ! $user ||= ""; ! $auth ||= ""; my($dbh) = DBI::_new_dbh($drh, { 'Name' => $Name,