Re: libpq not reentrant

From: Federico Di Gregorio <fog(at)initd(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: libpq not reentrant
Date: 2002-01-18 15:46:47
Message-ID: 1011368807.1059.8.camel@nenya
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Il ven, 2002-01-18 alle 16:35, Tom Lane ha scritto:
> Federico Di Gregorio <fog(at)initd(dot)org> writes:
> >> Given that as of 7.2, MD5 is the preferred password encryption method
> >> and crypt() is deprecated, I'm not inclined to spend a lot of work
> >> trying to develop a bulletproof autoconf procedure for making crypt
> >> re-entrant. I'm strongly inclined to just document the problem and
> >> leave it at that. Comments?
>
> > yes. what about using crypt from DES (reentrant) if postgres is being
> > linked with it?
>
> Dunno, how would we detect that? Is it any more portable than crypt_r?

./cofigure --help
...
--with-openssl[=DIR] build with OpenSSL support [/usr/local/ssl]

so the right library is already detected. the function is called
des_crypt and is completely compatible with std. i think that a

AC_SEARCH_LIBS(crypto, des_crypt)

in configure.in will suffice. then:

#ifdef HAVE_DES_CRYPT
#define crypt des_crypt
#endif

in the right file will do the trick. (i know this is not a real patch,
sorry. i can make one later at home if you need.)

> Is it worth the trouble?

i don't know if other drivers/applications have an aggressive
multithreaded approach as psycopg has, but if they do, yes, it is worth,
imo. if psycopg is the only one, no, because i will fix the problem in
it.

> > is the MD5 stuff reentrant?
>
> Yes. It's all our own code, so we don't have to rely on the vagaries of
> local libraries, either.

great.

--
Federico Di Gregorio
Debian GNU/Linux Developer & Italian Press Contact fog(at)debian(dot)org
INIT.D Developer fog(at)initd(dot)org
All'inizio ho scritto un programma proprietario, in esclusiva per il
cliente; è stato tristissimo, perchè mi ha succhiato un pezzo di
anima. -- Alessandro Rubini

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2002-01-18 16:04:08 Re: libpq not reentrant
Previous Message Tom Lane 2002-01-18 15:35:23 Re: libpq not reentrant