diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eb48e4785049cf76ab210f68af16f9d051aed637..f591403df17f1ff373d33bbf70d1f7edbcacdeed 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,11 +9,21 @@ When submitting merge requests to existing files, unless you have prior agreemen * Do not include changes that are not relevant to the merge request description/message * Keep merge requests to a single topical change (e.g. don't combine new features with bug fixes with typo-fixes and style changes) +### Commit content In general, if it's a large set of changes, your best bet of getting it accepted and merged into the repo would be to discuss the concept of the change with the developers in the [Synchronet Programming conference](http://web.synchro.net/?page=001-forum.ssjs&sub=syncprog) **first**. When modifying the C/C++ source files: -* Do not call functions from `ctype.h` (e.g. `isprint`, `isspace`, `isdigit`, etc.) - use the `gen_defs.h IS_*` macros instead. +* Do not call functions from `ctype.h` (e.g. `isprint()`, `isspace()`, `isdigit()`, etc.) - use the `xpdev/gen_defs.h IS_*` macros instead. +* Use safe string handling (e.g. xpdev's `SAFECOPY()` instead of `strcpy()`, `SAFEPRINTF()` or `safe_snprintf()` instead of `sprintf()`). +### Branches +Only approved and authenticaed "developers" can create new branches in the `main/sbbs`repo. If, as a developer, you are creating a new branch in the `main/sbbs` repository, use the branch naming scheme: `<your-name>/<topic>`, where *your-name* is your abbreviated name, user-name, or alias and *topic* helps to identify the intended purpose of the branch. Branches created in user repositories (e.g. forks of main/sbbs) need not contain the `<your-name>/` prefix. + +### Commit messages +* Try to keep the commit title (first line) to 70 characters or less. +* When a comment is related to an [issue](https://gitlab.synchro.net/main/sbbs/-/issues), use the proper commit message syntax foir automatic issue management as documented [here](https://docs.gitlab.com/ce/user/project/issues/managing_issues.html#closing-issues-automatically). + +### Other types of contributions If you were interested in contributing money, not code, then paypal to rob at synchro dot net. Thank you for contributing! \ No newline at end of file diff --git a/exec/load/install-3rdp-xtrn.js b/exec/load/install-3rdp-xtrn.js index 8988f7066fa6b63e8ef85a9945a38f12f3d7b212..68305e6a3a5d115e70967ef77dbbc183bc49415f 100755 --- a/exec/load/install-3rdp-xtrn.js +++ b/exec/load/install-3rdp-xtrn.js @@ -18,9 +18,9 @@ function scan(options) if(options === undefined) options = {}; if(!options.src_dir) - options.src_dir = "../xtrn/3rdp-install/"; + options.src_dir = fullpath(system.ctrl_dir + "../xtrn/3rdp-install/"); if(!options.xtrn_dir) - options.xtrn_dir = "../xtrn/"; + options.xtrn_dir = fullpath(system.ctrl_dir + "../xtrn/"); var out = []; var exe_list = {}; diff --git a/exec/load/uifcdefs.js b/exec/load/uifcdefs.js old mode 100644 new mode 100755 index c49a7e1a5e7cc6af5fdbee2127b3ca3b6a448290..29a6a83fec3aa2643429044a78b9fdaea2b45410 --- a/exec/load/uifcdefs.js +++ b/exec/load/uifcdefs.js @@ -1,14 +1,10 @@ -/* uifcdefs.js */ - /* Synchronet User Interface constants */ -/* $Id: uifcdefs.js,v 1.3 2009/01/30 06:46:34 deuce Exp $ */ - /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2005 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -17,29 +13,14 @@ * See the GNU General Public License for more details: gpl.txt or * * http://www.fsf.org/copyleft/gpl.html * * * - * Anonymous FTP access to the most recent released source is available at * - * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * - * * - * Anonymous CVS access to the development source and modification history * - * is available at cvs.synchro.net:/cvsroot/sbbs, example: * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login * - * (just hit return, no password is necessary) * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src * - * * * For Synchronet coding style and modification guidelines, see * * http://www.synchro.net/source.html * * * - * You are encouraged to submit any modifications (preferably in Unix diff * - * format) via e-mail to mods@synchro.net * - * * * Note: If this box doesn't appear square, then you need to fix your tabs. * ****************************************************************************/ /* This file must remain in-sync with src/uifc/uifc.h */ -/* Would rather use const than var, but end up with redeclaration errors. */ - - const MAX_OPTS = 10000; const MSK_ON = 0xf0000000; const MSK_OFF = 0x0fffffff; @@ -100,7 +81,12 @@ const WIN_FIXEDHEIGHT= (1<<25); /* Use list_height from uifc struct */ const WIN_UNGETMOUSE= (1<<26); /* If the mouse is clicked outside the window, */ /* Put the mouse event back into the event queue */ const WIN_EDIT = (1<<27); /* Allow F2 to edit a menu item */ -const WIN_EDITACT = (1<<28); /* Remain active after edit key */ +const WIN_PASTEXTR = (1<<28); /* Allow paste into extra (blank) item */ +const WIN_INACT = (1<<29); /* Draw window inactive... intended for use with WIN_IMM */ +const WIN_POP = (1<<30); /* Exit the list. Act as though ESC was pressed. */ + /* Intended for use after a WIN_EXTKEYS or WIN_DYN */ +const WIN_SEL = (1<<31); /* Exit the list. Act as though ENTER was pressed. */ + /* Intended for use after a WIN_EXTKEYS or WIN_DYN */ const WIN_MID = WIN_L2R|WIN_T2B;/* Place window in middle of screen */ @@ -119,4 +105,6 @@ const K_DEUCEEXIT = (1<<14); /* Return whenever Deuce wants to exit */ const K_MOUSEEXIT = (1<<15); /* Returns when mouse is clicked outside of */ /* Input area (NOT outside of window!) */ /* And ungets the mouse event. */ +const K_PASSWORD = (1<<16); /* Does not display text while editing */ +const K_FIND = (1<<17); /* Don't set the "changes" flag */ /********************************************/ diff --git a/exec/logon.js b/exec/logon.js index 8af08c76ce14ddac2890f0492ef81049a1bd9556..74cbccef04da3427b6fdcaa3d3ae082b7b782b26 100644 --- a/exec/logon.js +++ b/exec/logon.js @@ -42,6 +42,7 @@ if(options.email_validation == true) { // Check if we're being asked to auto-run an external (web interface external programs section uses this) if ((options.rlogin_auto_xtrn) && (bbs.sys_status & SS_RLOGIN) && (console.terminal.indexOf("xtrn=") === 0)) { var external_code = console.terminal.substring(5); + bbs.node_action = NODE_XTRN; if (!bbs.exec_xtrn(external_code)) { alert(log(LOG_ERR,"!ERROR Unable to launch external: '" + external_code + "'")); } diff --git a/exec/xtrn_sec.js b/exec/xtrn_sec.js index 95aa262d8b42b327a66bf5ac3242f4101cec6623..e2dd5b6ef231cdd2313fb63bdad91eb54fb3d917 100644 --- a/exec/xtrn_sec.js +++ b/exec/xtrn_sec.js @@ -9,10 +9,10 @@ "use strict"; -load("sbbsdefs.js"); +require("sbbsdefs.js", "P_NOERROR"); /* text.dat entries */ -load("text.js"); +require("text.js", "XtrnProgLstFmt"); /* See if an xtrn section code was passed as an argument */ /* must parse argv before calling load() */ @@ -123,17 +123,15 @@ function external_program_menu(xsec) var secnum = xtrn_area.sec_list[xsec].number+1; var seccode = xtrn_area.sec_list[xsec].code; - if(bbs.menu_exists("xtrn" + secnum + "_head")) { - bbs.menu("xtrn" + secnum + "_head"); + if(!bbs.menu("xtrn" + secnum + "_head", P_NOERROR) && + !bbs.menu("xtrn" + seccode + "_head", P_NOERROR)) { + bbs.menu("xtrn_head", P_NOERROR); } - else if(bbs.menu_exists("xtrn" + seccode + "_head")) { - bbs.menu("xtrn" + seccode + "_head"); - } - if(bbs.menu_exists("xtrn" + secnum)) { - bbs.menu("xtrn" + secnum); - } - else if(bbs.menu_exists("xtrn" + seccode)) { - bbs.menu("xtrn" + seccode); + if(bbs.menu("xtrn" + secnum, P_NOERROR) || bbs.menu("xtrn" + seccode, P_NOERROR)) { + if(!bbs.menu("xtrn" + secnum + "_tail", P_NOERROR) && + !bbs.menu("xtrn" + seccode + "_tail", P_NOERROR)) { + bbs.menu("xtrn_tail", P_NOERROR); + } } else { var multicolumn = options.multicolumn && prog_list.length > options.singlecolumn_height; @@ -182,6 +180,10 @@ function external_program_menu(xsec) } console.crlf(); } + if(!bbs.menu("xtrn" + secnum + "_tail", P_NOERROR) + && !bbs.menu("xtrn" + seccode + "_tail", P_NOERROR)) { + bbs.menu("xtrn_tail", P_NOERROR); + } bbs.node_sync(); console.mnemonics(options.which); } @@ -220,37 +222,38 @@ function external_section_menu() bbs.node_action=NODE_XTRN; bbs.node_sync(); + if(options.clear_screen) + console.clear(LIGHTGRAY); + + bbs.menu("xtrn_sec_head", P_NOERROR); + if(bbs.menu_exists("xtrn_sec")) { bbs.menu("xtrn_sec"); - xsec=console.getnum(sec_list.length); - if(xsec<=0) - break; - xsec--; + bbs.menu("xtrn_sec_tail", P_NOERROR); } else { - if(options.clear_screen) - console.clear(LIGHTGRAY); - if(options.sort) sec_list.sort(sort_by_name); - printf(options.section_header_fmt, options.section_header_title); - + printf(options.section_header_fmt.replace('\x01l', ''), options.section_header_title); for (i = 0; i < sec_list.length; i++) { console.add_hotspot(i+1); printf(options.section_fmt, i + 1, sec_list[i].name); } + bbs.menu("xtrn_sec_tail", P_NOERROR); + bbs.node_sync(); console.mnemonics(format(options.section_which, xsec + 1)); - - xsec = console.getnum(sec_list.length, xsec + 1); - if(xsec < 1) - break; - xsec--; } - external_program_menu(sec_list[xsec].index); + bbs.node_sync(); + xsec=console.getnum(sec_list.length); + if(xsec<=0) + break; + xsec--; + + external_program_menu(sec_list[xsec].index); } } diff --git a/install/GNUmakefile b/install/GNUmakefile index 303c84763b465ca2c0b4f25547e4c3c33710e7b3..7b6abd6a4ce375d8e5642c4e61e1938533cfeff0 100644 --- a/install/GNUmakefile +++ b/install/GNUmakefile @@ -12,6 +12,7 @@ # SYMLINK = Don't copy binaries, rather create symlinks in $(SBBSDIR)/exec # SBBSDIR = Directory to do install to # REPODIR = Directory where source files are cloned +# NOCAP = Set to defeat sbbs3 bind-capabilities (setcap) build target on Linux # bcc = Set to use Borland compiler # os = Set to the OS name (Not required) # SBBSUSER = Owner for the installed files @@ -79,6 +80,12 @@ endif MKFLAGS += os=$(os) +ifndef NOCAP +ifeq (($os),linux) + SETCAP := setcap +endif +endif + ifdef DEBUG BUILD := debug MKFLAGS += DEBUG=1 @@ -147,11 +154,7 @@ binaries: sbbs3 gtkuseredit gtkchat gtkmonitor gtkuserlist syncview sexpots externals: sbj dpoker tbd sbbs3: src -ifeq ($(os),linux) - $(MAKE) -C $(REPODIR)/src/sbbs3 $(MKFLAGS) setcap -else - $(MAKE) -C $(REPODIR)/src/sbbs3 $(MKFLAGS) -endif + $(MAKE) -C $(REPODIR)/src/sbbs3 $(MKFLAGS) $(SETCAP) sexpots: src $(MAKE) -C $(REPODIR)/src/sexpots $(MKFLAGS) @@ -253,7 +256,8 @@ endif src: $(REPODIR) -run: $(SBBSDIR)/ctrl $(SBBSDIR)/docs $(SBBSDIR)/exec $(SBBSDIR)/node1 $(SBBSDIR)/text $(SBBSDIR)/web $(SBBSDIR)/webv4 $(SBBSDIR)/xtrn +run: $(SBBSDIR)/ctrl $(SBBSDIR)/docs $(SBBSDIR)/exec $(SBBSDIR)/text $(SBBSDIR)/web $(SBBSDIR)/webv4 $(SBBSDIR)/xtrn \ + $(SBBSDIR)/node1 $(SBBSDIR)/node2 $(SBBSDIR)/node3 $(SBBSDIR)/node4 $(SBBSDIR)/ctrl: $(REPODIR) cp -r $(REPODIR)/ctrl $(SBBSDIR) @@ -265,7 +269,16 @@ $(SBBSDIR)/exec: $(REPODIR) $(INSBIN) $(REPODIR)/exec $(SBBSDIR) $(SBBSDIR)/node1: $(REPODIR) - cp -r $(REPODIR)/node1 $(SBBSDIR) + cp -r $(REPODIR)/node1 $@ + +$(SBBSDIR)/node2: $(REPODIR) + cp -r $(REPODIR)/node1 $@ + +$(SBBSDIR)/node3: $(REPODIR) + cp -r $(REPODIR)/node1 $@ + +$(SBBSDIR)/node4: $(REPODIR) + cp -r $(REPODIR)/node1 $@ $(SBBSDIR)/text: $(REPODIR) $(INSBIN) $(REPODIR)/text $(SBBSDIR) diff --git a/src/sbbs3/js_bbs.cpp b/src/sbbs3/js_bbs.cpp index e21ddaf9b2da36364a9da629bae103f4bdc0f252..3d43278468cf5541d9797d981d5a71c5bdc3423a 100644 --- a/src/sbbs3/js_bbs.cpp +++ b/src/sbbs3/js_bbs.cpp @@ -1351,24 +1351,25 @@ js_exec_xtrn(JSContext *cx, uintN argc, jsval *arglist) JS_SET_RVAL(cx, arglist, JSVAL_VOID); - if(argc) { - if(JSVAL_IS_STRING(argv[0])) { - JSVALUE_TO_ASTRING(cx,argv[0],code, LEN_CODE+2, NULL); - if(code==NULL) - return(JS_FALSE); + if(!js_argc(cx, argc, 1)) + return JS_FALSE; - for(i=0;i<sbbs->cfg.total_xtrns;i++) - if(!stricmp(sbbs->cfg.xtrn[i]->code,code)) - break; - } else if(JSVAL_IS_NUMBER(argv[0])) { - if(!JS_ValueToECMAUint32(cx,argv[0],&i)) - return JS_FALSE; - } + if(JSVAL_IS_STRING(argv[0])) { + JSVALUE_TO_ASTRING(cx,argv[0],code, LEN_CODE+2, NULL); + if(code==NULL) + return(JS_FALSE); + + for(i=0;i<sbbs->cfg.total_xtrns;i++) + if(!stricmp(sbbs->cfg.xtrn[i]->code,code)) + break; + } else if(JSVAL_IS_NUMBER(argv[0])) { + if(!JS_ValueToECMAUint32(cx,argv[0],&i)) + return JS_FALSE; } if(i>=sbbs->cfg.total_xtrns) { - JS_SET_RVAL(cx, arglist, JSVAL_FALSE); - return(JS_TRUE); + JS_ReportError(cx, "Invalid external program specified"); + return JS_FALSE; } rc=JS_SUSPENDREQUEST(cx); diff --git a/src/sbbs3/js_global.c b/src/sbbs3/js_global.c index dc3c1e1fe24cbacbe4a7a2b7fe1a19477b2a26a8..650693355d0e98c3d67f553c76a504e99cc3ce88 100644 --- a/src/sbbs3/js_global.c +++ b/src/sbbs3/js_global.c @@ -4055,7 +4055,6 @@ js_resolve_ip(JSContext *cx, uintN argc, jsval *arglist) hints.ai_socktype = SOCK_STREAM; rc=JS_SUSPENDREQUEST(cx); if((result=getaddrinfo(p, NULL, &hints, &res))!=0) { - lprintf(LOG_ERR, "!ERROR resolve_ip %s failed with error %d",p, result); JS_RESUMEREQUEST(cx, rc); free(p); return JS_TRUE; diff --git a/src/sbbs3/js_system.c b/src/sbbs3/js_system.c index 583172f39bf81ebad9ea69e58a4f160b875698c1..6dea02881157acfb982f25dd10b6cf18f6bf566d 100644 --- a/src/sbbs3/js_system.c +++ b/src/sbbs3/js_system.c @@ -1,7 +1,4 @@ /* Synchronet JavaScript "system" Object */ -// vi: tabstop=4 - -/* $Id: js_system.c,v 1.179 2020/03/31 18:32:34 rswindell Exp $ */ /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * @@ -16,21 +13,9 @@ * See the GNU General Public License for more details: gpl.txt or * * http://www.fsf.org/copyleft/gpl.html * * * - * Anonymous FTP access to the most recent released source is available at * - * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * - * * - * Anonymous CVS access to the development source and modification history * - * is available at cvs.synchro.net:/cvsroot/sbbs, example: * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login * - * (just hit return, no password is necessary) * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src * - * * * For Synchronet coding style and modification guidelines, see * * http://www.synchro.net/source.html * * * - * You are encouraged to submit any modifications (preferably in Unix diff * - * format) via e-mail to mods@synchro.net * - * * * Note: If this box doesn't appear square, then you need to fix your tabs. * ****************************************************************************/ @@ -1148,9 +1133,13 @@ js_secondstr(JSContext *cx, uintN argc, jsval *arglist) JS_SET_RVAL(cx, arglist, JSVAL_NULL); - if(argc<1) - return(JS_TRUE); + if(!js_argc(cx, argc, 1)) + return JS_FALSE; + if(JSVAL_NULL_OR_VOID(argv[0])) { + JS_ReportError(cx, "Invalid argument"); + return JS_FALSE; + } JS_ValueToInt32(cx,argv[0],&t); sectostr(t,str); if((js_str = JS_NewStringCopyZ(cx, str))==NULL) @@ -1677,11 +1666,13 @@ js_new_user(JSContext *cx, uintN argc, jsval *arglist) return JS_FALSE; scfg_t* cfg = sys->cfg; - if(argc<1 || JSVAL_NULL_OR_VOID(argv[0])) { - JS_ReportError(cx,"Missing or invalid argument"); + if(!js_argc(cx, argc, 1)) return JS_FALSE; - } + if(JSVAL_NULL_OR_VOID(argv[0])) { + JS_ReportError(cx, "Invalid argument"); + return JS_FALSE; + } JSVALUE_TO_ASTRING(cx, argv[0], alias, LEN_ALIAS+2, NULL); rc=JS_SUSPENDREQUEST(cx); @@ -1839,9 +1830,13 @@ js_popen(JSContext *cx, uintN argc, jsval *arglist) JS_SET_RVAL(cx, arglist, JSVAL_VOID); - if(argc<1) - return(JS_TRUE); + if(!js_argc(cx, argc, 1)) + return JS_FALSE; + if(JSVAL_NULL_OR_VOID(argv[0])) { + JS_ReportError(cx, "Invalid argument"); + return JS_FALSE; + } if((array=JS_NewArrayObject(cx,0,NULL))==NULL) return(JS_FALSE); @@ -1934,9 +1929,13 @@ js_chkpid(JSContext *cx, uintN argc, jsval *arglist) JS_SET_RVAL(cx, arglist, JSVAL_FALSE); - if(argc<1) - return(JS_TRUE); + if(!js_argc(cx, argc, 1)) + return JS_FALSE; + if(JSVAL_NULL_OR_VOID(argv[0])) { + JS_ReportError(cx, "Invalid argument"); + return JS_FALSE; + } JS_ValueToInt32(cx,argv[0],&pid); rc=JS_SUSPENDREQUEST(cx); @@ -1955,9 +1954,13 @@ js_killpid(JSContext *cx, uintN argc, jsval *arglist) JS_SET_RVAL(cx, arglist, JSVAL_FALSE); - if(argc<1) - return(JS_TRUE); + if(!js_argc(cx, argc, 1)) + return JS_FALSE; + if(JSVAL_NULL_OR_VOID(argv[0])) { + JS_ReportError(cx, "Invalid argument"); + return JS_FALSE; + } JS_ValueToInt32(cx,argv[0],&pid); rc=JS_SUSPENDREQUEST(cx); @@ -1967,6 +1970,39 @@ js_killpid(JSContext *cx, uintN argc, jsval *arglist) return(JS_TRUE); } +static JSBool +js_text(JSContext *cx, uintN argc, jsval *arglist) +{ + JSObject* obj=JS_THIS_OBJECT(cx, arglist); + jsval* argv=JS_ARGV(cx, arglist); + uint32 i=0; + JS_SET_RVAL(cx, arglist, JSVAL_NULL); + + if(!js_argc(cx, argc, 1)) + return JS_FALSE; + + if(JSVAL_NULL_OR_VOID(argv[0])) { + JS_ReportError(cx, "Invalid argument"); + return JS_FALSE; + } + js_system_private_t* sys; + if((sys = (js_system_private_t*)js_GetClassPrivate(cx,obj,&js_system_class)) == NULL) + return JS_FALSE; + + if(sys->cfg == NULL || sys->cfg->text == NULL) + return JS_TRUE; + + if(!JS_ValueToECMAUint32(cx, argv[0], &i)) + return JS_FALSE; + + if(i > 0 && i <= TOTAL_TEXT) { + JSString* js_str = JS_NewStringCopyZ(cx, sys->cfg->text[i - 1]); + if(js_str==NULL) + return JS_FALSE; + JS_SET_RVAL(cx, arglist, STRING_TO_JSVAL(js_str)); + } + return JS_TRUE; +} static jsSyncMethodSpec js_system_functions[] = { #ifndef JSDOOR @@ -2097,6 +2133,10 @@ static jsSyncMethodSpec js_system_functions[] = { "returns <i>true</i> on success") ,315 }, + {"text", js_text, 1, JSTYPE_STRING, JSDOCSTR("number") + ,JSDOCSTR("returns specified text string from text.dat (like <tt>bbs.text()</tt>) or returns <i>null</i> upon error") + ,31802 + }, {0} }; diff --git a/src/sbbs3/js_uifc.c b/src/sbbs3/js_uifc.c index 5cc9b38dcffcb1f76cb0bba16e432be64bc72b96..c1b2881814d6f16d324735bf203e756603cc542d 100644 --- a/src/sbbs3/js_uifc.c +++ b/src/sbbs3/js_uifc.c @@ -2,8 +2,6 @@ /* Synchronet "uifc" (user interface) object */ -/* $Id: js_uifc.c,v 1.46 2020/04/12 20:30:47 rswindell Exp $ */ - /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * @@ -372,11 +370,11 @@ static jsSyncPropertySpec js_properties[] = { static char* uifc_prop_desc[] = { "uifc has been initialized" ,"current mode bits (see uifcdefs.js)" - ,"a change has occured in an input call. You are expected to set this to false before calling the input if you care about it." + ,"a change has occurred in an input call. You are expected to set this to false before calling the input if you care about it." ,"save buffer depth (advanced)" ,"current screen length" ,"current screen width" - ,"when WIN_FIXEDHEIGHT is set, specifies the hight used by a list method" + ,"when WIN_FIXEDHEIGHT is set, specifies the height used by a list method" ,"delay before a single ESC char is parsed and assumed to not be an ANSI sequence (advanced)" ,"text that will be displayed if F1 is pressed" ,"background colour" diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp index 7474f3b5286c702e5d8f8adf732d4660aae7d6e4..ddd9e1e2b057235b58233e4f97bad63e3fedb6a3 100644 --- a/src/sbbs3/main.cpp +++ b/src/sbbs3/main.cpp @@ -90,6 +90,8 @@ struct xpms_set *ts_set; static sbbs_t* sbbs=NULL; static scfg_t scfg; static char * text[TOTAL_TEXT]; +static scfg_t node_scfg[MAX_NODES]; +static char * node_text[MAX_NODES][TOTAL_TEXT]; static WORD first_node; static WORD last_node; static bool terminate_server=false; @@ -4917,6 +4919,12 @@ static void cleanup(int code) free_cfg(&scfg); free_text(text); + for(int i = 0; i < MAX_NODES; i++) { + free_text(node_text[i]); + free_cfg(&node_scfg[i]); + memset(&node_scfg[i], 0, sizeof(node_scfg[i])); + } + semfile_list_free(&recycle_semfiles); semfile_list_free(&shutdown_semfiles); semfile_list_free(&clear_attempts_semfiles); @@ -5317,23 +5325,6 @@ NO_SSH: YIELD(); if(protected_uint32_value(node_threads_running)==0) { /* check for re-run flags and recycle/shutdown sem files */ if(!(startup->options&BBS_OPT_NO_RECYCLE)) { - - bool rerun=false; - for(i=first_node;i<=last_node;i++) { - if(sbbs->getnodedat(i,&node,0)!=0) - continue; - if(node.misc&NODE_RRUN) { - sbbs->getnodedat(i,&node,1); - if(!rerun) - lprintf(LOG_INFO,"Node %d flagged for re-run",i); - rerun=true; - node.misc&=~NODE_RRUN; - sbbs->putnodedat(i,&node); - } - } - if(rerun) - break; - if((p=semfile_list_check(&initialized,recycle_semfiles))!=NULL) { lprintf(LOG_INFO,"Recycle semaphore file (%s) detected" ,p); @@ -5715,11 +5706,48 @@ NO_SSH: continue; } + // Load the configuration files for this node, only if/when needed/updated + scfg_t* cfg = &node_scfg[i - 1]; + if(cfg->size != sizeof(*cfg) || (node.misc & NODE_RRUN)) { + sbbs->bprintf("Loading configuration..."); + cfg->size = sizeof(*cfg); + cfg->node_num = i; + SAFECOPY(cfg->ctrl_dir, startup->ctrl_dir); + lprintf(LOG_INFO,"Node %d Loading configuration files from %s", cfg->node_num, cfg->ctrl_dir); + SAFECOPY(logstr,UNKNOWN_LOAD_ERROR); + if(!load_cfg(cfg, node_text[i - 1], TRUE, logstr)) { + lprintf(LOG_WARNING, "Node %d LOAD ERROR: %s, falling back to Node %d", cfg->node_num, logstr, first_node); + cfg->node_num = first_node; + if(!load_cfg(cfg, node_text[i - 1], TRUE, logstr)) { + lprintf(LOG_CRIT,"!ERROR %s",logstr); + lprintf(LOG_CRIT,"!FAILED to load configuration files"); + sbbs->bprintf("\r\nFAILED: %s", logstr); + client_off(client_socket); + SSH_END(client_socket); + close_socket(client_socket); + sbbs->getnodedat(cfg->node_num,&node,true); + node.status = NODE_WFC; + sbbs->putnodedat(cfg->node_num,&node); + continue; + } + cfg->node_num = i; // correct the node number + } + if(node.misc & NODE_RRUN) { + sbbs->getnodedat(cfg->node_num,&node,true); + node.misc &= ~NODE_RRUN; + sbbs->putnodedat(cfg->node_num,&node); + } + sbbs->bputs(crlf); + } + // Copy event last-run info from global config + for(int e=0; e < cfg->total_events && e < scfg.total_events; e++) + cfg->event[e]->last = scfg.event[e]->last; + node_socket[i-1]=client_socket; sbbs_t* new_node = new sbbs_t(/* node_num: */i, &client_addr, client_addr_len, host_name ,client_socket - ,&scfg, text, &client); + ,cfg, node_text[i-1], &client); new_node->client=client; #ifdef USE_CRYPTLIB diff --git a/src/sbbs3/sbbs.h b/src/sbbs3/sbbs.h index 18d963b305b19b3aec1d88488d4eb0d245cedbfd..5b754d2c953907161f05aeddcfc17d2100aa026a 100644 --- a/src/sbbs3/sbbs.h +++ b/src/sbbs3/sbbs.h @@ -1,6 +1,4 @@ /* Synchronet class (sbbs_t) definition and exported function prototypes */ -// vi: tabstop=4 -/* $Id: sbbs.h,v 1.583 2020/08/17 00:48:28 rswindell Exp $ */ /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * @@ -15,21 +13,9 @@ * See the GNU General Public License for more details: gpl.txt or * * http://www.fsf.org/copyleft/gpl.html * * * - * Anonymous FTP access to the most recent released source is available at * - * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * - * * - * Anonymous CVS access to the development source and modification history * - * is available at cvs.synchro.net:/cvsroot/sbbs, example: * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login * - * (just hit return, no password is necessary) * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src * - * * * For Synchronet coding style and modification guidelines, see * * http://www.synchro.net/source.html * * * - * You are encouraged to submit any modifications (preferably in Unix diff * - * format) via e-mail to mods@synchro.net * - * * * Note: If this box doesn't appear square, then you need to fix your tabs. * ****************************************************************************/ @@ -477,7 +463,7 @@ public: char *text[TOTAL_TEXT]; /* Text from ctrl\text.dat */ char *text_sav[TOTAL_TEXT]; /* Text from ctrl\text.dat */ - char dszlog[127]; /* DSZLOG enviornment variable */ + char dszlog[127]; /* DSZLOG environment variable */ int keybuftop,keybufbot; /* Keyboard input buffer pointers (for ungetkey) */ char keybuf[KEY_BUFSIZE]; /* Keyboard input buffer */ size_t keybuf_space(void); @@ -1041,7 +1027,6 @@ public: ,ulong misc); bool exec_xtrn(uint xtrnnum); /* Executes online external program */ bool user_event(user_event_t); /* Executes user event(s) */ - char xtrn_access(uint xnum); /* Does useron have access to xtrn? */ void moduserdat(uint xtrnnum); const char* xtrn_dropdir(const xtrn_t*, char* buf, size_t); diff --git a/src/sbbs3/scfg/scfg.c b/src/sbbs3/scfg/scfg.c index b27faa64d277d5d445f047928279b96d73d8fa45..8eeff19d424030b8f9d9c76d005c3adad8b4ce32 100644 --- a/src/sbbs3/scfg/scfg.c +++ b/src/sbbs3/scfg/scfg.c @@ -288,6 +288,7 @@ int main(int argc, char **argv) "-c = force color mode\n" "-m = force monochrome mode\n" "-e# = set escape delay to #msec\n" + "-insert = enable keyboard insert mode by default\n" "-import=<filename> = import a message area list file\n" "-faddr=<addr> = specify your FTN address for imported subs\n" "-misc=<value> = specify option flags for imported subs\n" diff --git a/src/sbbs3/scfg/scfgchat.c b/src/sbbs3/scfg/scfgchat.c index 9867776d61c3378dba09d21ebfe7aef515181005..63397d2939370b5d1e916cdff37078c8c9b5e9a8 100644 --- a/src/sbbs3/scfg/scfgchat.c +++ b/src/sbbs3/scfg/scfgchat.c @@ -1,5 +1,3 @@ -/* $Id: scfgchat.c,v 1.23 2018/06/21 20:22:07 rswindell Exp $ */ - /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * @@ -114,8 +112,8 @@ void page_cfg() done=0; while(!done) { k=0; - sprintf(opt[k++],"%-27.27s%.40s","Command Line",cfg.page[i]->cmd); - sprintf(opt[k++],"%-27.27s%.40s","Access Requirements",cfg.page[i]->arstr); + sprintf(opt[k++],"%-27.27s%s","Command Line",cfg.page[i]->cmd); + sprintf(opt[k++],"%-27.27s%s","Access Requirements",cfg.page[i]->arstr); sprintf(opt[k++],"%-27.27s%s","Intercept I/O" ,(cfg.page[i]->misc&XTRN_STDIO) ? "Standard" :cfg.page[i]->misc&XTRN_CONIO ? "Console":"No"); diff --git a/src/sbbs3/scfg/scfgmsg.c b/src/sbbs3/scfg/scfgmsg.c index 30183d39450f66aff51b39f023d2e4207c698397..1db94148cd8e5b4fee89064bd4a14e64c4fb172f 100644 --- a/src/sbbs3/scfg/scfgmsg.c +++ b/src/sbbs3/scfg/scfgmsg.c @@ -1,5 +1,3 @@ -/* $Id: scfgmsg.c,v 1.74 2020/08/18 06:03:09 rswindell Exp $ */ - /* Configuring Message Options and Message Groups (but not sub-boards) */ /**************************************************************************** @@ -642,7 +640,7 @@ void msgs_cfg() sprintf(opt[j++],"%-27.27s%s","Long Name",cfg.grp[grpnum]->lname); sprintf(opt[j++],"%-27.27s%s","Short Name",cfg.grp[grpnum]->sname); sprintf(opt[j++],"%-27.27s%s","Internal Code Prefix",cfg.grp[grpnum]->code_prefix); - sprintf(opt[j++],"%-27.27s%.40s","Access Requirements" + sprintf(opt[j++],"%-27.27s%s","Access Requirements" ,cfg.grp[grpnum]->arstr); sprintf(opt[j++],"%-27.27s%s","Sort Group by Sub-board", area_sort_desc[cfg.grp[grpnum]->sort]); strcpy(opt[j++],"Clone Options"); diff --git a/src/sbbs3/scfg/scfgnet.c b/src/sbbs3/scfg/scfgnet.c index d2305c2e6eb69a0f059d6999c6d9e2784da3507b..f002815f0858c8a2f0210fc7226c9de859a5365a 100644 --- a/src/sbbs3/scfg/scfgnet.c +++ b/src/sbbs3/scfg/scfgnet.c @@ -1,6 +1,3 @@ -/* $Id: scfgnet.c,v 1.49 2020/05/01 17:21:48 rswindell Exp $ */ -// vi: tabstop=4 - /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * @@ -14,21 +11,9 @@ * See the GNU General Public License for more details: gpl.txt or * * http://www.fsf.org/copyleft/gpl.html * * * - * Anonymous FTP access to the most recent released source is available at * - * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * - * * - * Anonymous CVS access to the development source and modification history * - * is available at cvs.synchro.net:/cvsroot/sbbs, example: * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login * - * (just hit return, no password is necessary) * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src * - * * * For Synchronet coding style and modification guidelines, see * * http://www.synchro.net/source.html * * * - * You are encouraged to submit any modifications (preferably in Unix diff * - * format) via e-mail to mods@synchro.net * - * * * Note: If this box doesn't appear square, then you need to fix your tabs. * ****************************************************************************/ @@ -293,13 +278,13 @@ void net_cfg() strcat(tmp, ", ..."); sprintf(opt[i++],"%-33.33s%s" ,"System Addresses",tmp); - sprintf(opt[i++],"%-33.33s%.40s" + sprintf(opt[i++],"%-33.33s%s" ,"Default Origin Line", cfg.origline); - sprintf(opt[i++],"%-33.33s%.40s" + sprintf(opt[i++],"%-33.33s%s" ,"NetMail Semaphore",cfg.netmail_sem); - sprintf(opt[i++],"%-33.33s%.40s" + sprintf(opt[i++],"%-33.33s%s" ,"EchoMail Semaphore",cfg.echomail_sem); - sprintf(opt[i++],"%-33.33s%.40s" + sprintf(opt[i++],"%-33.33s%s" ,"NetMail Directory",cfg.netmail_dir); sprintf(opt[i++],"%-33.33s%s" ,"Allow Sending of NetMail" @@ -652,9 +637,9 @@ void net_cfg() i=0; sprintf(opt[i++],"%-27.27s%s" ,"System Address",cfg.sys_inetaddr); - sprintf(opt[i++],"%-27.27s%.40s" + sprintf(opt[i++],"%-27.27s%s" ,"Inbound E-mail Semaphore",cfg.smtpmail_sem); - sprintf(opt[i++],"%-27.27s%.40s" + sprintf(opt[i++],"%-27.27s%s" ,"Outbound E-mail Semaphore",cfg.inetmail_sem); sprintf(opt[i++],"%-27.27s%s" ,"Allow Sending of E-mail" @@ -839,9 +824,9 @@ void qhub_edit(int num) while(!done) { i=0; sprintf(opt[i++],"%-27.27s%s","Hub System ID",cfg.qhub[num]->id); - sprintf(opt[i++],"%-27.27s%.40s","Pack Command Line",cfg.qhub[num]->pack); - sprintf(opt[i++],"%-27.27s%.40s","Unpack Command Line",cfg.qhub[num]->unpack); - sprintf(opt[i++],"%-27.27s%.40s","Call-out Command Line",cfg.qhub[num]->call); + sprintf(opt[i++],"%-27.27s%s","Pack Command Line",cfg.qhub[num]->pack); + sprintf(opt[i++],"%-27.27s%s","Unpack Command Line",cfg.qhub[num]->unpack); + sprintf(opt[i++],"%-27.27s%s","Call-out Command Line",cfg.qhub[num]->call); if(cfg.qhub[num]->node == NODE_ANY) SAFECOPY(str, "Any"); else diff --git a/src/sbbs3/scfg/scfgnode.c b/src/sbbs3/scfg/scfgnode.c index 54c80f74ea3d88ecebd4449270bff7c3491c6fdc..b553759f581a4380a6c701bc20c2f122ee92537c 100644 --- a/src/sbbs3/scfg/scfgnode.c +++ b/src/sbbs3/scfg/scfgnode.c @@ -1,5 +1,3 @@ -/* $Id: scfgnode.c,v 1.37 2020/08/08 19:24:27 rswindell Exp $ */ - /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * @@ -13,24 +11,12 @@ * See the GNU General Public License for more details: gpl.txt or * * http://www.fsf.org/copyleft/gpl.html * * * - * Anonymous FTP access to the most recent released source is available at * - * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * - * * - * Anonymous CVS access to the development source and modification history * - * is available at cvs.synchro.net:/cvsroot/sbbs, example: * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login * - * (just hit return, no password is necessary) * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src * - * * * For Synchronet coding style and modification guidelines, see * * http://www.synchro.net/source.html * * * - * You are encouraged to submit any modifications (preferably in Unix diff * - * format) via e-mail to mods@synchro.net * - * * * Note: If this box doesn't appear square, then you need to fix your tabs. * - ****************************************************************************/ - + ****************************************************************************/ + #include "scfg.h" /* These correlate with the LOG_* definitions in syslog.h/gen_defs.h */ @@ -70,9 +56,6 @@ void node_menu() "This is the list of configured terminal server nodes. A node is required\n" "for each supported simultaneous 'caller'.\n" "\n" - "`Note:` The `FirstNode` (e.g. Node 1) configuration settings are used for\n" - " all the nodes supported by a single terminal server instance.\n" - "\n" "`Note:` When nodes are added to this list, the `LastNode` value must be\n" " adjusted accordingly. See the `ctrl/sbbs.ini` file for more details.\n" "\n" @@ -184,7 +167,7 @@ void node_cfg() while(1) { i=0; sprintf(opt[i++],"%-27.27s%s","Phone Number",cfg.node_phone); - sprintf(opt[i++],"%-27.27s%.40s","Logon Requirements",cfg.node_arstr); + sprintf(opt[i++],"%-27.27s%s","Logon Requirements",cfg.node_arstr); strcpy(opt[i++],"Toggle Options..."); strcpy(opt[i++],"Advanced Options..."); opt[i][0]=0; @@ -192,9 +175,7 @@ void node_cfg() uifc.helpbuf= "`Node Configuration:`\n" "\n" - "The configuration settings of the `FirstNode` will determine the behavior\n" - "of all nodes of a single terminal server instance (through `LastNode`).\n" - "See the `ctrl/sbbs.ini` file for details.\n" + "Configuration settings specific to the selected node.\n" ; switch(uifc.list(WIN_ACT|WIN_CHE|WIN_BOT|WIN_RHT,0,0,60,&node_dflt,0 ,str,opt)) { @@ -390,9 +371,9 @@ void node_cfg() ,cfg.sec_warn); sprintf(opt[i++],"%-27.27s%u seconds","Inactivity Disconnection" ,cfg.sec_hangup); - sprintf(opt[i++],"%-27.27s%.40s","Daily Event",cfg.node_daily); - sprintf(opt[i++],"%-27.27s%.40s","Node Directory",cfg.node_path[cfg.node_num-1]); - sprintf(opt[i++],"%-27.27s%.40s","Text Directory",cfg.text_dir); + sprintf(opt[i++],"%-27.27s%s","Daily Event",cfg.node_daily); + sprintf(opt[i++],"%-27.27s%s","Node Directory",cfg.node_path[cfg.node_num-1]); + sprintf(opt[i++],"%-27.27s%s","Text Directory",cfg.text_dir); opt[i][0]=0; uifc.helpbuf= "`Node Advanced Options:`\n" diff --git a/src/sbbs3/scfg/scfgsub.c b/src/sbbs3/scfg/scfgsub.c index 5e0cb7fae8db281f5ffca50da8a7eb977429b70d..c4e5663c98da6f23f84def6232cc67b0b8efad66 100644 --- a/src/sbbs3/scfg/scfgsub.c +++ b/src/sbbs3/scfg/scfgsub.c @@ -1,5 +1,3 @@ -/* $Id: scfgsub.c,v 1.62 2020/05/27 02:49:22 rswindell Exp $ */ - /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * @@ -13,21 +11,9 @@ * See the GNU General Public License for more details: gpl.txt or * * http://www.fsf.org/copyleft/gpl.html * * * - * Anonymous FTP access to the most recent released source is available at * - * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * - * * - * Anonymous CVS access to the development source and modification history * - * is available at cvs.synchro.net:/cvsroot/sbbs, example: * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login * - * (just hit return, no password is necessary) * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src * - * * * For Synchronet coding style and modification guidelines, see * * http://www.synchro.net/source.html * * * - * You are encouraged to submit any modifications (preferably in Unix diff * - * format) via e-mail to mods@synchro.net * - * * * Note: If this box doesn't appear square, then you need to fix your tabs. * ****************************************************************************/ @@ -344,15 +330,15 @@ void sub_cfg(uint grpnum) sprintf(opt[n++],"%-27.27s%s%s","Internal Code" ,cfg.grp[cfg.sub[i]->grp]->code_prefix, cfg.sub[i]->code_suffix); sprintf(opt[n++],"%-27.27s%s","Newsgroup Name",cfg.sub[i]->newsgroup); - sprintf(opt[n++],"%-27.27s%.40s","Access Requirements" + sprintf(opt[n++],"%-27.27s%s","Access Requirements" ,cfg.sub[i]->arstr); - sprintf(opt[n++],"%-27.27s%.40s","Reading Requirements" + sprintf(opt[n++],"%-27.27s%s","Reading Requirements" ,cfg.sub[i]->read_arstr); - sprintf(opt[n++],"%-27.27s%.40s","Posting Requirements" + sprintf(opt[n++],"%-27.27s%s","Posting Requirements" ,cfg.sub[i]->post_arstr); - sprintf(opt[n++],"%-27.27s%.40s","Operator Requirements" + sprintf(opt[n++],"%-27.27s%s","Operator Requirements" ,cfg.sub[i]->op_arstr); - sprintf(opt[n++],"%-27.27s%.40s","Moderated Posting User" + sprintf(opt[n++],"%-27.27s%s","Moderated Posting User" ,cfg.sub[i]->mod_arstr); if(cfg.sub[i]->maxmsgs) sprintf(str, "%"PRIu32, cfg.sub[i]->maxmsgs); @@ -1421,8 +1407,8 @@ void sub_cfg(uint grpnum) sprintf(str,"%ssubs/",cfg.data_dir); else strcpy(str,cfg.sub[i]->data_dir); - sprintf(opt[n++],"%-27.27s%.40s","Storage Directory",str); - sprintf(opt[n++],"%-27.27s%.40s","Semaphore File",cfg.sub[i]->post_sem); + sprintf(opt[n++],"%-27.27s%s","Storage Directory",str); + sprintf(opt[n++],"%-27.27s%s","Semaphore File",cfg.sub[i]->post_sem); sprintf(opt[n++],"%-27.27s%u","Pointer File Index",cfg.sub[i]->ptridx); sprintf(opt[n++],"%-27.27sNow %u / Was %u","Sub-board Index", i, cfg.sub[i]->subnum); opt[n][0]=0; diff --git a/src/sbbs3/scfg/scfgsys.c b/src/sbbs3/scfg/scfgsys.c index 7268b9e9ef9656f4e301de9cdd1445d43bb696f7..7cf34735cfeb179292d3c0d50b26014a7712dd81 100644 --- a/src/sbbs3/scfg/scfgsys.c +++ b/src/sbbs3/scfg/scfgsys.c @@ -1,5 +1,3 @@ -/* $Id: scfgsys.c,v 1.63 2020/08/18 06:03:09 rswindell Exp $ */ - /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * @@ -13,21 +11,9 @@ * See the GNU General Public License for more details: gpl.txt or * * http://www.fsf.org/copyleft/gpl.html * * * - * Anonymous FTP access to the most recent released source is available at * - * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * - * * - * Anonymous CVS access to the development source and modification history * - * is available at cvs.synchro.net:/cvsroot/sbbs, example: * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login * - * (just hit return, no password is necessary) * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src * - * * * For Synchronet coding style and modification guidelines, see * * http://www.synchro.net/source.html * * * - * You are encouraged to submit any modifications (preferably in Unix diff * - * format) via e-mail to mods@synchro.net * - * * * Note: If this box doesn't appear square, then you need to fix your tabs. * ****************************************************************************/ @@ -1334,13 +1320,13 @@ void sys_cfg(void) while(!done) { i=0; sprintf(opt[i++],"%-27.27s%s","New User Magic Word",cfg.new_magic); - sprintf(opt[i++],"%-27.27s%.40s","Data Directory" + sprintf(opt[i++],"%-27.27s%s","Data Directory" ,cfg.data_dir); - sprintf(opt[i++],"%-27.27s%.40s","Logs Directory" + sprintf(opt[i++],"%-27.27s%s","Logs Directory" ,cfg.logs_dir); - sprintf(opt[i++],"%-27.27s%.40s","Exec Directory" + sprintf(opt[i++],"%-27.27s%s","Exec Directory" ,cfg.exec_dir); - sprintf(opt[i++],"%-27.27s%.40s","Mods Directory" + sprintf(opt[i++],"%-27.27s%s","Mods Directory" ,cfg.mods_dir); sprintf(opt[i++],"%-27.27s%s","Input SIF Questionnaire" ,cfg.new_sif); @@ -1358,7 +1344,7 @@ void sys_cfg(void) ,cfg.sys_lastnode); sprintf(opt[i++],"%-27.27s%s","Phone Number Format" ,cfg.sys_phonefmt); - sprintf(opt[i++],"%-27.27s%.40s","Sysop Chat Override" + sprintf(opt[i++],"%-27.27s%s","Sysop Chat Override" ,cfg.sys_chat_arstr); if(cfg.user_backup_level) sprintf(str,"%hu",cfg.user_backup_level); diff --git a/src/sbbs3/scfg/scfgxfr1.c b/src/sbbs3/scfg/scfgxfr1.c index 8fd511942a8be5dda2e6401754b5eb79c8e6d409..60747c3b9290576ee0b25c3a40d51888b0a6edc0 100644 --- a/src/sbbs3/scfg/scfgxfr1.c +++ b/src/sbbs3/scfg/scfgxfr1.c @@ -872,7 +872,7 @@ void xfer_opts() "don't wish it to be available for a certain method of transfer, leave\n" "the command line for that method blank.\n" ; - i=uifc.list(i,0,0,50,&prot_dflt,&prot_bar,"File Transfer Protocols",opt); + i=uifc.list(i,0,0,34,&prot_dflt,&prot_bar,"File Transfer Protocols",opt); if(i==-1) break; int msk = i & MSK_ON; diff --git a/src/sbbs3/scfg/scfgxfr2.c b/src/sbbs3/scfg/scfgxfr2.c index 1e70d07a5c1db1de031666a35a31bf0247944fed..c85037852b64966b5001d61f0ecbe16be11350ed 100644 --- a/src/sbbs3/scfg/scfgxfr2.c +++ b/src/sbbs3/scfg/scfgxfr2.c @@ -1,5 +1,3 @@ -/* $Id: scfgxfr2.c,v 1.62 2019/08/12 06:21:28 rswindell Exp $ */ - /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * @@ -13,21 +11,9 @@ * See the GNU General Public License for more details: gpl.txt or * * http://www.fsf.org/copyleft/gpl.html * * * - * Anonymous FTP access to the most recent released source is available at * - * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * - * * - * Anonymous CVS access to the development source and modification history * - * is available at cvs.synchro.net:/cvsroot/sbbs, example: * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login * - * (just hit return, no password is necessary) * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src * - * * * For Synchronet coding style and modification guidelines, see * * http://www.synchro.net/source.html * * * - * You are encouraged to submit any modifications (preferably in Unix diff * - * format) via e-mail to mods@synchro.net * - * * * Note: If this box doesn't appear square, then you need to fix your tabs. * ****************************************************************************/ @@ -388,11 +374,11 @@ void xfer_cfg() sprintf(opt[j++],"%-27.27s%s","Long Name",cfg.lib[i]->lname); sprintf(opt[j++],"%-27.27s%s","Short Name",cfg.lib[i]->sname); sprintf(opt[j++],"%-27.27s%s","Internal Code Prefix",cfg.lib[i]->code_prefix); - sprintf(opt[j++],"%-27.27s%.40s","Parent Directory" + sprintf(opt[j++],"%-27.27s%s","Parent Directory" ,cfg.lib[i]->parent_path); - sprintf(opt[j++],"%-27.27s%.40s","Access Requirements" + sprintf(opt[j++],"%-27.27s%s","Access Requirements" ,cfg.lib[i]->arstr); - sprintf(opt[j++],"%-27.27s%.40s","Access to Sub-directories" + sprintf(opt[j++],"%-27.27s%s","Access to Sub-directories" ,cfg.lib[i]->misc&LIB_DIRS ? "Yes":"No"); sprintf(opt[j++],"%-27.27s%s","Sort Library By Directory", area_sort_desc[cfg.lib[i]->sort]); strcpy(opt[j++],"Clone Options"); @@ -1143,15 +1129,15 @@ void dir_cfg(uint libnum) sprintf(opt[n++],"%-27.27s%s","Short Name",cfg.dir[i]->sname); sprintf(opt[n++],"%-27.27s%s%s","Internal Code" ,cfg.lib[cfg.dir[i]->lib]->code_prefix, cfg.dir[i]->code_suffix); - sprintf(opt[n++],"%-27.27s%.40s","Access Requirements" + sprintf(opt[n++],"%-27.27s%s","Access Requirements" ,cfg.dir[i]->arstr); - sprintf(opt[n++],"%-27.27s%.40s","Upload Requirements" + sprintf(opt[n++],"%-27.27s%s","Upload Requirements" ,cfg.dir[i]->ul_arstr); - sprintf(opt[n++],"%-27.27s%.40s","Download Requirements" + sprintf(opt[n++],"%-27.27s%s","Download Requirements" ,cfg.dir[i]->dl_arstr); - sprintf(opt[n++],"%-27.27s%.40s","Operator Requirements" + sprintf(opt[n++],"%-27.27s%s","Operator Requirements" ,cfg.dir[i]->op_arstr); - sprintf(opt[n++],"%-27.27s%.40s","Exemption Requirements" + sprintf(opt[n++],"%-27.27s%s","Exemption Requirements" ,cfg.dir[i]->ex_arstr); SAFECOPY(path, cfg.dir[i]->path); if(!path[0]) { @@ -1171,7 +1157,7 @@ void dir_cfg(uint libnum) SAFECOPY(str, path); else SAFEPRINTF(str, "[%s]", path); - sprintf(opt[n++],"%-27.27s%.40s","Transfer File Path" + sprintf(opt[n++],"%-27.27s%s","Transfer File Path" ,str); sprintf(opt[n++],"%-27.27s%u","Maximum Number of Files" ,cfg.dir[i]->maxfiles); @@ -1867,9 +1853,9 @@ void dir_cfg(uint libnum) sprintf(str,"[%sdirs/]",cfg.data_dir); else strcpy(str,cfg.dir[i]->data_dir); - sprintf(opt[n++],"%-27.27s%.40s","Data Directory" + sprintf(opt[n++],"%-27.27s%s","Data Directory" ,str); - sprintf(opt[n++],"%-27.27s%.40s","Upload Semaphore File" + sprintf(opt[n++],"%-27.27s%s","Upload Semaphore File" ,cfg.dir[i]->upload_sem); sprintf(opt[n++],"%-27.27s%s","Sort Value and Direction" , cfg.dir[i]->sort==SORT_NAME_A ? "Name Ascending" diff --git a/src/sbbs3/scfg/scfgxtrn.c b/src/sbbs3/scfg/scfgxtrn.c index e1695e3cd7b0157af637b5877855276a49627a0f..6f788b5861392407f6a41d8dce17e2e88222450f 100644 --- a/src/sbbs3/scfg/scfgxtrn.c +++ b/src/sbbs3/scfg/scfgxtrn.c @@ -346,9 +346,9 @@ void fevents_cfg() while(1) { i=0; - sprintf(opt[i++],"%-32.32s%.40s","Logon Event",cfg.sys_logon); - sprintf(opt[i++],"%-32.32s%.40s","Logout Event",cfg.sys_logout); - sprintf(opt[i++],"%-32.32s%.40s","Daily Event",cfg.sys_daily); + sprintf(opt[i++],"%-32.32s%s","Logon Event",cfg.sys_logon); + sprintf(opt[i++],"%-32.32s%s","Logout Event",cfg.sys_logout); + sprintf(opt[i++],"%-32.32s%s","Daily Event",cfg.sys_daily); opt[i][0]=0; uifc.helpbuf= "`External Events:`\n" @@ -420,7 +420,7 @@ void tevents_cfg() while(1) { for(i=0;i<cfg.total_events && i<MAX_OPTS;i++) - sprintf(opt[i],"%-8.8s %.50s",cfg.event[i]->code,cfg.event[i]->cmd); + sprintf(opt[i],"%-8.8s %s",cfg.event[i]->code,cfg.event[i]->cmd); opt[i][0]=0; j=WIN_SAV|WIN_ACT|WIN_CHE|WIN_RHT; if(cfg.total_events) @@ -487,8 +487,8 @@ void tevents_cfg() while(!done) { k=0; sprintf(opt[k++],"%-32.32s%s","Internal Code",cfg.event[i]->code); - sprintf(opt[k++],"%-32.32s%.40s","Start-up Directory",cfg.event[i]->dir); - sprintf(opt[k++],"%-32.32s%.40s","Command Line",cfg.event[i]->cmd); + sprintf(opt[k++],"%-32.32s%s","Start-up Directory",cfg.event[i]->dir); + sprintf(opt[k++],"%-32.32s%s","Command Line",cfg.event[i]->cmd); sprintf(opt[k++],"%-32.32s%s","Enabled" ,cfg.event[i]->misc&EVENT_DISABLED ? "No":"Yes"); if(cfg.event[i]->node == NODE_ANY) @@ -981,16 +981,16 @@ void xtrn_cfg(uint section) k=0; sprintf(opt[k++],"%-27.27s%s","Name",cfg.xtrn[i]->name); sprintf(opt[k++],"%-27.27s%s","Internal Code",cfg.xtrn[i]->code); - sprintf(opt[k++],"%-27.27s%.40s","Start-up Directory",cfg.xtrn[i]->path); - sprintf(opt[k++],"%-27.27s%.40s","Command Line",cfg.xtrn[i]->cmd); - sprintf(opt[k++],"%-27.27s%.40s","Clean-up Command Line",cfg.xtrn[i]->clean); + sprintf(opt[k++],"%-27.27s%s","Start-up Directory",cfg.xtrn[i]->path); + sprintf(opt[k++],"%-27.27s%s","Command Line",cfg.xtrn[i]->cmd); + sprintf(opt[k++],"%-27.27s%s","Clean-up Command Line",cfg.xtrn[i]->clean); if(cfg.xtrn[i]->cost) sprintf(str,"%"PRIu32" credits",cfg.xtrn[i]->cost); else strcpy(str,"None"); sprintf(opt[k++],"%-27.27s%s","Execution Cost",str); - sprintf(opt[k++],"%-27.27s%.40s","Access Requirements",cfg.xtrn[i]->arstr); - sprintf(opt[k++],"%-27.27s%.40s","Execution Requirements" + sprintf(opt[k++],"%-27.27s%s","Access Requirements",cfg.xtrn[i]->arstr); + sprintf(opt[k++],"%-27.27s%s","Execution Requirements" ,cfg.xtrn[i]->run_arstr); sprintf(opt[k++],"%-27.27s%s","Multiple Concurrent Users" ,cfg.xtrn[i]->misc&MULTIUSER ? "Yes" : "No"); @@ -1583,7 +1583,7 @@ void xedit_cfg() while(1) { for(i=0;i<cfg.total_xedits && i<MAX_OPTS;i++) - sprintf(opt[i],"%-8.8s %.40s",cfg.xedit[i]->code,cfg.xedit[i]->rcmd); + sprintf(opt[i],"%-8.8s %s",cfg.xedit[i]->code,cfg.xedit[i]->rcmd); opt[i][0]=0; j=WIN_SAV|WIN_ACT|WIN_CHE|WIN_RHT; if(cfg.total_xedits) @@ -1668,8 +1668,8 @@ void xedit_cfg() k=0; sprintf(opt[k++],"%-32.32s%s","Name",cfg.xedit[i]->name); sprintf(opt[k++],"%-32.32s%s","Internal Code",cfg.xedit[i]->code); - sprintf(opt[k++],"%-32.32s%.40s","Command Line",cfg.xedit[i]->rcmd); - sprintf(opt[k++],"%-32.32s%.40s","Access Requirements",cfg.xedit[i]->arstr); + sprintf(opt[k++],"%-32.32s%s","Command Line",cfg.xedit[i]->rcmd); + sprintf(opt[k++],"%-32.32s%s","Access Requirements",cfg.xedit[i]->arstr); sprintf(opt[k++],"%-32.32s%s%s","Intercept I/O" ,cfg.xedit[i]->misc&XTRN_STDIO ? "Standard" :cfg.xedit[i]->misc&XTRN_CONIO ? "Console":"No" @@ -2368,7 +2368,7 @@ void xtrnsec_cfg() k=0; sprintf(opt[k++],"%-27.27s%s","Name",cfg.xtrnsec[i]->name); sprintf(opt[k++],"%-27.27s%s","Internal Code",cfg.xtrnsec[i]->code); - sprintf(opt[k++],"%-27.27s%.40s","Access Requirements" + sprintf(opt[k++],"%-27.27s%s","Access Requirements" ,cfg.xtrnsec[i]->arstr); sprintf(opt[k++],"%s","Available Online Programs..."); opt[k][0]=0; @@ -2431,7 +2431,7 @@ void hotkey_cfg(void) while(1) { for(i=0;i<cfg.total_hotkeys && i<MAX_OPTS;i++) - sprintf(opt[i],"Ctrl-%c %.40s" + sprintf(opt[i],"Ctrl-%c %s" ,cfg.hotkey[i]->key+'@' ,cfg.hotkey[i]->cmd); opt[i][0]=0; @@ -2516,7 +2516,7 @@ void hotkey_cfg(void) k=0; sprintf(opt[k++],"%-27.27sCtrl-%c","Global Hot Key" ,cfg.hotkey[i]->key+'@'); - sprintf(opt[k++],"%-27.27s%.40s","Command Line",cfg.hotkey[i]->cmd); + sprintf(opt[k++],"%-27.27s%s","Command Line",cfg.hotkey[i]->cmd); opt[k][0]=0; uifc.helpbuf= "`Global Hot Key Event:`\n" diff --git a/src/sbbs3/sexyz.c b/src/sbbs3/sexyz.c index 2b5cbf300c045eca1d1dc76f4acff75d13202919..67e2339efbcf097f9f14d4d0ab9c0d4f3f34f0f2 100644 --- a/src/sbbs3/sexyz.c +++ b/src/sbbs3/sexyz.c @@ -1761,7 +1761,7 @@ int main(int argc, char **argv) pause_on_abend=TRUE; break; case 'M': /* MaxFileSize */ - max_file_size=strtoul(arg++,NULL,0); /* TODO: use strtoull() ? */ + max_file_size=strtoul(arg + 1,NULL,0); /* TODO: use strtoull() ? */ break; case 'L': /* Lowercase received filenames */ lc_filenames=TRUE; diff --git a/src/sbbs3/userdat.c b/src/sbbs3/userdat.c index 74521fe50763112c927fdaa05214e6c23271ba25..1ffd3cd7cab783f7b5c538a18605fa5d1b835b16 100644 --- a/src/sbbs3/userdat.c +++ b/src/sbbs3/userdat.c @@ -1725,7 +1725,11 @@ static BOOL ar_exp(scfg_t* cfg, uchar **ptrptr, user_t* user, client_t* client) #endif break; case AR_DOS: - result=not; + #if defined(_WIN32) || (defined(__linux__) && defined(USE_DOSEMU)) || defined(__FreeBSD__) + result=!not; + #else + result=not; + #endif break; case AR_WIN32: #ifndef _WIN32 diff --git a/src/sbbs3/xmodem.c b/src/sbbs3/xmodem.c old mode 100644 new mode 100755 index c6bb1d4b6d6b77747ec9ac5f5e954564137fdd1f..bbf6ba1e13f45f995f76ff1b97a174142a1b1a36 --- a/src/sbbs3/xmodem.c +++ b/src/sbbs3/xmodem.c @@ -167,13 +167,13 @@ int xmodem_cancel(xmodem_t* xm) int result; if(!is_cancelled(xm) && is_connected(xm)) { + xm->cancelled=TRUE; for(i=0;i<8 && is_connected(xm);i++) if((result=putcom(CAN))!=0) return result; for(i=0;i<10 && is_connected(xm);i++) if((result=putcom('\b'))!=0) return result; - xm->cancelled=TRUE; } xmodem_flush(xm); diff --git a/src/sbbs3/xtrn.cpp b/src/sbbs3/xtrn.cpp index ac9e08bad4155e1f59a62583a2b3cd8feaf1f2a1..79a7ef73c696b453799d641cb2ac1e89847b44e1 100644 --- a/src/sbbs3/xtrn.cpp +++ b/src/sbbs3/xtrn.cpp @@ -1,10 +1,5 @@ -/* xtrn.cpp */ -// vi: tabstop=4 - /* Synchronet external program support routines */ -/* $Id: xtrn.cpp,v 1.263 2020/08/02 20:23:34 rswindell Exp $ */ - /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * @@ -18,21 +13,9 @@ * See the GNU General Public License for more details: gpl.txt or * * http://www.fsf.org/copyleft/gpl.html * * * - * Anonymous FTP access to the most recent released source is available at * - * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * - * * - * Anonymous CVS access to the development source and modification history * - * is available at cvs.synchro.net:/cvsroot/sbbs, example: * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login * - * (just hit return, no password is necessary) * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src * - * * * For Synchronet coding style and modification guidelines, see * * http://www.synchro.net/source.html * * * - * You are encouraged to submit any modifications (preferably in Unix diff * - * format) via e-mail to mods@synchro.net * - * * * Note: If this box doesn't appear square, then you need to fix your tabs. * ****************************************************************************/ #include "sbbs.h" @@ -243,7 +226,10 @@ static bool native_executable(scfg_t* cfg, const char* cmdline, long mode) unsigned i; if(mode&EX_NATIVE) - return(TRUE); + return true; + + if(*cmdline == '?' || *cmdline == '*') + return true; SAFECOPY(str,cmdline); /* Set str to program name only */ truncstr(str," "); @@ -1855,6 +1841,8 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch { char str[MAX_PATH+1],*cmd; int i,j,len; + bool native = (mode == EX_UNSPECIFIED) || native_executable(&cfg, instr, mode); + (void) native; if(outstr==NULL) cmd=cmdstr_output; @@ -1888,8 +1876,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch break; case 'F': /* File path */ #if defined(__linux__) && defined(USE_DOSEMU) - if(*instr != '?' && mode != EX_UNSPECIFIED && !(mode & EX_NATIVE) - && strncmp(fpath, cfg.node_dir, strlen(cfg.node_dir)) == 0) { + if(!native && strncmp(fpath, cfg.node_dir, strlen(cfg.node_dir)) == 0) { strncat(cmd, DOSEMU_NODE_DIR, avail); strncat(cmd, fpath + strlen(cfg.node_dir), avail); } @@ -1899,7 +1886,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch break; case 'G': /* Temp directory */ #if defined(__linux__) && defined(USE_DOSEMU) - if(*instr != '?' && mode != EX_UNSPECIFIED && !(mode & EX_NATIVE)) + if(!native) strncat(cmd, DOSEMU_TEMP_DIR, avail); else #endif @@ -1913,7 +1900,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch break; case 'J': #if defined(__linux__) && defined(USE_DOSEMU) - if(*instr != '?' && mode != EX_UNSPECIFIED && !(mode & EX_NATIVE)) + if(!native) strncat(cmd, DOSEMU_DATA_DIR, avail); else #endif @@ -1921,7 +1908,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch break; case 'K': #if defined(__linux__) && defined(USE_DOSEMU) - if(*instr != '?' && mode != EX_UNSPECIFIED && !(mode & EX_NATIVE)) + if(!native) strncat(cmd, DOSEMU_CTRL_DIR, avail); else #endif @@ -1935,7 +1922,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch break; case 'N': /* Node Directory (same as SBBSNODE environment var) */ #if defined(__linux__) && defined(USE_DOSEMU) - if(*instr != '?' && mode != EX_UNSPECIFIED && !(mode & EX_NATIVE)) + if(!native) strncat(cmd, DOSEMU_NODE_DIR, avail); else #endif @@ -1980,7 +1967,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch break; case 'Z': #if defined(__linux__) && defined(USE_DOSEMU) - if(*instr != '?' && mode != EX_UNSPECIFIED && !(mode & EX_NATIVE)) + if(!native) strncat(cmd, DOSEMU_TEXT_DIR, avail); else #endif @@ -1998,7 +1985,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch break; case '!': /* EXEC Directory */ #if defined(__linux__) && defined(USE_DOSEMU) - if(*instr != '?' && mode != EX_UNSPECIFIED && !(mode & EX_NATIVE)) + if(!native) strncat(cmd, DOSEMU_EXEC_DIR, avail); else #endif diff --git a/src/sbbs3/xtrn_sec.cpp b/src/sbbs3/xtrn_sec.cpp index c1a83d36eac21fee11e68f4a02f9e84b78a0553b..33cc509d4d54b3b5fb4738cfd54fb188850c44c8 100644 --- a/src/sbbs3/xtrn_sec.cpp +++ b/src/sbbs3/xtrn_sec.cpp @@ -1,9 +1,5 @@ -/* xtrn_sec.cpp */ - /* Synchronet external program/door section and drop file routines */ -/* $Id: xtrn_sec.cpp,v 1.91 2020/08/01 18:34:24 rswindell Exp $ */ - /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * @@ -17,21 +13,9 @@ * See the GNU General Public License for more details: gpl.txt or * * http://www.fsf.org/copyleft/gpl.html * * * - * Anonymous FTP access to the most recent released source is available at * - * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * - * * - * Anonymous CVS access to the development source and modification history * - * is available at cvs.synchro.net:/cvsroot/sbbs, example: * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login * - * (just hit return, no password is necessary) * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src * - * * * For Synchronet coding style and modification guidelines, see * * http://www.synchro.net/source.html * * * - * You are encouraged to submit any modifications (preferably in Unix diff * - * format) via e-mail to mods@synchro.net * - * * * Note: If this box doesn't appear square, then you need to fix your tabs. * ****************************************************************************/ @@ -1611,7 +1595,7 @@ bool sbbs_t::exec_xtrn(uint xtrnnum) char drop_file[MAX_PATH + 1]; char startup_dir[MAX_PATH + 1]; #if defined(__linux__) && defined(USE_DOSEMU) - if(!(cfg.xtrn[xtrnnum]->misc & XTRN_NATIVE)) { + if(cfg.xtrn[xtrnnum]->cmd[0] != '?' && cfg.xtrn[xtrnnum]->cmd[0] != '*' && !(cfg.xtrn[xtrnnum]->misc & XTRN_NATIVE)) { SAFEPRINTF2(startup_dir, "%s\\%s", DOSEMU_XTRN_DRIVE, getdirname(cfg.xtrn[xtrnnum]->path)); backslash(startup_dir); if(cfg.xtrn[xtrnnum]->misc & STARTUPDIR) diff --git a/src/syncterm/syncterm.c b/src/syncterm/syncterm.c index 63028507d80dcd5ed0ccba2b416394d2a16a7555..2c7885efebdd44e57d35db3e12cb6d59b3368255 100644 --- a/src/syncterm/syncterm.c +++ b/src/syncterm/syncterm.c @@ -1622,20 +1622,20 @@ int main(int argc, char **argv) #ifdef ALPHA init_uifc(TRUE, TRUE); uifc.showbuf(WIN_SAV|WIN_MID|WIN_HLP, 0, 0, 76, uifc.scrn_len - 2, "WARNING: ALPHA VERSION", - "This is an ~`ALPHA`~ version\n\n" + "This is an ~`ALPHA`~ version\n" "\n" "It has both known and unknown issues and is not believed to be suitable\n" "for use. By using it, you are agreeing to be free QA to find and report bugs.\n" "\n" "There are expected to be many bugs.\n" "\n" - "Bugs should be reported at http://sf/net/p/syncterm/tickets/\n" + "Bugs should be reported at `http://sf.net/p/syncterm/tickets/`\n" "when reporting bugs, please register with a valid email so I can follow\n" "up with additional questions.\n" "\n" "This message will appear every time you start this program. Please\n" "consider running the latest release from:\n" - "https://sourceforge.net/projects/syncterm/files/latest/download\n" + "`https://sourceforge.net/projects/syncterm/files/latest/download`\n" "if you want a terminal that works.", NULL, NULL); uifcbail(); diff --git a/src/syncterm/term.c b/src/syncterm/term.c index 8eb87d6e9f70c13c50f091c413c365f84089b376..96f355baab519167739bfbc0fb6a45b9a5ac7575 100644 --- a/src/syncterm/term.c +++ b/src/syncterm/term.c @@ -460,8 +460,10 @@ static int lputs(void* cbdata, int level, const char* str) OutputDebugString(msg); #endif - if(log_fp!=NULL && level <= log_level) - fprintf(log_fp,"Xfer %s: %s\n",log_levels[level], str); + if(log_fp!=NULL && level <= log_level) { + time_t t = time(NULL); + fprintf(log_fp,"%.15s %s\n", ctime(&t) + 4, str); + } if(level > LOG_INFO) return 0; diff --git a/xtrn/DDMsgReader/DDMsgReader.js b/xtrn/DDMsgReader/DDMsgReader.js index d6aa1cc209107dd4cc1b4fac5e04d2769c2bde49..69c0ed2403009a4ff43f2c4bd6af6fa4d9df2bfc 100644 --- a/xtrn/DDMsgReader/DDMsgReader.js +++ b/xtrn/DDMsgReader/DDMsgReader.js @@ -1,4 +1,4 @@ -// $Id: DDMsgReader.js,v 1.144 2020/07/11 23:07:46 nightfox Exp $ +// $Id: DDMsgReader.js,v 1.143 2020/05/23 23:30:28 nightfox Exp $ /* This is a message reader/lister door for Synchronet. Features include: * - Listing messages in the user's current message area with the ability to @@ -69,6 +69,13 @@ * Added mouse support to the scrollable reader interface. * The integrated area changer functionality doesn't have mouse * support yet. + * 2020-11-26 Eric Oulashin Verison 1.38 + * Bug fix: When forwarding a message, it now correctly + * sets the to_net_type property in the message header to + * FidoNet or internet for those types of message destinations + * 2020-12-01 Eric Oulashin Version 1.39 + * When forwarding a message, added the ability to + * optionally edit the message before forwarding it. */ @@ -180,8 +187,8 @@ if (system.version_num < 31500) } // Reader version information -var READER_VERSION = "1.37"; -var READER_DATE = "2020-07-11"; +var READER_VERSION = "1.39"; +var READER_DATE = "2020-12-01"; // Keyboard key codes for displaying on the screen var UP_ARROW = ascii(24); @@ -13303,7 +13310,7 @@ function DigDistMsgReader_ForwardMessage(pMsgHdr, pMsgBody) return "Invalid message header given"; var retStr = ""; - + console.print("\1n"); console.crlf(); console.print("\1cUser name/number/email address\1h:\1n"); @@ -13329,6 +13336,7 @@ function DigDistMsgReader_ForwardMessage(pMsgHdr, pMsgBody) else return "Unable to open the sub-board to get the message body"; } + // Prepend some lines to the message body to describe where // the message came from originally. var newMsgBody = "This is a forwarded message from " + system.name + "\n"; @@ -13350,15 +13358,69 @@ function DigDistMsgReader_ForwardMessage(pMsgHdr, pMsgBody) newMsgBody += "==================================\n\n"; newMsgBody += pMsgBody; + // New - Editing the message + // TODO: Ask whether to edit the message before forwarding it, + // and use console.editfile(filename) to edit it. + if (!console.noyes("Edit the message before sending")) + { + var baseWorkDir = system.node_dir + "DDMsgReader_Temp"; + deltree(baseWorkDir + "/"); + if (mkdir(baseWorkDir)) + { + // TODO: Let the user edit the message, then read it + // and set newMsgBody to it + var tmpMsgFilename = baseWorkDir + "/message.txt"; + // Write the current message to the file + var wroteMsgToTmpFile = false; + var outFile = new File(tmpMsgFilename); + if (outFile.open("w")) + { + wroteMsgToTmpFile = outFile.write(newMsgBody, newMsgBody.length); + outFile.close(); + } + if (wroteMsgToTmpFile) + { + // Let the user edit the file, and if successful, + // read it in to newMsgBody + if (console.editfile(tmpMsgFilename)) + { + var inFile = new File(tmpMsgFilename); + if (inFile.open("r")) + { + newMsgBody = inFile.read(inFile.length); + inFile.close(); + } + } + } + else + { + console.print("\1n\1cFailed to write message to a file for editing\1n"); + console.crlf(); + console.pause(); + } + } + else + { + console.print("\1n\1cCouldn't create temporary directory\1n"); + console.crlf(); + console.pause(); + } + } + // End New (editing message) + // Create part of a header object which will be used when saving/sending // the message. The destination ("to" informatoin) will be filled in // according to the destination type. var destMsgHdr = { to_net_type: NET_NONE, from: user.name, replyto: user.name, subject: "Fwd: " + pMsgHdr.subject }; if (user.netmail.length > 0) + { destMsgHdr.replyto_net_addr = user.netmail; + } else + { destMsgHdr.replyto_net_addr = user.email; + } //destMsgHdr.when_written_time = //destMsgHdr.when_written_zone = system.timezone; //destMsgHdr.when_written_zone_offset = @@ -13380,7 +13442,7 @@ function DigDistMsgReader_ForwardMessage(pMsgHdr, pMsgBody) console.crlf(); destMsgHdr.to = msgDest; destMsgHdr.to_net_addr = msgDest; - destMsgHdr.to_net_type = NET_INTERNET; + destMsgHdr.to_net_type = netaddr_type(msgDest); } } else @@ -13430,6 +13492,7 @@ function DigDistMsgReader_ForwardMessage(pMsgHdr, pMsgBody) console.print("\1n\1cForwarding to " + destUser.alias + "\1n"); console.crlf(); destMsgHdr.to_ext = destUser.number; + destMsgHdr.to_net_type = NET_NONE; } } } @@ -13472,6 +13535,54 @@ function DigDistMsgReader_ForwardMessage(pMsgHdr, pMsgBody) return retStr; } +function printMsgHdrInfo(pMsgHdr) +{ + if (typeof(pMsgHdr) != "object") + return; + + for (var prop in pMsgHdr) + { + if (prop == "to_net_type") + print(prop + ": " + toNetTypeToStr(pMsgHdr[prop])); + else + console.print(prop + ": " + pMsgHdr[prop]); + console.crlf(); + } +} + +function toNetTypeToStr(toNetType) +{ + var toNetTypeStr = "Unknown"; + if (typeof(toNetType) == "number") + { + switch (toNetType) + { + case NET_NONE: + toNetTypeStr = "Local"; + break; + case NET_UNKNOWN: + toNetTypeStr = "Unknown networked"; + break; + case NET_FIDO: + toNetTypeStr = "FidoNet"; + break; + case NET_POSTLINK: + toNetTypeStr = "PostLink"; + break; + case NET_QWK: + toNetTypeStr = "QWK"; + break; + case NET_INTERNET: + toNetTypeStr = "Internet"; + break; + default: + toNetTypeStr = "Unknown"; + break; + } + } + return toNetTypeStr; +} + // For the DigDistMsgReader class: Lets the user vote on a message // // Parameters: diff --git a/xtrn/DDMsgReader/readme.txt b/xtrn/DDMsgReader/readme.txt index 40441f125b3de7a50c13417c5e7c5a5fe12f6bd3..46c3e6ce0fffc3598c2f4aaea86b67f9e419615b 100644 --- a/xtrn/DDMsgReader/readme.txt +++ b/xtrn/DDMsgReader/readme.txt @@ -1,6 +1,6 @@ Digital Distortion Message Reader - Version 1.37 - Release date: 2020-07-11 + Version 1.39 + Release date: 2020-12-01 by diff --git a/xtrn/DDMsgReader/revision_history.txt b/xtrn/DDMsgReader/revision_history.txt index d09a21e96a68059bb6c1da4f2917ba7059324907..8dd53fa16c6b3dec162927e48508c174e5d6e8f6 100644 --- a/xtrn/DDMsgReader/revision_history.txt +++ b/xtrn/DDMsgReader/revision_history.txt @@ -5,6 +5,12 @@ Revision History (change log) ============================= Version Date Description ------- ---- ----------- +1.39 2020-12-01 When forwarding a message, added the ability to optinally + edit the message before forwarding it. +1.38 2020-11-26 Bug fix: When forwarding a message, it now correctly sets + sets the to_net_type property in the message header to + FidoNet or internet for those types of message + destinations 1.37 2020-07-11 Added mouse support to the scrollable reader interface. The integrated area changer functionality doesn't have mouse support yet. diff --git a/xtrn/fatfish/INSTALL.txt b/xtrn/fatfish/INSTALL.txt index 1ffdaacc341c0348802e20dc7a90dea09054e95d..ef324f0dc9b01a3c0ba5be743b664aa9dabec262 100644 --- a/xtrn/fatfish/INSTALL.txt +++ b/xtrn/fatfish/INSTALL.txt @@ -1,4 +1,4 @@ ------------------------------------------------- +------------------------------------------------ FatFish: the fishing simulation door game. ------------------------------------------------ FatFish is a fishing simulation door game for Synchronet BBS systems. @@ -13,9 +13,7 @@ Requirements - exec/load/frame.js - exec/load/mapgenerator.js - exec/load/json-client.js - You can grab these from the Synchronet CVS repository. - -- You need to have a fairly updated Synchronet environment. Your exec/ and exec/load/ directories should be updated to 2 September 2012 from CVS. + You can grab these from the Synchronet git repository. ------------------- Supported Platforms @@ -31,7 +29,7 @@ FatFish has been tested on: ------------ Installation ------------ -1. Get the sources. They can be found on cvs.synchro.net, the official Synchronet repository. +1. Included with Sychronet. If you don't have them, they can be found on gitlab.synchro.net, the official Synchronet repository. 2. Configure the door in SCFG, if not already done: ╔[■][?]════════════════════════════════════════════════════╗ diff --git a/xtrn/fatfish/README.txt b/xtrn/fatfish/README.txt index 6c94943158bfe651628fb075da159e2d7edf36d2..d059bd3a1b6e64668aa4a0de94e2d9cbd29ec986 100644 --- a/xtrn/fatfish/README.txt +++ b/xtrn/fatfish/README.txt @@ -3,8 +3,6 @@ ------------------------------------------------ FatFish is a fishing simulation door game for Synchronet BBS systems. -Website: http://art.poorcoding.com/fatfish. - -------- Features -------- diff --git a/xtrn/starstocks/game.js b/xtrn/starstocks/game.js index 60a03a62480383e31f600bad1607601e9deea49b..7e4a5d60b13ea84e4fc88c911c59c20db4a20f57 100644 --- a/xtrn/starstocks/game.js +++ b/xtrn/starstocks/game.js @@ -821,11 +821,6 @@ function quit() var splash=new Graphic(80,splash_size); splash.load(splash_filename); splash.draw(); - - console.gotoxy(1,23); - console.center("\1n\1c[\1hPress any key to continue\1n\1c]"); - while(console.inkey(K_NOECHO|K_NOSPIN)===""); - console.clear(); } //########################## CLASSES ######################################### diff --git a/xtrn/starstocks/sysop.doc b/xtrn/starstocks/sysop.doc index 9a60dc07ceaf98df8c7cdf94d2575300076462bc..8a30eb722c0c61a8be61b3f658f620023ed7a915 100644 --- a/xtrn/starstocks/sysop.doc +++ b/xtrn/starstocks/sysop.doc @@ -1,20 +1,5 @@ Please report any bugs, issues or questions to: mcmlxxix at bbs dot thebrokenbubble dot com -*****UPDATING YOUR LOCAL LIBRARIES****** - -NOTE: It is recommended that you check frequently for game updates from the -Synchronet CVS repository located at: - - http://cvs.synchro.net/cgi-bin/viewcvs.cgi/xtrn/starstocks/ - -Before you attempt to install the program, it is recommended that you -update your relative 'exec/' and 'exec/load/' paths -with the latest files from the Synchronet CVS repository at: - - http://cvs.synchro.net/cgi-bin/viewcvs.cgi/exec/ - http://cvs.synchro.net/cgi-bin/viewcvs.cgi/exec/load/ - - *****CONFIGURING YOUR EXTERNAL PROGRAM***** Sample configuration in SCFG -> external programs: diff --git a/xtrn/synchronetris/sysop.doc b/xtrn/synchronetris/sysop.doc index 814f4d093448cdb374cdc70b25a6b6193b873f5d..f6d8a3d4dd6385cafce008407dfeadd00efc0dd5 100644 --- a/xtrn/synchronetris/sysop.doc +++ b/xtrn/synchronetris/sysop.doc @@ -1,20 +1,5 @@ Please report any bugs, issues or questions to: mcmlxxix at bbs dot thebrokenbubble dot com -*****UPDATING YOUR LOCAL LIBRARIES****** - -NOTE: It is recommended that you check frequently for game updates from the -Synchronet CVS repository located at: - - http://cvs.synchro.net/cgi-bin/viewcvs.cgi/xtrn/synchronetris/ - -Before you attempt to install the program, it is recommended that you -update your relative 'exec/' and 'exec/load/' paths -with the latest files from the Synchronet CVS repository at: - - http://cvs.synchro.net/cgi-bin/viewcvs.cgi/exec/ - http://cvs.synchro.net/cgi-bin/viewcvs.cgi/exec/load/ - - *****CONFIGURING YOUR EXTERNAL PROGRAM***** Sample configuration in SCFG -> external programs: diff --git a/xtrn/war/install-xtrn.ini b/xtrn/war/install-xtrn.ini index eda488a146d6bc549090e2c49b1b1517b3506043..9f9cca9766314e570bf3b58327fa0e4cb9b47dd5 100644 --- a/xtrn/war/install-xtrn.ini +++ b/xtrn/war/install-xtrn.ini @@ -1,4 +1,4 @@ -; LORD installer data for install-xtrn.js +; Solomoriah's War installer data for install-xtrn.js Name: Solomoriah's WAR! Desc: WAR Version 4.4 ported to JavaScript @@ -14,15 +14,43 @@ execution_ars = NOT GUEST settings = XTRN_MULTIUSER required = true +[prog:WARALD] +name = Solomoriah's WAR! on Alderon +cmd = ?war.js worlds/alderon +execution_ars = NOT GUEST +settings = XTRN_MULTIUSER +required = true + +[prog:WARSOL] +name = Solomoriah's WAR! on Solomoriah +cmd = ?war.js worlds/solomoriah +execution_ars = NOT GUEST +settings = XTRN_MULTIUSER +required = true + +[prog:WARSP] +name = Solomoriah's WAR! on Spacewar +cmd = ?war.js worlds/spacewar +execution_ars = NOT GUEST +settings = XTRN_MULTIUSER +required = true + +[prog:WARTAL] +name = Solomoriah's WAR! on Toloivar +cmd = ?war.js worlds/tolivar +execution_ars = NOT GUEST +settings = XTRN_MULTIUSER +required = true + [event:WARUPD] prompt = false -cmd = ?warupd.js worlds/earth +cmd = ?warupd.js earth alderon solomoriah spacewar tolivar name = WAR Update days = 127 [event:WARPOLL] prompt = false -cmd = ?warpoll.js worlds/earth +cmd = ?warpoll.js earth alderon solomoriah spacewar tolivar name = WAR Poll days = 127 freq = 60 diff --git a/xtrn/war/warcommon.js b/xtrn/war/warcommon.js index 6101be885aa3ae22dbbdf1c7effa5a53d454b1e3..271f6cfe2e3adb93552bb56fa7a24933ee6fd76c 100644 --- a/xtrn/war/warcommon.js +++ b/xtrn/war/warcommon.js @@ -555,6 +555,8 @@ function set_game(path) { if(path.substr(0, 1)=='/' || (path.substr(1,1)==':' && path.substr(2,1)=='\\')) game_dir = path; + else if(path.indexOf('/') === -1) + game_dir = fullpath(orig_exec_dir+'/worlds/'+path); else game_dir = fullpath(orig_exec_dir+'/'+path); news = new File(game_dir+'/news');