Typically LF is sent when Return key is hit. But for sshd servers that
sent us via ANSI escape sequence that CRLF is to be sent, ssh.exe client
will do so which is used commonly used by sshd servers in Windows - like
our own win32 port sshd.
Console API is now used for interactive tty mode. Thus ssh.exe client
can now pass each character to remote side as one types so that programs
like more works correctly. Control-c now will stop the remote program
instead of exiting the ssh.exe.
Fixes issues like cmd.exe shell not handling backspace, control-c.
Control-c is still a work in progress and will be fixed but backspace
processing works. This work when complete will make cmd.exe shell and
powershell work better for interactive users.
CAUTION: untested as my openssl installation has gone insane.
If the incoming "hScreen" parameter is NULL, a new PSCREEN_RECORD is
allocated to use in its place.
However, if the allocation of the "pScreenBuf" member variable fails,
the function returns, potentially leaking the newly allocated
PSCREEN_RECORD.
This fix first checks to see if the functions owns the "pScreenRec", and
if so, frees it before returning.
There shouldn't be any "*" when entering a password or passphrase for
better security. Linux/Unix openssh works the same way - without any
"*". Great suggestion by Mark Hahnel in comments of Issue #5
This was not implemented before in Win32. !takes to the windows shell
and !command runs the command in Windows shell. exit brings the user
back to sftp like in Linux/Unix shell.
USERDOMAIN environment variable was not being updated by sshd before s
shell or subsystem was started, hence it was left pointing to local
logged on user;'s domain. Now we set it correctly for the remote ssh
user's domain or local account
Usability improvement fix ( issue #6 ). sshd.exe puts remote user and
host info on the console prompt. user@target $P$G is set as cmd.exe
PROMPT via environment variable.
Fix the reported problem #7. Remote directory set to remote user's home
directory like its is done on openssh on all platforms. Users can then
cd to "Documents" directory. Actual fix was to expand "." to user's home
directory so that pwd showed it correctly rather than just showing a
dot.
Pty mode code added so that sshd server can do remote echo, backspace
processing. etc and ssh.exe client does not have to do local echo. We
can enrich it in future for more features and allowing programs like
powershell to run interactive. Pty mode is central for interactive use
and will be built using Windows console instead of termios that
Linux/Unix uses.
Fixed this #3 problem ticket. We determine domain hostname which created
the authenticated token from the token and then pass it to
LoadUserProfile() Windows API which now correctly creates the user's
home directory name and profile folder.
Will fix problems like new hosts to be added to known_hosts file which
was failing when .ssh directory did not exist. Also default user's
public keys like id_rsa pairs are picked up properly from the user's
homdir/.ssh base.
Whether LF should be changed to CR-LF is determined by what the remote
sshd server wants. Sequences like ESC[20h is sent by sshd servers in pty
ANSI mode. Unix servers usually want LF and Windows servers CR-LF. Added
simple ANSI data check now for pty use in interactive mode. Need to
expand to simple ANSI engine in future for processing other ANSI
terminal attributes.
pty and tty support was not enabled or working in the code. Without pty
support, ssh client was very non functional - e.g. openssh linux server
prompt would not come through. Now ssh client works much better in
interactive mode ( uses pty).
NoMachine did not finish coding child process ending detection logic.
Added the needed code so that child process handle is added to the
handles that WaitForMultipleObjects() waits for in nomachine select()
implementation in socket.c. Otherwise select() would be stuck in
read/write dectection even when the process of interest has exited.
Fixed sftp-server put verb not working. Tested from out sftp client and
linux fedora openssh 6.9p1 sftp clients in transferring small and large
files using both get and put verbs.
sftp-server.exe code modified to work in Windows as NoMachine never
finished it to work. I/O handling to work as a subsystem and
openssh7.1p1 sshbuf_new() buffer system code had to be used. sshd_config
file need location of sftp subsystem to be specified.