Bug 83822

Summary: chroot and LD_PRELOAD don't mix...
Product: [Retired] Red Hat Linux Reporter: Nadav Har'El <nyh>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WONTFIX QA Contact: Mike McLean <mikem>
Severity: low Docs Contact:
Priority: medium    
Version: 8.0CC: mitr
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-02-13 16:09:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nadav Har'El 2003-02-09 14:59:41 UTC
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.

Comment 1 Jeff Johnson 2003-02-13 16:09:27 UTC
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.