Re: DBD::Pg 0.96 and DBI 1.15 ignoring username and password - Mailing list pgsql-interfaces

From Giles Lean
Subject Re: DBD::Pg 0.96 and DBI 1.15 ignoring username and password
Date
Msg-id 17239.987296366@nemeton.com.au
Whole thread Raw
In response to DBD::Pg 0.96 and DBI 1.15 ignoring username and password  ("Brett W. McCoy" <bmccoy@chapelperilous.net>)
Responses Re: DBD::Pg 0.96 and DBI 1.15 ignoring username and password  ("Brett W. McCoy" <bmccoy@chapelperilous.net>)
List pgsql-interfaces
> 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,



pgsql-interfaces by date:

Previous
From: Lonnie Cumberland
Date:
Subject: Re: cpp Makefiles
Next
From: Tom Lane
Date:
Subject: Re: [SQL] g++ not working for postgresql extension languages?