mirror of
https://github.com/Noratrieb/cluelessh.git
synced 2026-01-14 16:35:06 +01:00
log more
This commit is contained in:
parent
6ff5bbde98
commit
3c1cff927c
2 changed files with 26 additions and 2 deletions
|
|
@ -112,6 +112,7 @@ async fn handle_connection(
|
|||
ChannelRequestKind::PtyReq { .. } => {}
|
||||
ChannelRequestKind::Shell => {}
|
||||
ChannelRequestKind::Exec { .. } => {}
|
||||
ChannelRequestKind::Env { .. } => {}
|
||||
};
|
||||
if req.want_reply {
|
||||
state.do_operation(
|
||||
|
|
|
|||
|
|
@ -61,6 +61,10 @@ pub enum ChannelRequestKind {
|
|||
Exec {
|
||||
command: Vec<u8>,
|
||||
},
|
||||
Env {
|
||||
name: String,
|
||||
value: Vec<u8>,
|
||||
},
|
||||
}
|
||||
|
||||
impl ChannelNumber {
|
||||
|
|
@ -165,8 +169,6 @@ impl ServerChannelsState {
|
|||
let our_channel = self.validate_channel(our_channel)?;
|
||||
let data = packet.string()?;
|
||||
|
||||
let _ = self.channel(our_channel)?;
|
||||
|
||||
self.channel_updates.push_back(ChannelUpdate {
|
||||
number: our_channel,
|
||||
kind: ChannelUpdateKind::Data {
|
||||
|
|
@ -174,6 +176,16 @@ impl ServerChannelsState {
|
|||
},
|
||||
});
|
||||
}
|
||||
Packet::SSH_MSG_CHANNEL_EOF => {
|
||||
// <https://datatracker.ietf.org/doc/html/rfc4254#section-5.3>
|
||||
let our_channel = packet.u32()?;
|
||||
let our_channel = self.validate_channel(our_channel)?;
|
||||
|
||||
self.channel_updates.push_back(ChannelUpdate {
|
||||
number: our_channel,
|
||||
kind: ChannelUpdateKind::Eof,
|
||||
});
|
||||
}
|
||||
Packet::SSH_MSG_CHANNEL_CLOSE => {
|
||||
// <https://datatracker.ietf.org/doc/html/rfc4254#section-5.3>
|
||||
let our_channel = packet.u32()?;
|
||||
|
|
@ -241,6 +253,17 @@ impl ServerChannelsState {
|
|||
command: command.to_owned(),
|
||||
}
|
||||
}
|
||||
"env" => {
|
||||
let name = packet.utf8_string()?;
|
||||
let value = packet.string()?;
|
||||
|
||||
info!(?our_channel, ?name, value = ?String::from_utf8_lossy(value), "Setting environment variable");
|
||||
|
||||
ChannelRequestKind::Env {
|
||||
name: name.to_owned(),
|
||||
value: value.to_owned(),
|
||||
}
|
||||
}
|
||||
"signal" => {
|
||||
debug!(?our_channel, "Received signal");
|
||||
// Ignore signals, something we can do.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue