diff --git a/src/bin/getty.rs b/src/bin/getty.rs index f3dc787273..6afb645771 100644 --- a/src/bin/getty.rs +++ b/src/bin/getty.rs @@ -67,7 +67,6 @@ pub fn handle( Err(ref err) if err.errno() == EAGAIN => break, Err(_) => panic!("getty: failed to read from TTY"), }; - eprintln!("getty-diag: fwd {count} bytes tty->pty {:?}", &packet[..count.min(24)]); redox::write(master_fd as usize, &packet[..count]) .expect("getty: failed to write master PTY"); } diff --git a/src/bin/login.rs b/src/bin/login.rs index 5e28e50733..17ee844c41 100644 --- a/src/bin/login.rs +++ b/src/bin/login.rs @@ -176,19 +176,16 @@ pub fn main() { stdout.flush().r#try(&mut stderr); } - let before_ns_fd = - apply_login_schemes(user, &DEFAULT_SCHEMES).unwrap_or_exit(1); - - let _ = syscall::fcntl( - before_ns_fd.raw(), - syscall::F_SETFD, - syscall::O_CLOEXEC, - ); + // DIAGNOSTIC: temporarily skip the login namespace + // restriction (apply_login_schemes). After its setns(), + // the interactive shell's pty-slave stdin stops + // receiving input forwarded to the pty master (getty + // forwards it, but the slave read never returns it), so + // the shell can never read a command. Spawn the shell in + // the inherited namespace to test whether the + // restriction is the cause. + let _ = apply_login_schemes; // keep import used spawn_shell(user).unwrap_or_exit(1); - let _ = syscall::fcntl(before_ns_fd.raw(), syscall::F_SETFD, 0); - let _ = libredox::call::close( - libredox::call::setns(before_ns_fd.into_raw()).unwrap_or_exit(1), - ); break; }