mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-02 00:00:03 +03:00
cmd_mount: request passphrase if the existing key is revoked
Signed-off-by: Colin Gillespie <colin@cgillespie.xyz>
This commit is contained in:
parent
8d5e53b88a
commit
9fe08ba354
@ -41,10 +41,11 @@ fn check_for_key(key_name: &std::ffi::CStr) -> anyhow::Result<bool> {
|
||||
if key_id > 0 {
|
||||
info!("Key has became available");
|
||||
Ok(true)
|
||||
} else if errno::errno().0 != libc::ENOKEY {
|
||||
Err(crate::ErrnoError(errno::errno()).into())
|
||||
} else {
|
||||
Ok(false)
|
||||
match errno::errno().0 {
|
||||
libc::ENOKEY | libc::EKEYREVOKED => Ok(false),
|
||||
_ => Err(crate::ErrnoError(errno::errno()).into()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user