- Jan 05, 2025
-
-
This means that when writing user.birthdate (in JS) for example, we will always save the field in the proper (YYYYMMDD) format. This fixes issue #855. Remove use of SM_EURODATE from userdat.c. This commit includes new @-code MINSPACE (minimum diskspace required to allow uploads) too (unrelated change).
-
- Dec 02, 2024
-
-
Rob Swindell authored
Addresses Clang warnings about deprecation
-
- Dec 01, 2024
-
-
Rob Swindell authored
getnodedat() now performs a non-locked read by default. Perform more checks of getnodedat() return value before calling putnodedat() to avoid unintentionally zeroing out node.dab records. Add/use unlocknodedat() method for unlocking a node.dab record without writing. Note: The userdat.c getnodedat() and putnodedat() still return int (i.e. 0 on success), so that can be confusing.
-
- Oct 23, 2024
-
-
Rob Swindell authored
Add JS console.ansi_getdims() Use sbbs_t::getdimensions() or JS console.getdimensions() to move user cols/rows values to run-time console values (querying ANSI terminal if appropriate/supported). JS console.pushxy(), popxy(), and gotoxy() all return Boolean now. sbbs_t::getdimensions() and its JS wrapper is now the proper way to propagate user's cols/rows settings to the run-time console values. This was done (post-login) only via use of the TERMROWS and TERMCOLS @-codes in user_settings.js. Weird.
-
- Aug 09, 2024
-
-
Rob Swindell authored
js_execfile() now returns -1 when JS_ExecuteScript() return false (failure). The main command-shell loop will now terminate when js_execfile() returns anything but 0 (success), similar to how PCMS (Baja-compiled) command-shell .bin file parse errors are handled.
-
- Aug 08, 2024
-
-
Rob Swindell authored
As was discovered as part of investigation into issue #769, a JavaScript could crash SBBS (cause a segfault) due to a NULL pointer dereference when the script passes 'null' to native JS functions where an object is expected. The issue raised was with console.gotoxy(), but it turns out that *many* Synchronet native JS functions would call JSVAL_TO_OBJECT() and then, without checking for NULL/nullptr, pass its return value to JS api functions such as JS_GetPrivate, JS_GetProperty, JS_GetClass, JS_ObjectIsFunction, JS_IsArrayObject, JS_GetArrayLength, JS_DefineProperty, JS_Enumerate, etc. All of these JS API functions dereference the passed object pointer without NULL/nullptr checking. The fix here is to either call JSVAL_IS_NULL() or JSVAL_NULL_OR_VOID() and if true, not call JSVAL_TO_OBJECT() and/or check the return value for the NULL value before using as an argument to any other JS API functions.
-
- Apr 06, 2024
-
-
Rob Swindell authored
This solves the problem of exit() values (e.g. non-zero return codes) not getting propagated to callers when nest-called (e.g. via bbs.exec()). I think it was kk4qbn that pointed this out via IRC: an exit(1) call from prextrn.js did not stop the external program from running (as it should, for any non-zero exit code). This only happened when the prextrn.js called another JS script (e.g. via bbs.exec() or as was the case here, indirectly via "EXEC" @-code in the YesNoBar text.dat string (which executed yesnobar.js). This nested JS script invocation via sbbs_t::js_execfile() would clobber the stored js.scope property value (where the "exit_code" property is written). Script invoked in their own context (e.g. via js.exec()) wouldn't have this issue in the first place.
-
- Mar 30, 2024
-
-
Rob Swindell authored
When invoking a nested JS script, these properties of the "js" object would be overwritten and not restored, as discovered/reported by Nightfox when his trivial game script would indirectly execute yesnobar.js, his subsequent use of js.exec_dir would point to the wrong location (the "exec" directory, parent of yesnobar.js, and not the direcctory where his game script was located). The exec_path and exec_file properties had the same problem as demonstrated by a simple test.js placed in (and executed from) a directory other than the "exec" dir: function f() { print("js.exec_path = " + js.exec_path); print("js.exec_dir = " + js.exec_dir); print("Js.exec_file = " + js.exec_file); } f(); console.yesno("test"); f(); This would only trigger the problem when executed from the BBS and whebn the YesNoQuestion text.dat string invokes the "yesnobar" module via EXEC @-code and yesnobar.js exists (in exec or mods dir), superceding yesnobar.bin which does not trigger this issue (not a JavaScript mod).
-
- Dec 31, 2023
-
-
Rob Swindell authored
This completes the revert of commit c22063f9 from (Jun-2-2016). The Baja part of that commit was reverted in commit 932fae30 (Nov-15-2016). This behavior has proven to be surprising and annoying for JS mod developers (e.g. the yesnobar.js and Nightfox's file searcher/scanner). If we still need clearing of abort status after running JS "externals", that should probably be done in exec_xtrn(), not here.
-
- Nov 11, 2023
-
-
Rob Swindell authored
js_execxtrn() now returns -1 if a JS context can't be created. This eliminates redundant error messages from calling js_execfile with a NULL context.
-
- Sep 15, 2023
-
-
Rob Swindell authored
This bug would leave the user's external editor setting decremented by one if they aborted (with Ctrl-C). Fixes issue #631
-
- Sep 10, 2023
-
-
Rob Swindell authored
This should fix issue #626
-
- Jun 09, 2023
-
-
Rob Swindell authored
So Clang-FreeBSD was warning (in compiles of scfg/scfg*.c by Deuce): result of comparison of constant 100000 with expression of type 'uint16_t' (aka 'unsigned short') is always true Why? Cause a uint16_t's max value is 65535 (less than 100000). Sure we could have just lowered the UIFC max number of config items to 65535, but that would have been too easy. And why are these compared-with values of type uint16_t to begin with? Because most ctrl/*.cnf lists (of configuration items) were limited to 65535 entries cause ... 16-bit DOS, historically. Now that *.cnf files aren't used, we could just increase these scfg_t.*_total type sizes from 16 to 32-bits, yeah? The result is this commit. I went to (signed) int so we could still keep -1 as the special illegal sub/dir num value (e.g. INVALID_SUB, which is sometimes used to indicate the email message base). Theoretically, 2 billion configuration items could be supported in these lists, but SCFG will limit you to 100000 anyway. So there's a whole lot of s/uint/int in this commit. I'd be very surprised if this doesn't result in some new GCC/Clang warnings, but at least the old "comparison of constant 100000" warnings are now gone!
-
- Mar 11, 2023
-
-
Rob Swindell authored
That's all these macros were doing anyway, so no change.
-
Rob Swindell authored
Does exactly the same thing, no change in behavior and unlikely there's any change in performance.
-
- Feb 26, 2023
-
-
Rob Swindell authored
Many dynamically-generated (e.g residential) hostnames are much > 30 chars. And we can now increase user.tab fields fairly arbitrarily, so let's. :-) Also rename LEN_COMP to LEN_HOST. Some day I'll change all the user_t comp references to 'host', but not today.
-
- Feb 19, 2023
-
-
Rob Swindell authored
Vestiges of MS-DOS and 16-bit ints and local keyboard access.
-
Rob Swindell authored
Mostly [s]printf format fixups
-
Rob Swindell authored
At one time, Synchronet was a 16-bit DOS project, plagued by the 16-bit [u]int, so long's were used everywhere > 16-bits were known to be needed/wanted (This is before the days of the standard sized types from stdint.h), and they've persisted. But '[u]long int' is 64-bits on *nix 64-bit builds, 32-bits everywhere else (even 64-bit Windows builds if/when we ever get around to that), so this could lead to insidious bugs that would only show up on one flavor or the other. Since [u]int is 32-bits on everything we currently support, we'll use that instead of [u]long. This "part 1" because I'm sure there's going to be warnings and errors from the GCC/Clang builds as a result, which I'll get to next.
-
Rob Swindell authored
modem init strings, alt file paths, PostLink name/number, node-specific command-lines, etc., many of these haven't been used since SBBS v2.
-
- Feb 17, 2023
-
-
Rob Swindell authored
The validation user (required new user feedback user number) and error notification/level settings don't make sense under node settings in today's world where all nodes typically run on the same system and serve the same BBS. Moved from SCFG->Nodes->... Advanced Options to (new sub-menu) SCFG->System->Notifications. Likewise, these 3 settings (valuser, erruser, errlevel) were moved from node*/node.ini to ctrl/main.ini. If you're already running v3.20a, then you'll want to make sure you set these in SCFG->System->Notifications how you prefer them as the migration (now handled in upgrade_to_v320.js) won't have been done for you automatically. The default is no-new-user-feedback required and no-error-notification user set. Added a prompt to the SCFG setup wizard to prompt for this setting since it still is a FAQ. Other cosmetic changes to SCFG help and setup wizard.
-
- Feb 12, 2023
-
-
Rob Swindell authored
getdirsize() is maxed out at size_t, so return that type
-
- Oct 20, 2022
-
-
Rob Swindell authored
... for proper error reporting, at least in the terminal server. Also define/use a macro for the user base filename (now user.tab, not user.dat).
-
- Oct 18, 2022
-
-
Rob Swindell authored
Also resolved some 32 vs 64-bit 'long' issues/ambiguities that have long-remained. :-) This commit also removes logon.lst file support. There's a TODO block remaining in js_user.c for setting portions of a user's birthdate (e.g. just the year or month or day).
-
- Apr 11, 2022
-
-
Rob Swindell authored
JS doors with the "Use Shell or New Context" option enabled in SCFG and JS modules installed a global hot key handlers would not automatically terminate when the user disconnected (and js.auto_terminate was true, the default). I'm not sure why the operation callback was only installed when scope==NULL but always installing it fixes the issue with some global hot key modules and JS doors becoming "zombies" when a user disconnects while running them.
-
- Mar 24, 2022
-
-
Rob Swindell authored
Credits and daily free credits are accurate to the byte up to (a maximum) of 18446744073709551615 (that's 18 Exbibytes - 1). User's upload and download byte stats are now similarly extended in maximum range, but the accuracy is only "to the byte" for values less than 10,000,000,000. Beyond that value, the accuracy declines, but is generally pretty damn accurate (to 4 decimal places beyond the nearest multiple of a power of 1024), so I don't expect that to be an issue. This method of storing upload/download byte stats allowed me to use the same 10-character user record fields in the user.dat file. As a side-effect of this enhancements: * User and file credit values are now expressed in multiples of powers of 1024 (e.g. 4.0G rather than 4,294,967,296). * Free credits per day per security level has now been extended from 32 to 64-bits (to accommodate values >= 4GB). * adjustuserrec() now longer takes the record length since we can easily determine that automatically and don't need more "sources of truth" that can be out-of-sync (e.g. the U_CDT field length going from 10 to 20 chars with this change). * setting the stage for locale-dependent thousands-separators (e.g. space instead of comma) - currently still hard-coded to comma * more/better support for files > 4GB in size (e.g. in the batch download queue) * user_t ulong fields changed to either uint32_t or uint64_t - I didn't realize how many long/ulong's remained in the code (which are sometmies 32-bit, sometimes 64-bit) - ugh * Steve's ultoac() function renamed to u32toac() and created a C++ wrapper that still uses the old name, for homage
-
- Apr 05, 2021
-
-
Deucе authored
This should allow callbacks to not interfere between (say) shells and doors.
-
- Apr 04, 2021
-
-
Rob Swindell authored
This won't impact Synchronet as it has a separate signal handling thread, but we still need to behave properly for processes that don't. I'm also saying that ENOMEM does not indicate a disconnection, though it may be better to pretend it was disconnected...
-
- Apr 02, 2021
-
-
Deucе authored
This appears to work and the event handler *should* work on other event types already. Note, this is *nix-only due to the use of poll(). select() will need to be used for Windows to keep XP compatability.
-
- Feb 18, 2021
-
-
Rob Swindell authored
-
- Jan 24, 2021
-
-
Rob Swindell authored
Example: Command-line: ?showargs " a b c "d "e f" argc = 3 argv[0] = ' a b c ' argv[1] = 'd' argv[2] = 'e f' This resolves a long-standing TODO comment. Also, fixed a problem where multiple spaces between the module name and the first argument would result in argv[0] being set to an empty string.
-
- Nov 26, 2020
-
-
Rob Swindell authored
Don't complain that exec/<modname>.bin can't be opened. Instead, complain that <modname> doesn't exist and therefore can't be executed. The old message could be misleading/confusing if the expected module is a JS mod (not Baja-compiled .bin mod).
-
- Nov 06, 2020
-
-
Rob Swindell authored
I'm fed-up with MSVC assertions in ctype functions (e.g. isdigit, isprint, isspace, etc.) when called with out-of-range (e.g. negative) values. This problem only affects MSVC debug builds, but if you run them (like I do), these things are like little time bombs that can drive you crazy (knocking your board out of service). The new macros names are bit more descriptive as well.
-
- Nov 04, 2020
-
-
Rob Swindell authored
I noticed that when executing an external JS with the new "Use Shell / New Context" option set to "Yes", that any expressions (strings) installed via js.on_exit() were not being executed upon exit from the script. These on-exit strings are important for restoring global state information (e.g. control key pass-through, console mode) to the original state before the JS mod made any changes. I'm not sure why the special treatment of "scope == NULL" is through-out this function. Going back to v3.16, it appears this was special treatment for JS mods invoked via global hot key event (when scope != NULL). When invoking an xtrn JS mod with the new Context option, the scope argument is not NULL, so this check was defeating the parsing of the "exit_code" and the evaluation of any js.on_exit() installed expressions for no apparent reason. I can't think why global hot key events should be excluded from this logic either.
-
- Aug 30, 2020
-
-
Rob Swindell authored
Rather than introduce yet-another-external-program/config flag to enable the "new JS run-time/context" per invocation of any particular JS command, I'm using the XTRN/EX_SH ("Use Shell") option as it had no function for JavaScript command-lines and the concept is similar. So if you want to invoke a JS external program/timed-event in its own "sandbox", enable the "Use Shell / New Context" option for that program/command in SCFG. There may be performance penalties when running JS mods in this way, but you get the benefit of isolating one JS module from all others, if/when necessary.
-
Rob Swindell authored
So revert the order back to the way it was in aa2bcd61 (don't you love these git references?). Also, the previous fix for js_execfile() calls for global hot-key events also fixed the EX_JS_CX feature I was working on (js_execmodule)!
-
Rob Swindell authored
As reported by Ragnarok and The Lizard Master, invoking a JS global hot-key handler (e.g. hitting Ctrl-U or Ctrl-P with the privatemsg or nodelist modules installed as handlers) would lead to the global object being cleared/corrupted so other scripts would then fail to run correctly (e.g. Error: can't open sbbsdefs.js: No such file or directory) This probably explains the JS_GC/JS_ENDREQUEST change needed when the hotkey-specific JS runtime/context/scope was introduced last year. Should revisit that too.
-
- Aug 16, 2020
-
-
Rob Swindell authored
-
- Aug 01, 2020
-
-
rswindell authored
An experimental external() mode flag that runs JS modules in their own separate runtime and context - currently does not work (appears to corrupt the shared JS context). Not actually used currently. The reason I wanted to run a JS module (actually JS doorgame) in its own context was to get useful error messages (filenames and line numbers) when the module throws an exception. Currently, the error is just reported as occuring in xtrn_sec.js, which isn't helpful or correct.
-
- May 08, 2020
-
-
rswindell authored
- User Defaults menu mousified - When all hot spots have scrolled off the screen, clear the hot spot list - Insert new hot spots in the front of the list so they will take precedence over any previously defined duplicate hot spots - Numeric hot spot commands end in a carriage-return - No auto-acceptence of numbers when there are keys in the keyboard buffer - Baja UNGETKEY function now inserts keys into the "front" of the keyboard buffer (next to be consumed) - Hot key @-code command text supports C-style escape sequences (allows encoding of ctrl chars, spaces, etc.)
-