From 26e86661ca8ca5b8ff9700a2816e216339530aac Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sun, 26 Mar 2017 20:25:07 +1000 Subject: [PATCH] overhaul of doors, possible breakage --- doors.c | 74 +++++++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 34 deletions(-) diff --git a/doors.c b/doors.c index cd85d35..30470d4 100644 --- a/doors.c +++ b/doors.c @@ -179,6 +179,10 @@ void runexternal(struct user_record *user, char *cmd, int stdio, char *argv[], c struct termios oldot; struct termios oldit2; + char inbuf[256]; + char outbuf[256]; + int h; + int g; timeoutpaused = 1; if (write_door32sys(user) != 0) { @@ -254,57 +258,59 @@ void runexternal(struct user_record *user, char *cmd, int stdio, char *argv[], c ret = select(t, &fdset, NULL, NULL, &thetimeout); if (ret > 0) { if (FD_ISSET(door_in, &fdset)) { - len = read(door_in, &c, 1); + len = read(door_in, inbuf, 256); if (len == 0) { close(master); disconnect("Socket Closed"); return; } - if (!raw) { - if (c == '\n' || c == '\0') { + g = 0; + for (h=0;h