[Yum-devel] RFC: unset LD_PRELOAD in yum?
Jeremy Katz
katzj at redhat.com
Mon Jun 20 17:21:30 UTC 2005
On Mon, 2005-06-20 at 13:08 -0400, seth vidal wrote:
> On Mon, 2005-06-20 at 11:56 -0400, Jeremy Katz wrote:
> > On Sat, 2005-06-18 at 00:41 -0400, seth vidal wrote:
> > > On Fri, 2005-06-17 at 17:35 -0400, Jeremy Katz wrote:
> > > > LD_PRELOAD gets used in some special cases[1] to avoid bits of
> > > > confusion. But this then ends up at least being noisy when installing
> > > > into chroots and has in the past caused things to break.
> > > >
> > > > What do people think of having yum unset LD_PRELOAD, at least on the
> > > > cases where installroot != "/"? anaconda has been doing it for a long
> > > > time, but it's hardly a generic environment.
> >
> > > Why can't the user or calling script do that before calling yum? I guess
> > > what I'm trying to figure out is why does this make sense to be in yum?
> > > Why not in mock or in anaconda?
> >
> > Because in the mock case, we need to fake out rpmlib which gets imported
> > by yum. If we switch mock to just importing the yum stuff instead of
> > running it on the command line, then we could do it there (but that gets
> > complicated for other reasons).
>
> privilege promotion inside python seems difficult.
That was the "for other reasons" ;-)
But we could have mock run a /usr/libexec/mock_yum that looks like
#!/usr/bin/python
import os, sys
if os.environ.has_key("LD_PRELOAD"): del os.environ["LD_PRELOAD"]
import yum
sys.path.insert(0, "/usr/share/yum-cli")
import yummain
try:
yummain.main(sys.argv[1:])
except KeyboardInterrupt, e:
print >> sys.stderr, "\n\nExiting on user cancel."
sys.exit(1)
Not sure it's "better".
Jeremy
More information about the Yum-devel
mailing list