• src/sbbs3/exec.cpp

    From rswindell@VERT to CVS commit on Thursday, May 09, 2019 12:00:14
    src/sbbs3 exec.cpp 1.108 1.109
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/home/rswindell/sbbs/src/sbbs3

    Modified Files:
    exec.cpp
    Log Message:
    if sbbs_t::exec_bin() is called with a blank or NULL module name, just
    return an error value (-33, it's the magic number).



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Monday, May 27, 2019 23:49:00
    src/sbbs3 exec.cpp 1.109 1.110
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv27351

    Modified Files:
    exec.cpp
    Log Message:
    Optimize: don't search for file extension repeatedly.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Saturday, December 30, 2023 17:49:02
    https://gitlab.synchro.net/main/sbbs/-/commit/648f020d426dfd7bde139231
    Modified Files:
    src/sbbs3/exec.cpp
    Log Message:
    Don't clear the console-abort flag upon return from executing a JS module

    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.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on ChromeOS)@VERT to Git commit to main/sbbs/master on Saturday, March 30, 2024 15:37:41
    https://gitlab.synchro.net/main/sbbs/-/commit/9013f866a8231f39f066fc9b
    Modified Files:
    src/sbbs3/exec.cpp
    Log Message:
    Save and restore the js.exec_path, exec_dir, and exec_file properties

    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).

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Friday, April 05, 2024 17:41:05
    https://gitlab.synchro.net/main/sbbs/-/commit/c3b47aca928c693687eefcaa
    Modified Files:
    src/sbbs3/exec.cpp
    Log Message:
    Save/restore js.scope property value in sbbs_t::js_execfile()

    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.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net