Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

7 May, 2024: fms is rebuilding. Don't expect much in that section for quite a few days, maybe longer.


dovenet / Synchronet Programming / src/sbbs3/exec.cpp

SubjectAuthor
o src/sbbs3/exec.cppRob Swindell (on ChromeOS)

1
src/sbbs3/exec.cpp

<66089435.49434.syncprog@vert.synchro.net>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=3450&group=DOVE-Net.Synchronet_Programming#3450

  copy link   Newsgroups: DOVE-Net.Synchronet_Programming
From: rob.swindell.(on.chromeos)@VERT (Rob Swindell (on ChromeOS))
To: Git commit to main/sbbs/master
Subject: src/sbbs3/exec.cpp
Message-ID: <66089435.49434.syncprog@vert.synchro.net>
Date: Sat, 30 Mar 2024 15:37:41 -0700
X-Comment-To: Git commit to main/sbbs/master
Path: rocksolidbbs.com!not-for-mail
Organization: Vertrauen
Newsgroups: DOVE-Net.Synchronet_Programming
X-FTN-PID: Synchronet 3.20a-Linux master/c3e46719e Mar 2 2024 GCC 12.2.0
X-FTN-MSGID: 49434.syncprog@1:103/705 2a6e8b4f
X-FTN-CHRS: CP437 2
WhenImported: 20240330153741-0700 c1e0
WhenExported: 20240402074224-0700 c1e0
ExportedFrom: VERT syncprog 49434
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Rob Swindell (on Chr - Sat, 30 Mar 2024 22:37 UTC

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

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor