[Yum-devel] [PATCH] os.path.normpath() over the installroot dir

Seth Vidal skvidal at fedoraproject.org
Mon Sep 14 20:24:52 UTC 2009


apparently opening a path NOT starting with '/' inside the chroot
that rpm makes for the transaction will open a file OUTSIDE of the chroot
no, I'm not sure I get it either.
---
 yum/rpmtrans.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/yum/rpmtrans.py b/yum/rpmtrans.py
index 77b06a2..4542e03 100644
--- a/yum/rpmtrans.py
+++ b/yum/rpmtrans.py
@@ -339,7 +339,7 @@ class RPMTransaction:
         # we hand back the right path to those 'outside' of the chroot() calls
         # but we're using the right path inside.
         if self.base.conf.installroot != '/':
-            tsfn = tsfn.replace(self.base.conf.installroot,'')
+            tsfn = tsfn.replace(os.path.normpath(self.base.conf.installroot),'')
         try:
             if not os.path.exists(os.path.dirname(tsfn)):
                 os.makedirs(os.path.dirname(tsfn)) # make the dir,
-- 
1.6.2.5



More information about the Yum-devel mailing list