Update common submodule

Pull in these commits which require minor changes:

  Richard W.M. Jones (3):
      mlstdutils: Remove Std_utils.identity
      mlstdutils: Remove Std_utils.protect
      mlstdutils: Remove List.filter_map
This commit is contained in:
Richard W.M. Jones
2025-05-11 12:37:23 +01:00
parent fcd169476f
commit c4ebeee505
6 changed files with 9 additions and 9 deletions

2
common

Submodule common updated: 4c7ae1581f...3a05f1a7a0

View File

@@ -48,7 +48,7 @@ let rec with_mounted mountable f =
rmdir tmpdir
in
protect ~finally ~f:(fun () -> mount_cmd tmpdir; f tmpdir)
Fun.protect ~finally (fun () -> mount_cmd tmpdir; f tmpdir)
in
match mountable.m_type with
@@ -124,4 +124,4 @@ let btrfs_subvolume_get_default mountable =
with_mounted mountable (
fun mp -> command "btrfs" ["subvolume"; "get-default"; mp]
) in
sscanf out "ID %Ld" identity
sscanf out "ID %Ld" Fun.id

View File

@@ -56,7 +56,7 @@ let cryptsetup_open ?(readonly = false) ?crypttype ?cipher device key mapname =
Option.iter (fun s -> List.push_back_list args ["--cipher"; s]) cipher;
(* Make sure we always remove the temporary file. *)
protect ~f:(fun () -> ignore (command "cryptsetup" !args))
Fun.protect (fun () -> ignore (command "cryptsetup" !args))
~finally:(fun () -> unlink keyfile);
udev_settle ()

View File

@@ -116,7 +116,7 @@ and cpio_arch magic orig_path path =
let tmpdir = Mkdtemp.temp_dir "filearch" in
let finally () = ignore (Sys.command (sprintf "rm -rf %s" (quote tmpdir))) in
protect ~finally ~f:(
Fun.protect ~finally (
fun () ->
(* Construct a command to extract named binaries from the initrd file. *)
let cmd =

View File

@@ -57,8 +57,8 @@ let rec with_augeas ?name configfiles f =
Augeas.create (Sysroot.sysroot ()) None
[Augeas.AugSaveNoop; Augeas.AugNoLoad] in
protect
~f:(fun () ->
Fun.protect
(fun () ->
(* Tell Augeas to only load configfiles and no other files. This
* prevents a rogue guest from performing a denial of service attack
* by having large, over-complicated configuration files which are
@@ -179,4 +179,4 @@ let with_hive hive_filename f =
| Some f -> f :: flags in
let flags = if verbose () then Hivex.OPEN_VERBOSE :: flags else flags in
let h = Hivex.open_file hive_filename flags in
protect ~f:(fun () -> f h (Hivex.root h)) ~finally:(fun () -> Hivex.close h)
Fun.protect (fun () -> f h (Hivex.root h)) ~finally:(fun () -> Hivex.close h)

View File

@@ -35,7 +35,7 @@ let part_get_mbr_id device partnum =
udev_settle ();
(* It's printed in hex, possibly with a leading space. *)
sscanf out " %x" identity
sscanf out " %x" Fun.id
let part_get_gpt_type device partnum =
if partnum <= 0 then