Re: [HACKERS] User authentication bug?

From: Maarten Boekhold <maartenb(at)dutepp0(dot)et(dot)tudelft(dot)nl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: M(dot)Boekhold(at)ITS(dot)TUDelft(dot)NL, pgsql-hackers(at)postgreSQL(dot)org, pgsql-interfaces(at)postgreSQL(dot)org, pgsql-patches(at)postgreSQL(dot)org
Subject: Re: [HACKERS] User authentication bug?
Date: 1998-08-02 11:42:29
Message-ID: Pine.SUN.3.91.980802134014.5727A-100000@dutepp0.et.tudelft.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

On Sat, 1 Aug 1998, Tom Lane wrote:

> Maarten Boekhold <maartenb(at)dutepp2(dot)et(dot)tudelft(dot)nl> writes:
> > OK, I now know what's going on, at least at my home (I had this problem
> > on another server, dunno if it's caused by the same thing):
> > I had a password longer than 8 characters in pg_shadow.
> > when creating a user, postgres happily accepts more than 8 chars, and
> > also stores them. apparently libpq-fe (or psql, dunno) only sends 8
> > chars.
>
> It's not libpq's fault (at least not with the current sources).
> It's psql's. psql.c had a hardwired limit of 8 characters on
> both the username and the password. Ick.
>
> With the attached patch, I have verified that long (> 8char anyway)
> usernames and passwords work correctly in both "password" and "crypt"
> authorization mode. NOTE: at least on my machine, it seems that the
> crypt() routines ignore the part of the password beyond 8 characters,
> so there's no security gain from longer passwords in crypt auth mode.
> But they don't fail.
....
>
> It's possible that there are still bogus length limits on username
> or password in some of the other PostgreSQL user interfaces besides
> psql/libpq. I will leave it to other folks to check that code.

I think the perl-module behaves the same, but I'm not totally sure about
it. I have a script where passing a 9 chars username to PQconnectdb()
fails to connect to a backend, while if I truncate the username to 8
chars it works.

Maarten

_____________________________________________________________________________
| TU Delft, The Netherlands, Faculty of Information Technology and Systems |
| Department of Electrical Engineering |
| Computer Architecture and Digital Technique section |
| M(dot)Boekhold(at)et(dot)tudelft(dot)nl |
-----------------------------------------------------------------------------

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 1998-08-02 13:27:56 Re: [HACKERS] MULTIBYE typo ?
Previous Message Dr. Michael Meskes 1998-08-02 11:39:13 Re: Dropping tables...

Browse pgsql-interfaces by date

  From Date Subject
Next Message Thomas G. Lockhart 1998-08-02 14:51:37 Re: [INTERFACES] psqlodbc
Previous Message Bob Taylor. 1998-08-02 08:33:50 subscribe