From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003
Description of problem:
When "rpm" is run with the "-root ..." option to install stuff on an alternative
root, scripts (pre-install, post-install, etc.) are run in a chroot() environment.
Unfortunately, if the user had the LD_PRELOAD environment variable set, this
variable is propagated to the scripts, and they fail to run because the library
cannot (usually) be found in the chroot environment.
I believe that rpm should, when doing chroot(), unset environment variables that
are counter-productive in a chroot. LD_PRELOAD is the most obvious (it bit one
of my coworkers!), but unsetting LD_LIBRARY_PATH, SHELL, and perhaps even all
environment variables (!) should be considered.
rpm changes the environment as little as possible,
and that's probably wiseset, as there's always going
to be one more enviroment variable that needs fiddling.
There's no objective basis for whether LD_PRELOAD is
useful in a chroot. For some, it is, for others it's not.
Without objective criteria, filtering the environment
doesn't belong in rpm.