mirror of
https://github.com/Noratrieb/cluelessh.git
synced 2026-01-14 16:35:06 +01:00
fix stderr
This commit is contained in:
parent
a59bcb069d
commit
187478464c
4 changed files with 40 additions and 9 deletions
|
|
@ -300,13 +300,23 @@ async fn handle_session_channel(user: String, channel: Channel) -> Result<()> {
|
|||
let Ok(read) = read else {
|
||||
bail!("failed to read");
|
||||
};
|
||||
let _ = state.channel.send(ChannelOperationKind::Data(read_buf[..read].to_vec())).await;
|
||||
if read == 0 {
|
||||
// EOF, close the stream.
|
||||
state.reader = None;
|
||||
} else {
|
||||
let _ = state.channel.send(ChannelOperationKind::Data(read_buf[..read].to_vec())).await;
|
||||
}
|
||||
}
|
||||
read = read_ext => {
|
||||
let Ok(read) = read else {
|
||||
bail!("failed to read");
|
||||
};
|
||||
let _ = state.channel.send(ChannelOperationKind::ExtendedData(1, read_ext_buf[..read].to_vec())).await;
|
||||
if read == 0 {
|
||||
// EOF, close the stream.
|
||||
state.reader_ext = None;
|
||||
} else {
|
||||
let _ = state.channel.send(ChannelOperationKind::ExtendedData(1, read_ext_buf[..read].to_vec())).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
ssh -p "$PORT" "$HOST" echo jdklfsjdöklfd | grep "jdklfsjdöklfd"
|
||||
|
||||
# Important: redirect 2>&1 first before clobbering 1
|
||||
ssh -p "$PORT" "$HOST" "echo jdklfsjdöklfd 1>&2" 2>&1 1>/dev/null | grep "jdklfsjdöklfd"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue