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

J.P. Larocque jpl at thoughtcrime.us
Wed Apr 7 05:57:04 UTC 2010


On Tue, Apr 06, 2010 at 07:39:38PM +0200, Marijn Haverbeke wrote:
> > 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).

Thanks!  The pedantic doc changes I attached don't really fit in with
the level of detail in the Postmodern HTML documentation (and
especially the docstrings), so I understand why you'd want to leave
those out.

> > 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).

Fair enough.  Thanks,

-- 
J.P. Larocque <jpl at thoughtcrime.us>




More information about the postmodern-devel mailing list