[postmodern-devel] [patch] Erratic behavior when NIL password is given

Marijn Haverbeke marijnh at gmail.com
Tue Apr 6 17:39:38 UTC 2010


Hello J.P.,

> I usually use host-based authentication with ident to connect to
> PostgreSQL from trusted machines, so I've been specifying a password
> of NIL for a long time.  However, when passwordless authentication
> fails and NIL is given as a password, POSTMODERN:CONNECT will behave
> erratically.

Hm, yes, I really shouldn't be passing un-type-checked parameters to
functions compiled at (safety 0).

I've applied a patch that adds your check-type forms, and made a
change to allow NIL as password (the authentication code will raise an
error when the server demands a password and none was given).

I did not apply the full doc changes you submitted. I can see the
value of thoroughness, but I think telling people that a usename
should be a string etc. seems a superfluous (especially when it has to
be done four times -- two docstrings and two html documents)

> I also humbly suggest not optimizing for safety 0.

I see your point, yet when I profiled postmodern (back in 2007, on
SBCL, not sure if this still holds) the speed difference between
(safety 1) and (safety 0) was very significant (25% range, if I
remember correctly). Memory safety in a chaotically-typed language
like CL means a *lot* of checks. Feel free to run some benchmarks
again, and see what you get (my benchmark consisted of inserting a lot
of data, and making queries that returned huge result sets).

Best,
Marijn




More information about the postmodern-devel mailing list