mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-03 03:55:46 +00:00
d5f5648b37
We use cargo vendor to generate a .cargo/config file and the vendor directory. Vendoring allows us to lock our dependencies and to modify them easily from the top level Cargo.toml. We vendor all dependencies, including the crates.io ones, which allows for network isolated builds. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
24 lines
547 B
Rust
24 lines
547 B
Rust
extern crate termion;
|
|
|
|
use termion::input::TermRead;
|
|
use std::io::{Write, stdout, stdin};
|
|
|
|
fn main() {
|
|
let stdout = stdout();
|
|
let mut stdout = stdout.lock();
|
|
let stdin = stdin();
|
|
let mut stdin = stdin.lock();
|
|
|
|
stdout.write_all(b"password: ").unwrap();
|
|
stdout.flush().unwrap();
|
|
|
|
let pass = stdin.read_passwd(&mut stdout);
|
|
|
|
if let Ok(Some(pass)) = pass {
|
|
stdout.write_all(pass.as_bytes()).unwrap();
|
|
stdout.write_all(b"\n").unwrap();
|
|
} else {
|
|
stdout.write_all(b"Error\n").unwrap();
|
|
}
|
|
}
|