I kind of disagree with you mark and I think that the diff makes sense.
On Fri, Dec 17, 2010 at 11:48:06AM +0100, Mark Kettenis wrote:
> > Date: Thu, 16 Dec 2010 22:43:04 +0100
> > From: Stefan Sperling <s...@openbsd.org>
> >
> > $ export LD_PRELOAD=''
> > $ sed
> > sed: can't load library ''
> > $ env
> > env: can't load library ''
> > $ vim
> > /usr/local/bin/vim: can't load library ''
> > $
> >
> > Is this the right way to fix it?
>
> I'd say it works just fine without your fix. If you really don't want
> to preload stuff, make sure LD_PRELOAD isn't set at all.
>
> > Index: loader.c
> > ===================================================================
> > RCS file: /cvs/src/libexec/ld.so/loader.c,v
> > retrieving revision 1.120
> > diff -u -p -r1.120 loader.c
> > --- loader.c 25 Oct 2010 20:34:44 -0000 1.120
> > +++ loader.c 16 Dec 2010 21:40:07 -0000
> > @@ -493,7 +493,7 @@ _dl_boot(const char **argv, char **envp,
> > TAILQ_INSERT_TAIL(&_dlopened_child_list, n, next_sib);
> > exe_obj->opencount++;
> >
> > - if (_dl_preload != NULL)
> > + if (_dl_preload != NULL && _dl_preload[0] != '\0')
> > _dl_dopreload(_dl_preload);
> >
> > _dl_load_dep_libs(exe_obj, exe_obj->obj_flags, 1);