daemon: inspect: ignore fstab devs that cannot be resolved (RHBZ#1608131)

If the /etc/fstab of a guest contains devices specified with UUID or
LABEL, then the new OCaml inspection code will report the findfs failure
as general failure of the inspection.  OTOH, the old C inspection code
simply ignored all the devices that cannot be resolved.

Hence, restore the old behaviour by ignoring unresolvable devices.
This commit is contained in:
Pino Toscano
2018-07-27 12:10:38 +02:00
parent 040cb93717
commit 67c36779c3

View File

@@ -115,12 +115,20 @@ and check_fstab_entry md_map root_mountable os_type aug entry =
if String.is_prefix spec "UUID=" then (
let uuid = String.sub spec 5 (String.length spec - 5) in
let uuid = shell_unquote uuid in
Mountable.of_device (Findfs.findfs_uuid uuid)
(* Just ignore the device if the UUID cannot be resolved. *)
try
Mountable.of_device (Findfs.findfs_uuid uuid)
with
Failure _ -> return None
)
else if String.is_prefix spec "LABEL=" then (
let label = String.sub spec 6 (String.length spec - 6) in
let label = shell_unquote label in
Mountable.of_device (Findfs.findfs_label label)
(* Just ignore the device if the label cannot be resolved. *)
try
Mountable.of_device (Findfs.findfs_label label)
with
Failure _ -> return None
)
(* Resolve /dev/root to the current device.
* Do the same for the / partition of the *BSD