From fa3b1237be5032b2dfd205b4ea0a05b494abc9ff Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sat, 9 Apr 2016 18:23:59 +1000 Subject: [PATCH 1/2] Add License and File_id.diz --- LICENSE.txt | 27 +++++++++++++++++++++++++++ file_id.diz | 21 +++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 LICENSE.txt create mode 100644 file_id.diz diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..5328472 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,27 @@ + +MagickaBBS is distributed under the New BSD license: + +Copyright (c) 2016, Andrew Pamment +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Andrew Pamment nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY ANDREW PAMMENT ''AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL ANDREW PAMMENT BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/file_id.diz b/file_id.diz new file mode 100644 index 0000000..d361ca2 --- /dev/null +++ b/file_id.diz @@ -0,0 +1,21 @@ +. . . .__ .__ __. +|\/| _. _ * _.;_/ _. [__)[__)(__ +| |(_](_]|(_.| \(_] [__)[__).__) v0.1 a2 +-------._|---------------------------------- +Magicka BBS is a Free BBS System for Linux +and FreeBSD. While Still in the early stages +of development, we have most of the features +you find in modern BBS software. + + * FTN / WWIVnet Network Support + * Zmodem & Long filename Support + * Socket Inheritance and STDIO redirection + for doors. + * External Editor Support + * Compiles and runs on Raspberry Pi + * Some other stuff I forgot. + +THIS IS ALPHA SOFTWARE! If you're looking +for something different, this might be for +you. If you're looking for something +established, try Mystic, WWIV or Synchronet. From 5ff9abd99eab9e3583a39c06db154542a754f9f2 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sat, 9 Apr 2016 19:37:34 +1000 Subject: [PATCH 2/2] Pause timeout when in a door, so it doesn't disconnect immediatly on return --- bbs.c | 6 +++++- doors.c | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bbs.c b/bbs.c index 609f169..be554df 100644 --- a/bbs.c +++ b/bbs.c @@ -19,6 +19,7 @@ struct user_record *gUser; int gSocket; int usertimeout; +int timeoutpaused; struct fido_addr *parse_fido_addr(const char *str) { struct fido_addr *ret = (struct fido_addr *)malloc(sizeof(struct fido_addr)); @@ -89,7 +90,9 @@ void timer_handler(int signum) { } - usertimeout--; + if (timeoutpaused == 0) { + usertimeout--; + } if (usertimeout <= 0) { s_putstring(gSocket, "\r\n\r\nTimeout waiting for input..\r\n"); disconnect(gSocket); @@ -682,6 +685,7 @@ void runbbs(int socket, char *config_path) { gUser = NULL; gSocket = socket; usertimeout = 10; + timeoutpaused = 0; memset (&sa, 0, sizeof (sa)); sa.sa_handler = &timer_handler; diff --git a/doors.c b/doors.c index 87bd4bb..6c5caaa 100644 --- a/doors.c +++ b/doors.c @@ -23,6 +23,8 @@ extern int mynode; int running_door_pid = 0; int running_door = 0; +extern int timeoutpaused; + void doorchld_handler(int s) { // waitpid() might overwrite errno, so we save and restore it: @@ -136,6 +138,8 @@ void rundoor(int socket, struct user_record *user, char *cmd, int stdio) { struct winsize ws; struct sigaction sa; + timeoutpaused = 1; + if (write_door32sys(socket, user) != 0) { return; } @@ -223,6 +227,7 @@ void rundoor(int socket, struct user_record *user, char *cmd, int stdio) { sprintf(buffer, "%s %d %d", cmd, mynode, socket); system(buffer); } + timeoutpaused = 0; } int door_menu(int socket, struct user_record *user) {