Peter Eisentraut <e99re41@DoCS.UU.SE> writes:
> The assumption that the old password can be reused between
> password connections seems pretty unwise.

I think it's OK, and a useful convenience, if you are reconnecting with
the same username as before.  What I had in mind was to discard the
prior password if the \connect command specifies a username.

			regards, tom lane

Tue, 23 May 2000 10:13:50 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Serious problem within authentication subsystem in 7.0 
Tom Lane writes:

> > The assumption that the old password can be reused between
> > password connections seems pretty unwise.
> 
> I think it's OK, and a useful convenience, if you are reconnecting with
> the same username as before.  What I had in mind was to discard the
> prior password if the \connect command specifies a username.

But if you have different passwords between databases then you are still
having the same problem, only at a different scale.

-- 
Peter Eisentraut                  Sernanders vï¿½g 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


Tue, 23 May 2000 23:39:20 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: Serious problem within authentication subsystem in
 7.0
Peter Eisentraut <peter_e@gmx.net> writes:
> But if you have different passwords between databases then you are still
> having the same problem, only at a different scale.

... which we do not have, at the moment; there's one password per user
per installation, and since psql's \connect doesn't allow reconnection
to a different postmaster (does it?) the same password should still work.
Unless it's been changed meanwhile, I suppose.

In any case, isn't psql's logic such that it will prompt again if the
previous password doesn't work?  I'd hate to think I only get one try to
enter my password correctly...

			regards, tom lane

Tue, 23 May 2000 18:19:38 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Serious problem within authentication subsystem in 7.0 
Tom Lane writes:

> Peter Eisentraut <peter_e@gmx.net> writes:
> > But if you have different passwords between databases then you are still
> > having the same problem, only at a different scale.
> 
> ... which we do not have, at the moment; there's one password per user
> per installation,

No, pg_hba.conf allows per database passwords.

> In any case, isn't psql's logic such that it will prompt again if the
> previous password doesn't work?

No, it will only prompt you for a password if it notices one is required.
If that's wrong the connection attempt fails and you can try again (to
connect). That's reasonable enough I think.


-- 
Peter Eisentraut                  Sernanders vï¿½g 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


Wed, 24 May 2000 23:50:39 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: Serious problem within authentication subsystem in
 7.0
Peter Eisentraut <peter_e@gmx.net> writes:
>> ... which we do not have, at the moment; there's one password per user
>> per installation,

> No, pg_hba.conf allows per database passwords.

Oh you're right, I had forgotten about that barely-supported hack for
alternate password files.

>> In any case, isn't psql's logic such that it will prompt again if the
>> previous password doesn't work?

> No, it will only prompt you for a password if it notices one is required.
> If that's wrong the connection attempt fails and you can try again (to
> connect). That's reasonable enough I think.

Seems like if it inserts the old password and notices that the error is
'bogus password' then it should prompt you for a new one.

BTW, I notice that there seems to be a nasty portability bug in that
logic: it'll try to "free(prompted_password)" even if prompted_password
is NULL.  On a lot of systems that's a recipe for a coredump, or at
least used to be (is everyone ANSI enough now to get this right??)

			regards, tom lane

Wed, 24 May 2000 18:07:27 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Serious problem within authentication subsystem in 7.0 