pub fn try_to_detach_hsm() {
        if let Ok(metadata) = std::fs::metadata(VSOCK_AGENT_PATH) {
            let permissions = metadata.permissions();
            if permissions.mode() & 0o111 != 0 {
                // Executable exists. We will run it, without checking the result.
                // Once we finish migration to the Ubuntu-based IC-OS and the Vsock-based HSM
                // sharing, we'll want to know if this command failed.
                let _ = StdCommand::new(VSOCK_AGENT_PATH)
                    .arg("--detach-hsm".to_string())
                    .status();
            }
        }
    }
/// Try to detach the USB HSM, if the VSOCK_AGENT_PATH binary
/// exists. Ignore any errors in the execution.
Try to detach the USB HSM, if the VSOCK_AGENT_PATH binary
exists. Ignore any errors in the execution.
Try to detach the USB HSM if the VSOCK_AGENT_PATH binary exists . Ignore any errors in the execution .
pub fn try_to_detach_hsm() {
        if let Ok(metadata) = std::fs::metadata(VSOCK_AGENT_PATH) {
            let permissions = metadata.permissions();
            if permissions.mode() & 0o111 != 0 {
                // Executable exists. We will run it, without checking the result.
                // Once we finish migration to the Ubuntu-based IC-OS and the Vsock-based HSM
                // sharing, we'll want to know if this command failed.
                let _ = StdCommand::new(VSOCK_AGENT_PATH)
                    .arg("--detach-hsm".to_string())
                    .status();
            }
        }
    }
pub fn try_to_detach_hsm ( ) { if let Ok ( metadata ) = std :: fs :: metadata ( VSOCK_AGENT_PATH ) { let permissions = metadata . permissions ( ) ; if permissions . mode ( ) & 0o111 != 0 { // Executable exists. We will run it, without checking the result. // Once we finish migration to the Ubuntu-based IC-OS and the Vsock-based HSM // sharing, we'll want to know if this command failed. let _ = StdCommand :: new ( VSOCK_AGENT_PATH ) . arg ( " " . to_string ( ) ) . status ( ) ; } } }
Try to detach the USB HSM, if the VSOCK_AGENT_PATH binary
exists.
Try to detach the USB HSM if the VSOCK_AGENT_PATH binary exists .