mirror of https://github.com/buster-so/buster.git
os fix on ssh tunneling
This commit is contained in:
parent
1b16398413
commit
d8ea573c56
|
@ -4,9 +4,10 @@ use std::{
|
|||
fs,
|
||||
io::Write,
|
||||
net::TcpListener,
|
||||
os::unix::fs::PermissionsExt,
|
||||
process::{Child, Command},
|
||||
};
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
use tempfile::NamedTempFile;
|
||||
|
||||
pub fn establish_ssh_tunnel(
|
||||
|
@ -61,6 +62,8 @@ pub fn establish_ssh_tunnel(
|
|||
}
|
||||
};
|
||||
|
||||
#[cfg(unix)]
|
||||
{
|
||||
let mut perms = match fs::metadata(temp_ssh_key.path()) {
|
||||
Ok(p) => p.permissions(),
|
||||
Err(e) => {
|
||||
|
@ -84,6 +87,7 @@ pub fn establish_ssh_tunnel(
|
|||
return Err(anyhow!(e));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
let ssh_tunnel = match Command::new("ssh")
|
||||
.arg("-T")
|
||||
|
|
Loading…
Reference in New Issue