Re: libpq not reentrant - Mailing list pgsql-bugs

From Federico Di Gregorio
Subject Re: libpq not reentrant
Date
Msg-id 1011368807.1059.8.camel@nenya
Whole thread Raw
In response to Re: libpq not reentrant  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: libpq not reentrant  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Il ven, 2002-01-18 alle 16:35, Tom Lane ha scritto:
> Federico Di Gregorio <fog@initd.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?
>=20
> > yes. what about using crypt from DES (reentrant) if postgres is being
> > linked with it?
>=20
> Dunno, how would we detect that?  Is it any more portable than crypt_r?

./cofigure --help
...
  --with-openssl[=3DDIR]    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=20

  AC_SEARCH_LIBS(crypto,  des_crypt)

in configure.in will suffice. then:

  #ifdef HAVE_DES_CRYPT
  #define crypt des_crypt
  #endif=20

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?
>=20
> Yes.  It's all our own code, so we don't have to rely on the vagaries of
> local libraries, either.

great.

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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: libpq not reentrant
Next
From: Tom Lane
Date:
Subject: Re: libpq not reentrant