pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
DBD::Pg 0.96 and DBI 1.15 ignoring username and password
5+ messages / 3 participants
[nested] [flat]

* DBD::Pg 0.96 and DBI 1.15 ignoring username and password
@ 2001-04-15 00:41 Brett W. McCoy <bmccoy@chapelperilous.net>
  2001-04-15 00:59 ` Re: DBD::Pg 0.96 and DBI 1.15 ignoring username and password Giles Lean <giles@nemeton.com.au>
  2001-04-16 01:46 ` Re: DBD::Pg 0.96 and DBI 1.15 ignoring username and password Mark Stosberg <mark@summersault.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Brett W. McCoy @ 2001-04-15 00:41 UTC (permalink / raw)
  To: pgsql-interfaces; dbi-users@perl.org

I've just upgraded to DBD::Pg 0.96 and DBI 1.15, and now every script I
have that uses DBI gives me this error:

1.15 at ./dbi-test line 6
Use of uninitialized value in subroutine entry at
/usr/local/lib/perl5/site_perl/5.6.0/i586-linux/DBD/Pg.pm line 94.
Use of uninitialized value in subroutine entry at
/usr/local/lib/perl5/site_perl/5.6.0/i586-linux/DBD/Pg.pm line 94.
DBI->connect(dbname=cp) failed: fe_sendauth: no password supplied at
./dbi-test line 8

The test.pl script used in the DBD 'make test' also failed with this
error.  I have not changed anything in my PostgreSQL (7.1beta3) setup or
in my scripts.

I have password authentication set for local users, and do have $PGHOST
set accordingly.  Logging into psql works fine, but all of my Perl DBI
scripts are failing.

Here is a test program that is causing this error (the real user name and
password are changed):

#!/usr/local/bin/perl -w

use strict;
use DBI;

warn $DBI::VERSION;

my $dbh = DBI->connect('DBI:Pg:dbname=cp', 'user', 'passwd') or DBI-errstr;

$dbh->disconnect();

This gives the error output above also.

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?

-- Brett
				   http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
Adapt.  Enjoy.  Survive.




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: DBD::Pg 0.96 and DBI 1.15 ignoring username and password
  2001-04-15 00:41 DBD::Pg 0.96 and DBI 1.15 ignoring username and password Brett W. McCoy <bmccoy@chapelperilous.net>
@ 2001-04-15 00:59 ` Giles Lean <giles@nemeton.com.au>
  2001-04-15 04:20   ` Re: DBD::Pg 0.96 and DBI 1.15 ignoring username and password Brett W. McCoy <bmccoy@chapelperilous.net>
  1 sibling, 1 reply; 5+ messages in thread

From: Giles Lean @ 2001-04-15 00:59 UTC (permalink / raw)
  To: Brett W. McCoy <bmccoy@chapelperilous.net>; +Cc: 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

inline patch 1: DBD-Pg-0.96/Pg.pm (+4/-5 lines) download inline-1.patch*** 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,
^ permalink raw reply [nested|flat] 5+ messages in thread

* Re: DBD::Pg 0.96 and DBI 1.15 ignoring username and password
  2001-04-15 00:41 DBD::Pg 0.96 and DBI 1.15 ignoring username and password Brett W. McCoy <bmccoy@chapelperilous.net>
  2001-04-15 00:59 ` Re: DBD::Pg 0.96 and DBI 1.15 ignoring username and password Giles Lean <giles@nemeton.com.au>
@ 2001-04-15 04:20   ` Brett W. McCoy <bmccoy@chapelperilous.net>
  0 siblings, 0 replies; 5+ messages in thread

From: Brett W. McCoy @ 2001-04-15 04:20 UTC (permalink / raw)
  To: Giles Lean <giles@nemeton.com.au>; +Cc: pgsql-interfaces

On Sun, 15 Apr 2001, Giles Lean wrote:

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

Great!  Worked fine.  Thanks!

-- Brett
				   http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
"Floggings will continue until morale improves."
-- anonymous flyer being distributed at Exxon USA




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: DBD::Pg 0.96 and DBI 1.15 ignoring username and password
  2001-04-15 00:41 DBD::Pg 0.96 and DBI 1.15 ignoring username and password Brett W. McCoy <bmccoy@chapelperilous.net>
