From fef70e3e95e8c38cdb00aacbb20998a8d0f2b99d Mon Sep 17 00:00:00 2001 From: Steffen Eiden Date: Thu, 15 Jan 2026 16:05:22 +0100 Subject: [PATCH] pvinfo: Improve User experience on non-SE enabled systems MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For systems without SE: - Do not exit with an error if `--version` is specified but print the version - Do not exit with an error if `--se-status` is specified but print `Secure Execution is not enabled` Closes: https://github.com/ibm-s390-linux/s390-tools/issues/197 Closes: https://github.com/ibm-s390-linux/s390-tools/issues/198 Reported-by: Dan Horák Reviewed-by: Jan Höppner Signed-off-by: Steffen Eiden Signed-off-by: Jan Höppner --- rust/pvinfo/src/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/rust/pvinfo/src/main.rs b/rust/pvinfo/src/main.rs index 22750aa1..785ed967 100644 --- a/rust/pvinfo/src/main.rs +++ b/rust/pvinfo/src/main.rs @@ -21,6 +21,7 @@ use crate::constants::*; use crate::handlers::handle_supported_flags; use crate::io_utils::check_uv_exists; use crate::pvinfo::PvInfo; +use crate::se_status::SeStatus; use std::path::PathBuf; fn main() -> Result<()> { @@ -29,12 +30,20 @@ fn main() -> Result<()> { cli.post_process(); let base_dir = PathBuf::from(BASE_DIR); let query_dir = base_dir.join(QUERY_DIR); - check_uv_exists()?; let mut stdout = io::stdout(); if cli.version { utils::print_version!(2025); return Ok(()); } + if let Err(e) = check_uv_exists() { + match cli.se_status { + true => { + writeln!(stdout, "{}", SeStatus::Unsecure)?; + return Ok(()); + } + false => return Err(e), + } + } match &cli.command { // Handle the supported-flags subcommand Some(Commands::SupportedFlags {