Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"I'm a mean green mother from outer space" -- Audrey II, The Little Shop of Horrors


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

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

1
src/sbbs3/exec.cpp

<66109A21.49449.syncprog@vert.synchro.net>

  copy mid

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

  copy link   Newsgroups: DOVE-Net.Synchronet_Programming
From: rob.swindell.(on.windows.11)@VERT (Rob Swindell (on Windows 11))
To: Git commit to main/sbbs/master
Subject: src/sbbs3/exec.cpp
Message-ID: <66109A21.49449.syncprog@vert.synchro.net>
Date: Fri, 5 Apr 2024 17:41:05 -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/f2a017ec6 Mar 24 202 GCC 12.2.0
X-FTN-MSGID: 49449.syncprog@1:103/705 2a76914a
X-FTN-CHRS: CP437 2
WhenImported: 20240405174105-0700 c1e0
WhenExported: 20240405194226-0700 c1e0
ExportedFrom: VERT syncprog 49449
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Rob Swindell (on Win - Sat, 6 Apr 2024 00:41 UTC

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

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor