From 8879da17a8b05613c6a9bb55e6429e316c1ee72f Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Thu, 9 Jan 2025 09:43:14 -0800 Subject: [PATCH] Support `diskutil apfs list` not returning a FileVault attribute (#1378) --- src/action/macos/encrypt_apfs_volume.rs | 2 +- src/os/darwin/diskutil.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/action/macos/encrypt_apfs_volume.rs b/src/action/macos/encrypt_apfs_volume.rs index 997e2d258..35635a331 100644 --- a/src/action/macos/encrypt_apfs_volume.rs +++ b/src/action/macos/encrypt_apfs_volume.rs @@ -107,7 +107,7 @@ impl EncryptApfsVolume { plist::from_bytes(&output.stdout).map_err(Self::error)?; for container in parsed.containers { for volume in container.volumes { - if volume.name.as_ref() == Some(&name) && volume.file_vault { + if volume.name.as_ref() == Some(&name) && volume.file_vault.unwrap_or(false) { return Ok(StatefulAction::completed(Self { determinate_nix, disk, diff --git a/src/os/darwin/diskutil.rs b/src/os/darwin/diskutil.rs index e7d2a7a17..ca58cc7d3 100644 --- a/src/os/darwin/diskutil.rs +++ b/src/os/darwin/diskutil.rs @@ -56,7 +56,7 @@ pub struct DiskUtilApfsContainer { #[serde(rename_all = "PascalCase")] pub struct DiskUtilApfsListVolume { pub name: Option, - pub file_vault: bool, + pub file_vault: Option, } #[derive(serde::Deserialize, Clone, Debug)]