mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 21:33:27 +00:00
@@ -51,7 +51,7 @@ impl ssh_agent::Agent<peerinfo::models::PeerInfo> for BitwardenDesktopAgent {
|
||||
let request_data = match request_parser::parse_request(data) {
|
||||
Ok(data) => data,
|
||||
Err(e) => {
|
||||
println!("[SSH Agent] Error while parsing request: {}", e);
|
||||
println!("[SSH Agent] Error while parsing request: {e}");
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@@ -178,7 +178,7 @@ impl BitwardenDesktopAgent {
|
||||
);
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!("[SSH Agent Native Module] Error while parsing key: {}", e);
|
||||
eprintln!("[SSH Agent Native Module] Error while parsing key: {e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -234,10 +234,9 @@ fn parse_key_safe(pem: &str) -> Result<ssh_key::private::PrivateKey, anyhow::Err
|
||||
Ok(key) => match key.public_key().to_bytes() {
|
||||
Ok(_) => Ok(key),
|
||||
Err(e) => Err(anyhow::Error::msg(format!(
|
||||
"Failed to parse public key: {}",
|
||||
e
|
||||
"Failed to parse public key: {e}"
|
||||
))),
|
||||
},
|
||||
Err(e) => Err(anyhow::Error::msg(format!("Failed to parse key: {}", e))),
|
||||
Err(e) => Err(anyhow::Error::msg(format!("Failed to parse key: {e}"))),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,16 +65,10 @@ impl BitwardenDesktopAgent {
|
||||
}
|
||||
};
|
||||
|
||||
println!(
|
||||
"[SSH Agent Native Module] Starting SSH Agent server on {:?}",
|
||||
ssh_path
|
||||
);
|
||||
println!("[SSH Agent Native Module] Starting SSH Agent server on {ssh_path:?}");
|
||||
let sockname = std::path::Path::new(&ssh_path);
|
||||
if let Err(e) = std::fs::remove_file(sockname) {
|
||||
println!(
|
||||
"[SSH Agent Native Module] Could not remove existing socket file: {}",
|
||||
e
|
||||
);
|
||||
println!("[SSH Agent Native Module] Could not remove existing socket file: {e}");
|
||||
if e.kind() != std::io::ErrorKind::NotFound {
|
||||
return;
|
||||
}
|
||||
@@ -85,10 +79,7 @@ impl BitwardenDesktopAgent {
|
||||
// Only the current user should be able to access the socket
|
||||
if let Err(e) = fs::set_permissions(sockname, fs::Permissions::from_mode(0o600))
|
||||
{
|
||||
println!(
|
||||
"[SSH Agent Native Module] Could not set socket permissions: {}",
|
||||
e
|
||||
);
|
||||
println!("[SSH Agent Native Module] Could not set socket permissions: {e}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -112,10 +103,7 @@ impl BitwardenDesktopAgent {
|
||||
println!("[SSH Agent Native Module] SSH Agent server exited");
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!(
|
||||
"[SSH Agent Native Module] Error while starting agent server: {}",
|
||||
e
|
||||
);
|
||||
eprintln!("[SSH Agent Native Module] Error while starting agent server: {e}");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -214,8 +214,7 @@ impl MacOSProviderClient {
|
||||
.remove(&sequence_number)
|
||||
{
|
||||
cb.error(BitwardenError::Internal(format!(
|
||||
"Error sending message: {}",
|
||||
e
|
||||
"Error sending message: {e}"
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ pub mod sshagent {
|
||||
.expect("should be able to send auth response to agent");
|
||||
}
|
||||
Err(e) => {
|
||||
println!("[SSH Agent Native Module] calling UI callback promise was rejected: {}", e);
|
||||
println!("[SSH Agent Native Module] calling UI callback promise was rejected: {e}");
|
||||
let _ = auth_response_tx_arc
|
||||
.lock()
|
||||
.await
|
||||
@@ -246,7 +246,7 @@ pub mod sshagent {
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
println!("[SSH Agent Native Module] calling UI callback could not create promise: {}", e);
|
||||
println!("[SSH Agent Native Module] calling UI callback could not create promise: {e}");
|
||||
let _ = auth_response_tx_arc
|
||||
.lock()
|
||||
.await
|
||||
|
||||
@@ -80,8 +80,7 @@ mod objc {
|
||||
Ok(value) => value,
|
||||
Err(e) => {
|
||||
println!(
|
||||
"Error: Failed to convert ObjCString to Rust string during commandReturn: {}",
|
||||
e
|
||||
"Error: Failed to convert ObjCString to Rust string during commandReturn: {e}"
|
||||
);
|
||||
|
||||
return false;
|
||||
@@ -91,10 +90,7 @@ mod objc {
|
||||
match context.send(value) {
|
||||
Ok(_) => 0,
|
||||
Err(e) => {
|
||||
println!(
|
||||
"Error: Failed to return ObjCString from ObjC code to Rust code: {}",
|
||||
e
|
||||
);
|
||||
println!("Error: Failed to return ObjCString from ObjC code to Rust code: {e}");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -29,12 +29,12 @@ fn init_logging(log_path: &Path, console_level: LevelFilter, file_level: LevelFi
|
||||
loggers.push(simplelog::WriteLogger::new(file_level, config, file));
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!("Can't create file: {}", e);
|
||||
eprintln!("Can't create file: {e}");
|
||||
}
|
||||
}
|
||||
|
||||
if let Err(e) = CombinedLogger::init(loggers) {
|
||||
eprintln!("Failed to initialize logger: {}", e);
|
||||
eprintln!("Failed to initialize logger: {e}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user