Blame SOURCES/0074-daemon-inspect-ignore-fstab-devs-that-cannot-be-reso.patch

97ae69
From adae4d57b007b99cb246c3a3e8b02189b19ce2c4 Mon Sep 17 00:00:00 2001
97ae69
From: Pino Toscano <ptoscano@redhat.com>
97ae69
Date: Fri, 27 Jul 2018 12:10:38 +0200
97ae69
Subject: [PATCH] daemon: inspect: ignore fstab devs that cannot be resolved
97ae69
 (RHBZ#1608131)
97ae69
97ae69
If the /etc/fstab of a guest contains devices specified with UUID or
97ae69
LABEL, then the new OCaml inspection code will report the findfs failure
97ae69
as general failure of the inspection.  OTOH, the old C inspection code
97ae69
simply ignored all the devices that cannot be resolved.
97ae69
97ae69
Hence, restore the old behaviour by ignoring unresolvable devices.
97ae69
---
97ae69
 daemon/inspect_fs_unix_fstab.ml | 12 ++++++++++--
97ae69
 1 file changed, 10 insertions(+), 2 deletions(-)
97ae69
97ae69
diff --git a/daemon/inspect_fs_unix_fstab.ml b/daemon/inspect_fs_unix_fstab.ml
97ae69
index edb797e3f..170440d2c 100644
97ae69
--- a/daemon/inspect_fs_unix_fstab.ml
97ae69
+++ b/daemon/inspect_fs_unix_fstab.ml
97ae69
@@ -115,12 +115,20 @@ and check_fstab_entry md_map root_mountable os_type aug entry =
97ae69
       if String.is_prefix spec "UUID=" then (
97ae69
         let uuid = String.sub spec 5 (String.length spec - 5) in
97ae69
         let uuid = shell_unquote uuid in
97ae69
-        Mountable.of_device (Findfs.findfs_uuid uuid)
97ae69
+        (* Just ignore the device if the UUID cannot be resolved. *)
97ae69
+        try
97ae69
+          Mountable.of_device (Findfs.findfs_uuid uuid)
97ae69
+        with
97ae69
+          Failure _ -> return None
97ae69
       )
97ae69
       else if String.is_prefix spec "LABEL=" then (
97ae69
         let label = String.sub spec 6 (String.length spec - 6) in
97ae69
         let label = shell_unquote label in
97ae69
-        Mountable.of_device (Findfs.findfs_label label)
97ae69
+        (* Just ignore the device if the label cannot be resolved. *)
97ae69
+        try
97ae69
+          Mountable.of_device (Findfs.findfs_label label)
97ae69
+        with
97ae69
+          Failure _ -> return None
97ae69
       )
97ae69
       (* Resolve /dev/root to the current device.
97ae69
        * Do the same for the / partition of the *BSD
97ae69
-- 
fd1da6
2.17.2
97ae69