Re: DBD::Pg 0.96 and DBI 1.15 ignoring username and password

From: Giles Lean <giles(at)nemeton(dot)com(dot)au>
To: "Brett W(dot) McCoy" <bmccoy(at)chapelperilous(dot)net>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: DBD::Pg 0.96 and DBI 1.15 ignoring username and password
Date: 2001-04-15 00:59:26
Message-ID: 17239.987296366@nemeton.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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,

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2001-04-15 01:08:17 Re: [SQL] g++ not working for postgresql extension languages?
Previous Message Lonnie Cumberland 2001-04-15 00:53:26 Re: cpp Makefiles