conary: when exiting chroot, make sure to return to old root.
David Christian
dbc at rpath.com
Mon Dec 5 10:07:56 EST 2005
tag: tip
user: David Christian <http://bugs.rpath.com>
files: conary/files.py
when exiting chroot, make sure to return to old root.
Use os.chdir('/') before os.chroot(<newroot>) so os.chroot('.') will exit chroot
diff -r aa7df1257e2a -r 7c31a0bfcef6 conary/files.py
--- a/conary/files.py Mon Dec 5 15:02:03 2005
+++ b/conary/files.py Mon Dec 5 15:08:06 2005
@@ -702,8 +702,9 @@
if root and root != '/':
curDir = os.open(".", os.O_RDONLY)
- # this doesn't chdir into the root to allow us to chroot
+ # chdir to the current root to allow us to chroot
# back out again
+ os.chdir('/')
os.chroot(root)
try:
More information about the conary-commits
mailing list