mirror of
https://github.com/joleuger/vuinputd.git
synced 2026-07-17 16:36:03 +00:00
Improve help message and cargo fmt
This commit is contained in:
parent
04bd88f179
commit
0c91a05ef7
2 changed files with 7 additions and 6 deletions
|
|
@ -79,7 +79,10 @@ struct Args {
|
|||
|
||||
#[arg(
|
||||
long = "vt-guard",
|
||||
help = "Prevent leakage of uinput to VT by, sending K_OFF to /dev/tty0"
|
||||
help = "Prevent all keyboard input from reaching the VT by setting K_OFF on /dev/tty0.",
|
||||
long_help = "Disable VT keyboard handling (K_OFF on /dev/tty0) to prevent uinput leakage.\n\
|
||||
This disables all keyboard input on the virtual terminals, including physical keyboards.\n\
|
||||
Loss of local access may require recovery via SSH or a rescue boot."
|
||||
)]
|
||||
pub vt_guard: bool,
|
||||
}
|
||||
|
|
@ -144,6 +147,7 @@ fn main() -> std::io::Result<()> {
|
|||
|
||||
if args.vt_guard {
|
||||
vt_tools::mute_keyboard()?;
|
||||
std::process::exit(0);
|
||||
}
|
||||
|
||||
check_permissions().expect("failed to read the capabilities of the vuinputd process");
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
//
|
||||
// Author: Johannes Leupolz <dev@leupolz.eu>
|
||||
|
||||
use log::{error, info, warn};
|
||||
use std::fs::OpenOptions;
|
||||
use std::io;
|
||||
use std::os::unix::io::AsRawFd;
|
||||
use log::{error, info, warn};
|
||||
|
||||
use libc::ioctl;
|
||||
|
||||
|
|
@ -29,10 +29,7 @@ pub fn check_vt_status() {
|
|||
|
||||
let rc = unsafe { ioctl(fd, KDGKBMODE, &mut mode) };
|
||||
if rc < 0 {
|
||||
error!(
|
||||
"KDGKBMODE ioctl failed: {}",
|
||||
io::Error::last_os_error()
|
||||
);
|
||||
error!("KDGKBMODE ioctl failed: {}", io::Error::last_os_error());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue