Skip to content
Snippets Groups Projects
  1. Jun 02, 2022
    • Rob Swindell's avatar
      Address warnings and errors introduced in *nix build from previous commit · 9540d135
      Rob Swindell authored
      Also a bit more constification and cleared up the legacy sbbs_get_ini_fname()
      usage: the hostname argument hadn't be used in a long, long time.
      9540d135
    • Rob Swindell's avatar
      Decompose some library files to enable reuse by SVDM (virtual DOS modem) · a8c4fc8a
      Rob Swindell authored
      I just wanted to reuse findstr() in vdmodem.c and I fell down this hole :-)
      
      findstr.* is new (findstr() related functions moved from str_util)
      getctrl.* is now finally the real home of get_ctrl_dir(), moved from str_util
      trashcan* functions moved from str_util to scfglib
      other scfg_t dependent functions moved from str_util to scfglib
      
      net_addr() appears to be a function that was never created/used (?)
      
      This will definitely break the *nix build, for now.
      a8c4fc8a
  2. Jun 01, 2022
    • Rob Swindell's avatar
    • Rob Swindell's avatar
      Don't clobber an open user.dat file descriptor in js_CreateUserObject() · 792237df
      Rob Swindell authored
      Likely fix for the user.dat open file descriptor leak:
      If js_CreateUserObject(cx,parent,cfg,"name",...) is called multiple times
      (e.g. before login and after login), the successive calls will reuse the
      previously allocated JS object and allocated private data memory. However, the
      private data memory (which includes the descriptor of an open user.dat file,
      if it has been opened), was always zeroed, even if it was being reused. This
      would leak open file descriptor.
      
      So any (pre)login scripts or web scripts that use the "user" object (which
      is all zeroed-out before login) and then allows a user to subsequently login,
      would leak a file descriptor.
      792237df
  3. May 31, 2022
  4. May 30, 2022
  5. May 24, 2022
  6. May 18, 2022
    • Rob Swindell's avatar
      Fix User.number increment beyond lastuser issue · af1ae777
      Rob Swindell authored
      When the 'number' property of an instance of User was incremented beyond the last user, the call to fgetuserdat() on subsequent property 'get' operation would fail and zero-out the user structure (including the user number). This resulted in an infinite loop in load/birthdays.js where the user number would go from lastuser to 1 in one operation (u.number++).
      
      Reported by DesotoFireflite (VALHALLA)
      af1ae777
  7. May 11, 2022
    • Rob Swindell's avatar
      Allow a per-service "LowestLogLevel" setting · 8e0d6a98
      Rob Swindell authored
      Have a service (e.g. imapservice.js) that logs errors that you'd rather not fill your error.log file with? Set that service's "LowestLogLevel" to "Warning" in your services.ini file ("lower" means "more severe" when it comes to log levels, so this would set the maximum severity to Warning).
      8e0d6a98
  8. May 10, 2022
    • Rob Swindell's avatar
      Better RTS support · 5dae2780
      Rob Swindell authored
      Reducing log output (lowering log level of line 437 from LOG_INFO to LOG_DEBUG) highlighted an issue with Telix stopping RX. That was fixed by checking RTS in input_thread(). Qmodem needs RTS checked when writing the MCR.
      
      This improved RTS support has been tested with Telix, Qmodem, Telemate, and Banacom at full data rates.
      5dae2780
  9. May 09, 2022
    • Rob Swindell's avatar
      Add "Disable Local Display" option for doors, parse DOSXTRN.ERR · 6ed76598
      Rob Swindell authored
      New option to disable local screen display for door programs: sets the 'Screen' value appropriately in door.sys or pcboard.sys drop files and on Windows, doesn't create a new console window.
      
      Also, now parsing the DOSXTRN.ERR file created by the latest/greatest dosxtrn.exe when failing to execute the child/DOS program and log the parsed error details (errno value and description), helpful in debugging the reason why a DOS program may not have been successfully executed by DOSXTRN.
      6ed76598
  10. May 08, 2022
    • Rob Swindell's avatar
      Remember the last 'first_msg' property value after msgbase is closed · b1c5d2da
      Rob Swindell authored
      The other msgbase property values are stored in the smb.status or other private_t members which retain their value when the message base is closed, unlike the 'first_msg' property which required a read of the message base index to get the value (and that doesn't work when the message base is closed, so would return 0).
      
      for deon (ALTERANT)
      b1c5d2da
    • Rob Swindell's avatar
      Improvements to virtual UART driver for Windows · 07f57a86
      Rob Swindell authored
      In the process of creating/testing the new Synchronet Virtual DOS Modem (SVDM) project, I made the following significant improvements:
      
      - Don't default the log level to DEBUG for debug builds
      - Add a "carrier change" event so carrier low to high transitions can be tracked too
      - Replace several lprintf() calls with lputs() for performance reasons
      - Specify 'volatile' storage for pending_interrupts
      - Interrupts are re-asserted if there are any pending interrupts after reading IIR register
      - Emulate FIFO enablement
      - Support RTS flow control signal
      - Remove conditional/configurable yields when polling LSR and MSR register, would just unnecessarily slow down terminal programs
      - Report "DCD change" in MSR correctly
      - Clean-up (e.g. close handles) in VDD_CLOSE handler
      - VDD_LOAD_INI_FILE allows an optional ini filename (instead of directory) as its argument - for loading an ini filename other than sbbsexec.ini (e.g. svdm.ini).
      
      Initialize log level in VDDInitialize(). For versions of Windows/NTVDM that use/call the "init proc" (this function), we just re-initialize global variables here.
      07f57a86
    • Rob Swindell's avatar
      Support an optional ini filename argument, write to DOSXTRN.ERR · 8347dd58
      Rob Swindell authored
      If a 4th optional argument is provided, use that as the ini filename for virtual UART/FOSSIL driver settings instead of "sbbsexec.ini". Using this feature requires an updated sbbsexec.dll that supports an ini-filename argument (instead of a directory) to the VDD_LOAD_INI_FILE command.
      
      If DOSXTRN fails to execute the passed command-line, _spawnvp() returns -1, log the errno value and description to DOSXTRN.ERR (in the same directory as DOSXTRN.ENV). This will help diagnose issues executing DOS command-lines (e.g. file not found).
      
      Upon failure to open/create DOSXTRN.RET, don't prematurely terminate as that would skip a lot of important cleanup.
      8347dd58
    • Rob Swindell's avatar
      Print the upload TCP protocol (when available) w/user name, not host/IP · 814b745f
      Rob Swindell authored
      Long hostnames would prevent the protocol from being shown. Also, non-operators should be able to see the protocol used to upload files.
      814b745f
  11. Apr 30, 2022
    • Rob Swindell's avatar
      Fix DIZ extraction/use for FTP uploads · 77d72d0e
      Rob Swindell authored
      1. Was not setting f->dir to the correct directory number, so only ftp-uploads to the *first* directory (dirnum = 0) would extract DIZ files of uploaded files.
      
      Removing the 'dirnum' parameter to addfile() since that implied that you did not have to initialize the 'dir' element of the passed file_t, but you do: to get the correct file path for file size/date detection and the DIZ extraction.
      
      2. Was getting heap-corruption when freeing the imported/formatted DIZ text on Windows once the above problem was fixed: can't free() in one DLL memory that was allocated in another DLL. Created and now using free_diz() to free the memory allocated in read_diz().
      
      format_diz() handles a NULL 'lines' argument correctly/gracefully, so no need for the NULL lines check in sbbs_t::uploadfile().
      
      Added FTP server log messages for successful file upload or update by user.
      77d72d0e
    • Rob Swindell's avatar
      Fix CID 174496: Integer handling issues (BAD_SHIFT) · dc9847ee
      Rob Swindell authored
      Don't repeat call atoi() unnecessarily.
      dc9847ee
  12. Apr 29, 2022
    • Rob Swindell's avatar
      Give the timed event config menu the left/right arrow key treatment · e924cc90
      Rob Swindell authored
      Allows quick traversing through timed events (e.g. for comparison of settings).
      e924cc90
    • Rob Swindell's avatar
      Add "Native" option for QWKnet call-out cmd-lines · 23a0836f
      Rob Swindell authored
      This really shouldn't be necessary to toggle (at least now) on Windows, since we treat all off-line executions as "native", but for *nix, it could make a big difference if trying to invoke a native program or shell script for a QWKnet call-out and it would either fail due to no DOS support or try to executing using Linux-DOSEMU (unless the command's program name was in the global "native program list" configured in SCFG->External Programs).
      23a0836f
    • Rob Swindell's avatar
      When running 16-bit DOS commands "offline" on Windows, don't use dosxtrn · 7f991beb
      Rob Swindell authored
      We shouldn't need a virtual UART/FOSSIL driver to execute "offline" program (e.g. timed events) in the first place, and our virtual UART/FOSSIL for Windows wouldn't work right in the scenario anyway even if it did load successfully.
      
      This resolves the reported issues with timed events configured as not "native" returning error 255 (and not running successfully) on Windows with SBBS v3.19. I'm not even sure what changed exactly in xtrn.cpp, dosxtrn.c, and sbbexec.c between v3.18 and v3.19 that's causing this to now fail, but it (using DOSXTRN to run offline DOS programs) really shouldn't have been attempted in the first place. So that was just a design issue that happened to kind of sort of work up until v3.19.
      7f991beb
  13. Apr 28, 2022
  14. Apr 25, 2022
    • Rob Swindell's avatar
      Add comment about race condition · 9157b866
      Rob Swindell authored
      Fixed typo in another comment
      9157b866
    • Rob Swindell's avatar
      Fix possible underflow conditions in gettimeleft() · 1f0d557e
      Rob Swindell authored
      If a non-'T' exempt user had already used more time today than their security level allows, their timeleft would be computed as a negative value due to integer underflow. Since the return value of this function is assigned to a ulong (timeleft), this becomes a large positive number. Cap the floor of the computed time left at 0.
      
      Also fix the potential for underflow that could occur if the system clock changes while a user is online and 'now' becomes greater than 'starttime'.
      1f0d557e
    • Rob Swindell's avatar
      Dates in drop files are always MM/DD/YY, never DD/MM/YY · 109a8d30
      Rob Swindell authored
      Previously, if a sysop had set SCFG->System->Toggles->European Date Format (DD/MM/YY) to "Yes", then many of the dates in drop files would have been written in this format. Unfortunately, since most BBS doors and door development kits were written by Americans, MM/DD/YY format is always assumed. So fixed that (using new TM_MONTH macro too).
      
      Also, line 37 ("Event Time") of DOOR.SYS was always 00:00, now it'll be the next event time (in HH:MM format). Unfortunately, that time might be tomorrow or days away and there's no way to represent *that* fact in the DOOR.SYS file format. <shrug>
      109a8d30
    • Rob Swindell's avatar
      Populate line 36 (user alias) of door.sys with the current user's handle · cc85090b
      Rob Swindell authored
      Previously, we just always made this a blank line.
      cc85090b
    • Rob Swindell's avatar
      Add line 8 (user's real name) to DOORFILE.SR (Solar Realms' drop file) · 620f024e
      Rob Swindell authored
      Apparently this line was added at some point, not sure if it's actually used
      in any doors, but here it is anyway.
      620f024e
  15. Apr 22, 2022
    • Rob Swindell's avatar
      Fix segfault when printing Bad-echo name after failing to load cfg · a96a1ab0
      Rob Swindell authored
      This is a weird one: sbbsecho ran right as I was saving msgs.cnf via
      SCFG and it seems like it loaded 0-byte msgs.cnf into memory and this
      segfault was a result of trying to print sub[INVALID_SUB]->code.
      
      The use of [f]nopen() with proper share perms should have prevented this
      (truncated msgs.cnf read) from happening, so there's something else afoot here.
      a96a1ab0
    • Rob Swindell's avatar
      Use smb_open_sub() for the "mail" base too · cac411de
      Rob Swindell authored
      This restores the ability for JS MsgBase() to be used to create the
      initial mail message base properly, if needed.
      
      This means that the 'subnum' should now be equal to scfg.total_subs
      when referencing an arbitrary SMB via path (not in the configuration).
      cac411de
    • Rob Swindell's avatar
      Restore ability for MsgBase.open() to open an arbitrary SMB msgbase · 61ecda33
      Rob Swindell authored
      Before commit 5da26eca, you could pass Msgbase() the path to an SMB
      on the disk and open() it, no configuration needed. As of 2 years
      ago, I broke that, and passing a path to an SMB would open the "mail" base
      instead - most unexpected. This is a feature of smb_open_sub() which we
      switched to using (from smb_open()), so go back to using smb_open() when
      an unrecognized code is pass to the constructor.
      
      This has the negative consequence that the "mail" base can't be created
      via JS. Probably should fix that.
      61ecda33
    • Rob Swindell's avatar
      Limit door.sys numeric values to 32767 · 177f83a3
      Rob Swindell authored
      The DoorFrame door library will about with "Overflow Error" if it reads a door.sys file with lines 16 (calls), 42 (minute credits), or 52 (posted messages) with a value > 32767, the maximum positive value of a signed 16-bit integer. So cap these values in the door.sys file at that maximum. This does potentially break/limit doors that give minutes using the door.sys drop file, so use that "modify user data" option in SCFG with care.
      
      Electrosys initially reported this problem with the Lemonade! door game which was barfing on a line 42 value of 449632.
      177f83a3
  16. Apr 18, 2022
Loading