From c0102a334a674788c41d50cfc0cb7e3ed079725d Mon Sep 17 00:00:00 2001 From: Rob Swindell <rob@synchro.net> Date: Sat, 5 Nov 2022 15:23:30 -0700 Subject: [PATCH] Move the configuration shell checking to the terminal server Loading empty main.ini file results in no (0) command shells be configured, but this scenario needs to be supported if we are to be able to run upgrade_to_v320.js via jsexec when there is no ctrl/main.ini file. Only the terminal server cares about command shells, so just move the checking and critical-error reporting there. --- src/sbbs3/main.cpp | 6 ++++++ src/sbbs3/scfglib1.c | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp index 8eeddb931c..702b016250 100644 --- a/src/sbbs3/main.cpp +++ b/src/sbbs3/main.cpp @@ -4942,6 +4942,12 @@ void bbs_thread(void* arg) return; } + if(scfg.total_shells < 1) { + lprintf(LOG_CRIT, "At least one command shell must be configured (e.g. in SCFG->Command Shells)"); + cleanup(1); + return; + } + if((t=checktime())!=0) { /* Check binary time */ lprintf(LOG_ERR,"!TIME PROBLEM (%ld)",t); } diff --git a/src/sbbs3/scfglib1.c b/src/sbbs3/scfglib1.c index d847e41b8b..31db2687b9 100644 --- a/src/sbbs3/scfglib1.c +++ b/src/sbbs3/scfglib1.c @@ -264,12 +264,6 @@ BOOL read_main_cfg(scfg_t* cfg, char* error, size_t maxerrlen) str_list_t shell_list = iniGetParsedSectionList(sections, "shell:"); cfg->total_shells = (uint16_t)strListCount(shell_list); - #ifdef SBBS - if(!cfg->total_shells) { - safe_snprintf(error, maxerrlen,"At least one command shell must be configured."); - return(FALSE); - } - #endif if(cfg->total_shells) { if((cfg->shell=(shell_t **)malloc(sizeof(shell_t *)*cfg->total_shells))==NULL) -- GitLab