mirror of
https://github.com/Noratrieb/cluelessh.git
synced 2026-01-14 16:35:06 +01:00
bootstrap SFTP subsystem
This commit is contained in:
parent
8de8204bc7
commit
a9e2edc572
15 changed files with 205 additions and 17 deletions
|
|
@ -105,6 +105,11 @@ pub enum ChannelRequest {
|
|||
|
||||
command: Vec<u8>,
|
||||
},
|
||||
Subsystem {
|
||||
want_reply: bool,
|
||||
|
||||
name: String,
|
||||
},
|
||||
Env {
|
||||
want_reply: bool,
|
||||
|
||||
|
|
@ -471,6 +476,19 @@ impl ChannelsState {
|
|||
command: command.to_owned(),
|
||||
}
|
||||
}
|
||||
"subsystem" => {
|
||||
if !self.is_server {
|
||||
return Err(peer_error!("server tried to set environment var"));
|
||||
}
|
||||
|
||||
let name = p.utf8_string()?;
|
||||
|
||||
info!(channel = %our_channel, %name, "Starting subsystem");
|
||||
ChannelRequest::Subsystem {
|
||||
want_reply,
|
||||
name: name.to_owned(),
|
||||
}
|
||||
}
|
||||
"env" => {
|
||||
if !self.is_server {
|
||||
return Err(peer_error!("server tried to set environment var"));
|
||||
|
|
@ -632,6 +650,7 @@ impl ChannelsState {
|
|||
Packet::new_msg_channel_request_shell(peer, b"shell", want_reply)
|
||||
}
|
||||
ChannelRequest::Exec { .. } => todo!("exec"),
|
||||
ChannelRequest::Subsystem { .. } => todo!("subsystem"),
|
||||
ChannelRequest::Env { .. } => todo!("env"),
|
||||
ChannelRequest::ExitStatus { status } => {
|
||||
Packet::new_msg_channel_request_exit_status(
|
||||
|
|
@ -787,6 +806,7 @@ impl ChannelOperation {
|
|||
ChannelRequest::PtyReq { .. } => "pty-req",
|
||||
ChannelRequest::Shell { .. } => "shell",
|
||||
ChannelRequest::Exec { .. } => "exec",
|
||||
ChannelRequest::Subsystem { .. } => "subsystem",
|
||||
ChannelRequest::Env { .. } => "env",
|
||||
ChannelRequest::ExitStatus { .. } => "exit-status",
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue