Fix NoShell to flush the error before exiting
If we don't flush the stderr stream the packet containing the error message doesn't make it to the client. This was broken by an upgrade in MINA SSHD, I suspect the output streams are not flushing their buffer completely during close. We also need to include a "\r" in the message because the shell is running inside of a pty, the pty expects us to move the cursor back to column 0 via terminal command codes. Change-Id: Ifb33dbff07c7431a0205e12eca2b5018636e387b Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -56,7 +56,9 @@ class NoShell implements Factory<Command> {
|
||||
}
|
||||
|
||||
public void start(final Environment env) throws IOException {
|
||||
err.write(Constants.encodeASCII("gerrit: no shell available\n"));
|
||||
err.write(Constants.encodeASCII("gerrit: no shell available\r\n"));
|
||||
err.flush();
|
||||
|
||||
in.close();
|
||||
out.close();
|
||||
err.close();
|
||||
|
||||
Reference in New Issue
Block a user