summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClark Williams <williams@redhat.com>2009-02-01 09:41:49 -0600
committerClark Williams <williams@redhat.com>2009-02-01 09:41:49 -0600
commitbc4dc3f77deed7b59dc872f634a13380b06a33d5 (patch)
tree3233d14c0134af081b98ba785c1041e6b45f2751
parent43b9b5a58bc1533c245202bde51e8f091d25b440 (diff)
downloadmock-bc4dc3f77deed7b59dc872f634a13380b06a33d5.tar.gz
mock-bc4dc3f77deed7b59dc872f634a13380b06a33d5.tar.xz
mock-bc4dc3f77deed7b59dc872f634a13380b06a33d5.zip
set HOME environment variable to be the chroot home
-rwxr-xr-xpy/mock.py2
-rw-r--r--py/mock/backend.py2
2 files changed, 1 insertions, 3 deletions
diff --git a/py/mock.py b/py/mock.py
index 19af14c..00c8968 100755
--- a/py/mock.py
+++ b/py/mock.py
@@ -411,7 +411,6 @@ def main(ret):
uidManager = mock.uid.uidManager(unprivUid, unprivGid)
uidManager._becomeUser(unprivUid, unprivGid)
- del(os.environ["HOME"])
# defaults
config_opts = {}
@@ -499,6 +498,7 @@ def main(ret):
ret["chroot"] = chroot
ret["config_opts"] = config_opts
os.umask(002)
+ os.environ["HOME"] = chroot.homedir
# New namespace starting from here
try:
diff --git a/py/mock/backend.py b/py/mock/backend.py
index f259afe..d812743 100644
--- a/py/mock/backend.py
+++ b/py/mock/backend.py
@@ -383,8 +383,6 @@ class Root(object):
srpmChrootFilename = self._copySrpmIntoChroot(srpm)
srpmBasename = os.path.basename(srpmChrootFilename)
- # install srpm
- os.environ["HOME"] = self.homedir
# Completely/Permanently drop privs while running the following:
self.doChroot(
["rpm", "-Uvh", "--nodeps", srpmChrootFilename],