mirror of https://github.com/buster-so/buster.git
no unix commands
This commit is contained in:
parent
d8ea573c56
commit
38ac1ec47f
|
@ -6,8 +6,6 @@ use std::{
|
||||||
net::TcpListener,
|
net::TcpListener,
|
||||||
process::{Child, Command},
|
process::{Child, Command},
|
||||||
};
|
};
|
||||||
#[cfg(unix)]
|
|
||||||
use std::os::unix::fs::PermissionsExt;
|
|
||||||
use tempfile::NamedTempFile;
|
use tempfile::NamedTempFile;
|
||||||
|
|
||||||
pub fn establish_ssh_tunnel(
|
pub fn establish_ssh_tunnel(
|
||||||
|
@ -62,33 +60,6 @@ pub fn establish_ssh_tunnel(
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(unix)]
|
|
||||||
{
|
|
||||||
let mut perms = match fs::metadata(temp_ssh_key.path()) {
|
|
||||||
Ok(p) => p.permissions(),
|
|
||||||
Err(e) => {
|
|
||||||
tracing::error!(
|
|
||||||
"There was a problem while getting the metadata of the temp file: {}",
|
|
||||||
e
|
|
||||||
);
|
|
||||||
return Err(anyhow!(e));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
perms.set_mode(0o600);
|
|
||||||
|
|
||||||
match fs::set_permissions(temp_ssh_key.path(), perms) {
|
|
||||||
Ok(_) => {}
|
|
||||||
Err(e) => {
|
|
||||||
tracing::error!(
|
|
||||||
"There was a problem while setting the permissions of the temp file: {}",
|
|
||||||
e
|
|
||||||
);
|
|
||||||
return Err(anyhow!(e));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
let ssh_tunnel = match Command::new("ssh")
|
let ssh_tunnel = match Command::new("ssh")
|
||||||
.arg("-T")
|
.arg("-T")
|
||||||
.arg("-i")
|
.arg("-i")
|
||||||
|
|
Loading…
Reference in New Issue