From c4ebeee5053a2f4ac87968121c29b64a596d42aa Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 11 May 2025 12:37:23 +0100 Subject: [PATCH] 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 --- common | 2 +- daemon/btrfs.ml | 4 ++-- daemon/cryptsetup.ml | 2 +- daemon/filearch.ml | 2 +- daemon/inspect_utils.ml | 6 +++--- daemon/sfdisk.ml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common b/common index 4c7ae1581..3a05f1a7a 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 4c7ae1581fa4c160fd8c1a04dcec1997f52808b0 +Subproject commit 3a05f1a7a0467b85d197113dcdfe6db54b6994a4 diff --git a/daemon/btrfs.ml b/daemon/btrfs.ml index 3f9d8308a..35e0b1765 100644 --- a/daemon/btrfs.ml +++ b/daemon/btrfs.ml @@ -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 diff --git a/daemon/cryptsetup.ml b/daemon/cryptsetup.ml index ac2cf066e..9c0149b48 100644 --- a/daemon/cryptsetup.ml +++ b/daemon/cryptsetup.ml @@ -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 () diff --git a/daemon/filearch.ml b/daemon/filearch.ml index 6eed7d396..f45392b5f 100644 --- a/daemon/filearch.ml +++ b/daemon/filearch.ml @@ -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 = diff --git a/daemon/inspect_utils.ml b/daemon/inspect_utils.ml index 1aa762050..5ef8bfa25 100644 --- a/daemon/inspect_utils.ml +++ b/daemon/inspect_utils.ml @@ -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) diff --git a/daemon/sfdisk.ml b/daemon/sfdisk.ml index c694c328c..3265d1e83 100644 --- a/daemon/sfdisk.ml +++ b/daemon/sfdisk.ml @@ -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