attempt non canonical mode

This commit is contained in:
Andrew Pamment 2016-08-07 13:12:54 +10:00
parent d5312f78cf
commit 0d0222c7e7

10
main.c
View File

@ -22,6 +22,7 @@
#else #else
# include <libutil.h> # include <libutil.h>
#endif #endif
#include <termios.h>
#include "bbs.h" #include "bbs.h"
#include "inih/ini.h" #include "inih/ini.h"
@ -473,6 +474,9 @@ void serverssh(int port) {
ssh_event event; ssh_event event;
short events; short events;
ssh_message message; ssh_message message;
struct termios tios;
err = ssh_init(); err = ssh_init();
if (err == -1) { if (err == -1) {
fprintf(stderr, "Error starting SSH server.\n"); fprintf(stderr, "Error starting SSH server.\n");
@ -554,9 +558,13 @@ void serverssh(int port) {
ip = ssh_getip(p_ssh_session); ip = ssh_getip(p_ssh_session);
bbs_pid = forkpty(&fd, NULL, NULL, NULL); bbs_pid = forkpty(&fd, NULL, NULL, NULL);
if (bbs_pid == 0) { if (bbs_pid == 0) {
setvbuf(stdin,NULL,_IONBF,0); tcgetattr(master, &tios);
tios.c_lflag &= ~(ICANON | ECHO | ECHONL);
tcsetattr(master, TCSAFLUSH, &tios);
runbbs_ssh(ip); runbbs_ssh(ip);
exit(0); exit(0);
} }