Skip to content
Snippets Groups Projects
  1. Feb 14, 2024
    • Rob Swindell's avatar
      Recycling servers reverts back to graceful (waiting for clients to disconnect) · cebed052
      Rob Swindell authored
      Commit 75c5c9e5 was initially to address server termination (sisue #236), but
      expanded in scope to include server recycling (e.g. due to semaphore/config
      file touch) and that turns out to not be what most sysops want.
      
      If you want an immediate/ungraceful recycle, do a restart (shutdown/stop and
      then start) instead.
      
      Immediate/ungraceful server shutdown/termination is still in effect however.
      
      No change to the "server pause" feature either, so combining pause with
      recycle would be effective to prevent *new* client connections while waiting
      for existing clients to disconnect and allow a recycle to happen.
      cebed052
  2. Feb 07, 2024
  3. Jan 22, 2024
  4. Jan 21, 2024
  5. Jan 20, 2024
  6. Jan 16, 2024
    • Rob Swindell's avatar
      Fix issue with "Pause Logging" buttons not staying pressed in sbbsctrl-win32 · eb9c3519
      Rob Swindell authored
      Reported by Max (WESTLINE)...
      
      Introduced in commit 75c5c9e5, since we are now calling the set_state()
      callback periodically, and in sbbsctrl, it sets/resets the pause button
      checked (depressed) state in response to this callback (should it?), this was
      resetting the pause button checked/depressed state peridically (at the
      configured sem file check interval, default 2 seconds).
      
      The fix: if the new server state is the same as the previously set server
      state, don't call the set_state() callback. I considered this as a potential
      optimization when I first wrote that commit, but didn't see any obvious
      downside to calling the set_state() callback redundantly. Now that I see a
      downside, let's implement this saving/checking of the state to avoid
      redundant "set" calls.
      eb9c3519
  7. Jan 13, 2024
    • Rob Swindell's avatar
      Check for shutdown and recycle semaphores even while clients are connected · 75c5c9e5
      Rob Swindell authored
      We have checks/loops/timeouts waiting for active clients to disconnect and
      child thread threads to terminate whenever shutting down or recycling already,
      so this should be safe. This pretty simple change fixes issue #236 (can't
      terminate server under heavy load).
      
      Also as part of this commit, introduced the ability to "pause" a server
      (prevent it from accepting new connections) with the ctrl/pause semaphore
      file or via the MQTT server/pause (and resume) topics. This feature is useful
      when debugging server issues where you don't necessarily want to fully
      shutdown/terminate the server, but don't want any new connections to be
      accepted (the listen backlog will fill up with incoming connections though).
      Unlike a server shutdown, a server pause can be "undone" via MQTT (by
      publishing a message to the "resume" topic).
      
      The "pause" semaphore file is just an "existence" semaphore file - its
      date/time stamp doesn't matter. If the file exists, the server will enter
      a paused state (and periodically log messages to that fact) until the semfile
      is deleted.
      
      This server pause feature is not the same as the pause button function in
      sbbsctrl, which just pauses server log output.
      75c5c9e5
  8. Jan 10, 2024
    • Rob Swindell's avatar
      Restore ftpalias.cfg support for MLSx commands · 263abb98
      Rob Swindell authored
      Support was accidentally removed as part of commit 22e8d2e3, meaning
      the ftpalias.cfg wasn't used at all in responses to the MLSx commands as
      reported by Max (WESTLINE) using Total Commander, FileZilla and Directory
      opus. The traditional "LIST" commands still worked fine with ftpalias.cfg
      contents just fine.
      
      The reason this code was accidentally removed was due to the errant
      copy/pasted comparison with startup->html_index_file that did not belong here
      and made the block appear related to HTML index file generation. It was not.
      This was just a bug in the initial implementation of MLSx support in
      commit d4deb4b3.
      
      Also included in this commit:
      - Return the date/size of the user's QWK packet file, if it exists, in MLSx
        response.
      - send_mlsx_entry() won't report negative time_t values as file modify dates
       (flength returns -1 upon failure/file-not-found).
      - get_owner_name() returns the string, making it easier to use in function
        calls.
      
      There appears to still be some work to do to make the MLSx commands fully
      compliant with RFC 3659 (e.g. "mlst filename" from ftpalias.cfg should work
      but does not), but at least FileZilla displays ftpalias.cfg files and
      directories correctly now.
      263abb98
  9. Jan 09, 2024
  10. Jan 08, 2024
  11. Dec 29, 2023
  12. Dec 21, 2023
    • Rob Swindell's avatar
      Change ssl.c API to include an lprintf callback function for proper logging. · 69eb741b
      Rob Swindell authored
      The JS objects will still log to the terminal server (regardless of which server created/used the objects) however - so that's still a TODO.
      Change do_cryptInit() to return bool, since it does.
      Log detailed error if pthread_once() call fails.
      Lowered-severity (to DEBUG) the log messages related to TLS private key and cert creation and destruction.
      
      FIrst commit from within MSVS, so this might look weird.
      69eb741b
  13. Dec 20, 2023
    • Deucе's avatar
      Fix TLS handbrake/hang/crash issue · 97680179
      Deucе authored
      Private key objects in cryptlib are not copied into sessions when
      they're added, only the refcount is incremented.  These objects
      contain a bignum context, which therefore ends up shared across all
      instances of the private key.  Unfortunately, the locking is on the
      session context, not the private key objects, so shared bignum contexts
      can cause memory corruption.
      
      Further, even if the locking issue was fixed, the performance handbrake
      would still exists... activating sessions that use the same private key
      would be serialized, with the results we've been seeing lately.
      
      With this, each session gets a unique private key, which is loaded
      from the file.  When a session is finished with the key, it is cached
      in a list with an epoch, so when the date on the key file changes, old
      private keys will be eliminated.
      
      While this solves a lot of issues, logging of certificate generation
      and loading issues has regressed to the point where it's effectively
      not done at all. Logging was previously passed back to the caller,
      but given the much longer call chain to get to where a cert is created,
      the extra parameters was just too much. Something better should be
      done here at some point.
      97680179
  14. Dec 19, 2023
  15. Dec 18, 2023
  16. Dec 17, 2023
  17. Dec 15, 2023
  18. Nov 26, 2023
  19. Nov 13, 2023
  20. Jun 26, 2023
    • Rob Swindell's avatar
      Eliminate STRERROR macro · 4a53863e
      Rob Swindell authored
      This macro hasn't done anything meaningful since we stopped using really old
      versions of Borland compilers (and std libraries) where strerror() returned a
      string terminated with a line-feed (\n) character.
      4a53863e
  21. Jun 04, 2023
  22. Apr 13, 2023
    • Rob Swindell's avatar
      Fix false "SUSPECTED BOUNCE ATTACK ATTEMPT" for IPv6 FTP-data connections · b25b5734
      Rob Swindell authored
      This bug only impacted non-passive FTP connections. Using an FTP client
      with active (not passive) data connections over an IPv6 connection would
      false-trigger the "bounce attack" detection and the FTP server responded with
      "504 Bad port number" and logged a hack attempt in data/hack.log.
      
      The issue was that we were comparing the socket address structure (which
      contains other fields besides the address itself) between the control and
      proposed-data connections. While this logic worked okay for IPv4,
      it did not for IPv6 (the 2 structs contained some non-address differences).
      Rather than modify the socket address structures to match where needed, I'm
      just comparing the string representation of the addresses, since that's
      what we really care about anyway.
      
      Thank to "mark i" of Truck Stop BBS for alerting me to this issue
      b25b5734
  23. Mar 24, 2023
  24. Mar 19, 2023
  25. Mar 04, 2023
Loading