diff --git a/data/auth.sqlite b/data/auth.sqlite index ab9c3a4..03a3b4f 100644 Binary files a/data/auth.sqlite and b/data/auth.sqlite differ diff --git a/markbase-core/src/ssh_server/channel.rs b/markbase-core/src/ssh_server/channel.rs index 7513258..c753b09 100644 --- a/markbase-core/src/ssh_server/channel.rs +++ b/markbase-core/src/ssh_server/channel.rs @@ -1629,8 +1629,10 @@ impl ChannelManager { if let Some(exec_process) = &mut channel.exec_process { match exec_process.child.try_wait() { Ok(Some(status)) => { - info!("Child exited after max iterations (status: {:?})", status); + let exit_code = status.code().unwrap_or(-1) as u32; + info!("Child exited after max iterations (exit_status: {}, status: {:?})", exit_code, status); child_exited = true; + channel.exit_status = Some(exit_code); // 读取剩余stdout if let Some(stdout) = &mut exec_process.stdout { @@ -1804,8 +1806,10 @@ impl ChannelManager { // ⭐⭐⭐⭐⭐ 立即检查child是否exited match exec_process.child.try_wait() { Ok(Some(status)) => { - info!("⭐⭐⭐⭐⭐ Child exited after stdout/stderr EOF (status: {:?})", status); + let exit_code = status.code().unwrap_or(-1) as u32; + info!("⭐⭐⭐⭐⭐ Child exited after stdout/stderr EOF (exit_status: {}, status: {:?})", exit_code, status); child_exited = true; + channel.exit_status = Some(exit_code); // ⭐⭐⭐⭐⭐ 关键:立即返回child_exited标志 // server.rs会发送SSH_MSG_CHANNEL_EOF + CLOSE