mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
pvinfo: Improve User experience on non-SE enabled systems
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 <dan@danny.cz> Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
808b766407
commit
fef70e3e95
+10
-1
@@ -21,6 +21,7 @@ use crate::constants::*;
|
|||||||
use crate::handlers::handle_supported_flags;
|
use crate::handlers::handle_supported_flags;
|
||||||
use crate::io_utils::check_uv_exists;
|
use crate::io_utils::check_uv_exists;
|
||||||
use crate::pvinfo::PvInfo;
|
use crate::pvinfo::PvInfo;
|
||||||
|
use crate::se_status::SeStatus;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
@@ -29,12 +30,20 @@ fn main() -> Result<()> {
|
|||||||
cli.post_process();
|
cli.post_process();
|
||||||
let base_dir = PathBuf::from(BASE_DIR);
|
let base_dir = PathBuf::from(BASE_DIR);
|
||||||
let query_dir = base_dir.join(QUERY_DIR);
|
let query_dir = base_dir.join(QUERY_DIR);
|
||||||
check_uv_exists()?;
|
|
||||||
let mut stdout = io::stdout();
|
let mut stdout = io::stdout();
|
||||||
if cli.version {
|
if cli.version {
|
||||||
utils::print_version!(2025);
|
utils::print_version!(2025);
|
||||||
return Ok(());
|
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 {
|
match &cli.command {
|
||||||
// Handle the supported-flags subcommand
|
// Handle the supported-flags subcommand
|
||||||
Some(Commands::SupportedFlags {
|
Some(Commands::SupportedFlags {
|
||||||
|
|||||||
Reference in New Issue
Block a user