Mitchell Augustin has proposed merging 
~mitchellaugustin/curtin/+git/curtin-1:missing-ischroot-mitigation into 
curtin:master.

Commit message:
Check to ensure ischroot exists before ChrootableTarget bind mount
    
Some systems (such as centos7) do not include /usr/bin/ischroot,
which will cause the bind mount to it in ChrootableTarget to fail.
    
Adding a check for this ensures that the file exists before
mounting and aborts the mount if it does not.


Requested reviews:
  Dan Bungert (dbungert)

For more details, see:
https://code.launchpad.net/~mitchellaugustin/curtin/+git/curtin-1/+merge/461730

Check to ensure ischroot exists before ChrootableTarget bind mount
-- 
Your team curtin developers is subscribed to branch curtin:master.
diff --git a/curtin/util.py b/curtin/util.py
index 8be6d20..58ee7e1 100644
--- a/curtin/util.py
+++ b/curtin/util.py
@@ -784,8 +784,10 @@ class ChrootableTarget(object):
         ischroot_mount_path = paths.target_path(self.target,
                                                 '/usr/bin/ischroot')
         true_exists = os.path.isfile(true_mount_path)
-        if true_exists and do_mount(true_mount_path, ischroot_mount_path,
-                                    opts='--bind'):
+        ischroot_exists = os.path.isfile(ischroot_mount_path)
+        both_exist = true_exists and ischroot_exists
+        if both_exist and do_mount(true_mount_path, ischroot_mount_path,
+                                   opts='--bind'):
             self.umounts.append(ischroot_mount_path)
 
         return self
-- 
Mailing list: https://launchpad.net/~curtin-dev
Post to     : curtin-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~curtin-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to