diff options
author | qkzk <qu3nt1n@gmail.com> | 2023-09-27 15:07:07 +0200 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2023-09-27 15:08:40 +0200 |
commit | d8cf6d55b7d0ebbfef9ef0b88227f7ecea622eff (patch) | |
tree | 74492d22a53ea8ce2f58aab62e95fd42bc1990d6 /src/event_exec.rs | |
parent | f45a5da6db2118b0932834dc709bc25afb374b88 (diff) |
when opening cryptdevices, display a message and nothing else if lsblk & cryptsetup aren't in path
Diffstat (limited to 'src/event_exec.rs')
-rw-r--r-- | src/event_exec.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/event_exec.rs b/src/event_exec.rs index f421bba..c6697a1 100644 --- a/src/event_exec.rs +++ b/src/event_exec.rs @@ -13,7 +13,7 @@ use crate::completion::InputCompleted; use crate::config::Colors; use crate::constant_strings_paths::SSHFS_EXECUTABLE; use crate::constant_strings_paths::{CONFIG_PATH, DEFAULT_DRAGNDROP}; -use crate::cryptsetup::BlockDeviceAction; +use crate::cryptsetup::{lsblk_and_cryptsetup_installed, BlockDeviceAction}; use crate::fileinfo::FileKind; use crate::filter::FilterKind; use crate::log::read_log; @@ -938,6 +938,10 @@ impl EventAction { /// Enter the encrypted device menu, allowing the user to mount/umount /// a luks encrypted device. pub fn encrypted_drive(status: &mut Status) -> Result<()> { + if !lsblk_and_cryptsetup_installed() { + write_log_line("lsblk and cryptsetup must be installed.".to_owned()); + return Ok(()); + } if status.encrypted_devices.is_empty() { status.encrypted_devices.update()?; } |