@ 2001-04-16 01:46 ` Mark Stosberg <mark@summersault.com>
  2001-04-16 01:56   ` Re: DBD::Pg 0.96 and DBI 1.15 ignoring username and password Brett W. McCoy <bmccoy@chapelperilous.net>
  1 sibling, 1 reply; 5+ messages in thread

From: Mark Stosberg @ 2001-04-16 01:46 UTC (permalink / raw)
  To: Brett W. McCoy <bmccoy@chapelperilous.net>; +Cc: pgsql-interfaces; dbi-users@perl.org


Brett,

  I believe this due to a bug in DBD::Pg .96. See the recent thread on
the dbi-users list entitled:
  
 "bug in DBD::Pg .96-- connect user mishandled?"

A patch is in the works, and a workaround seems to be to use
$ENV{DBI_USER} and $ENV{DBI_PASS} to set the username and password,
which seem to be respected appropriately. 

   -mark

"Brett W. McCoy" wrote:
> 
> I've just upgraded to DBD::Pg 0.96 and DBI 1.15, and now every script I
> have that uses DBI gives me this error:
> 
> 1.15 at ./dbi-test line 6
> Use of uninitialized value in subroutine entry at
> /usr/local/lib/perl5/site_perl/5.6.0/i586-linux/DBD/Pg.pm line 94.
> Use of uninitialized value in subroutine entry at
> /usr/local/lib/perl5/site_perl/5.6.0/i586-linux/DBD/Pg.pm line 94.
> DBI->connect(dbname=cp) failed: fe_sendauth: no password supplied at
> ./dbi-test line 8
> 
> The test.pl script used in the DBD 'make test' also failed with this
> error.  I have not changed anything in my PostgreSQL (7.1beta3) setup or
> in my scripts.
> 
> I have password authentication set for local users, and do have $PGHOST
> set accordingly.  Logging into psql works fine, but all of my Perl DBI
> scripts are failing.
> 
> Here is a test program that is causing this error (the real user name and
> password are changed):
> 
> #!/usr/local/bin/perl -w
> 
> use strict;
> use DBI;
> 
> warn $DBI::VERSION;
> 
> my $dbh = DBI->connect('DBI:Pg:dbname=cp', 'user', 'passwd') or DBI-errstr;
> 
> $dbh->disconnect();
> 
> This gives the error output above also.
> 
> 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?
> 
> -- Brett
>                                    http://www.chapelperilous.net/btfwk/
> ------------------------------------------------------------------------
> Adapt.  Enjoy.  Survive.

-- 

http://mark.stosberg.com/



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: DBD::Pg 0.96 and DBI 1.15 ignoring username and password
  2001-04-15 00:41 DBD::Pg 0.96 and DBI 1.15 ignoring username and password Brett W. McCoy <bmccoy@chapelperilous.net>
  2001-04-16 01:46 ` Re: DBD::Pg 0.96 and DBI 1.15 ignoring username and password Mark Stosberg <mark@summersault.com>
@ 2001-04-16 01:56   ` Brett W. McCoy <bmccoy@chapelperilous.net>
  0 siblings, 0 replies; 5+ messages in thread

From: Brett W. McCoy @ 2001-04-16 01:56 UTC (permalink / raw)
  To: Mark Stosberg <mark@summersault.com>; +Cc: pgsql-interfaces; dbi-users@perl.org

On Sun, 15 Apr 2001, Mark Stosberg wrote:

>   I believe this due to a bug in DBD::Pg .96. See the recent thread on
> the dbi-users list entitled:
>
>  "bug in DBD::Pg .96-- connect user mishandled?"
>
> A patch is in the works, and a workaround seems to be to use
> $ENV{DBI_USER} and $ENV{DBI_PASS} to set the username and password,
> which seem to be respected appropriately.

Yes, I received the patch yesterday, as a matter of fact.

Still can't get selectrow_hashref to work, though. :-)

-- Brett
				   http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
HELLO KITTY gang terrorizes town, family STICKERED to death!




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2001-04-16 01:56 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-04-15 00:41 DBD::Pg 0.96 and DBI 1.15 ignoring username and password Brett W. McCoy <bmccoy@chapelperilous.net>
2001-04-15 00:59 ` Giles Lean <giles@nemeton.com.au>
2001-04-15 04:20   ` Brett W. McCoy <bmccoy@chapelperilous.net>
2001-04-16 01:46 ` Mark Stosberg <mark@summersault.com>
2001-04-16 01:56   ` Brett W. McCoy <bmccoy@chapelperilous.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox