Skip to content
Snippets Groups Projects
  1. Sep 18, 2024
  2. Sep 17, 2024
  3. Sep 16, 2024
  4. Sep 15, 2024
  5. Sep 14, 2024
    • Rob Swindell's avatar
      When renaming a file (using F2 key), need to get all metadata before update · 499be182
      Rob Swindell authored
      ... otherwise, we'll erase the file's extended description or auxdata, if it
      has any.
      499be182
    • Rob Swindell's avatar
      Don't heap allocate argument to MsgBase and FileBase constructors · a398abb2
      Rob Swindell authored
      Nelgin reported a weird error with a failed very large allocation for the
      base/code argument to the FileBase constructor. There's no good reason
      these strings were heap-allocated in the first place, so just change to
      use a stack allocated variable instead. I don't know why this would fix
      anything, but at least there's one less heap allocation and potential
      for memory leak here.
      
      Fix 2 bugs in js_update_file():
      1. missing parenthesis (really?!? Caught by Coverity - sigh) in last
      commmit caused attempt/failure/error to remove file after making any
      updates. The removing is only supposed to happen when its necessary to
      remove and re-add the file to the filebase (e.g. updating extended
      description or auxdata).
      2. Wrong filename used in 'removing' exception string.
      a398abb2
    • Rob Swindell's avatar
      Add/use smb_removefile_by_name() · 09d721d4
      Rob Swindell authored
      This fixes a filebase corruption issue that could be triggered by using
      FileBase.update() to rename a file while also changing the file's auxdata or
      extended description: you can't remove a file header that has the new filename
      (in the file_t.name field), cause it doesn't exist yet. So we needed an SMBLIB
      API function to pass the (original) filename instead. Much like the filedat.c
      removefile() function, but without the SMB opening/closing feature.
      09d721d4
    • Rob Swindell's avatar
      Don't allow FileBase.update() to create a duplicate file · 397d6ebe
      Rob Swindell authored
      FileBase.update() will now throw an exception if attempting to rename a file
      to a filename that already exists in the filebase index.
      
      Prior to this change, one could (via JS methods) rename a file in the base to
      create a duplicate filename which would corrupt the base (one index entry and
      two header records for the same filename).
      397d6ebe
    • Rob Swindell's avatar
      MSVC requires a 0 in the struct initializer · ffa2c51b
      Rob Swindell authored
      ffa2c51b
    • Rob Swindell's avatar
      FileBase.update() method throws more exceptions upon error · 2fc23c32
      Rob Swindell authored
      This will help to determine cause of any file update (e.g. rename)
      failures, as reported by Nelgin.
      2fc23c32
    • Rob Swindell's avatar
      Perform filename checks (index versus header fields) on filebases · 5f0fb1c7
      Rob Swindell authored
      I was able to corrupt a filebase using fileman.js, renaming a file
      (the filename in the index as viewed with 'smbutil x' did not match
      the filename listed with 'smbutil l') - yet, chksmb reported no errors
      with the filebase.
      
      Now chksmb will detect that type of corruption.
      5f0fb1c7
    • Rob Swindell's avatar
      smb_getmsgidx() now reads entire index records from file bases too · 1ab4ef2b
      Rob Swindell authored
      chksmb needed this to perform filename checks (index against headers).
      1ab4ef2b
    • Rob Swindell's avatar
      fileidexrec_t doesn't need to contain union · 62b0507b
      Rob Swindell authored
      This served exactly no purpose (since the idxrec_t existed at the same
      offset in both parts of the union). So this was just some weird artifact
      from the new filebase development.
      62b0507b
    • Rob Swindell's avatar
      Eliminte weird gcc (12.2) warning in release build (only) · 10562789
      Rob Swindell authored
      Increasing size of mode[] element by 2 bytes eliminated these GCC warnings
      that seem like false-positives to me:
      
      sbbs.h:194:48: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
        194 |                                 (ret)[JSSTSpos]=(char)JSSTSstrval[JSSTSpos]; \
            |                                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      js_file.c:225:25: note: in expansion of macro ‘JSSTRING_TO_STRBUF’
        225 |                         JSSTRING_TO_STRBUF(cx, str, p->mode, sizeof(p->mode), NULL);
            |                         ^~~~~~~~~~~~~~~~~~
      js_file.c:42:17: note: at offset 5 into destination object ‘mode’ of size 5
         42 |         char    mode[5];
            |                 ^~~~
      
      Similar use of JSSTRING_TO_STRBUF in other files (js_console.cpp, js_archive.c)
      (with larger target buffers) does not trigger the same warnings.
      10562789
    • Rob Swindell's avatar
      Merge branch 'dd_file_lister_get_extd_info_null_check_and_allow_edit_filename' into 'master' · e1bd17e3
      Rob Swindell authored
      DD file lister: Check for null when getting extended metadata from the DB (possibly caused by corruption). Also, allow changing the filename when editing file info/metadata.
      
      See merge request !459
      e1bd17e3
    • Eric Oulashin's avatar
      DD file lister: Check for null when getting extended metadata from the DB... · 806cd5b5
      Eric Oulashin authored and Rob Swindell's avatar Rob Swindell committed
      DD file lister: Check for null when getting extended metadata from the DB (possibly caused by corruption). Also, allow changing the filename when editing file info/metadata.
      806cd5b5
  6. Sep 13, 2024
    • Rob Swindell's avatar
      Add keyboard shortcuts to Clients list view: Ctrl-A, Ctrl-F and Del · c31203fc
      Rob Swindell authored
      Ctrl-A - Select All
      Ctrl-F - Filter IP address
      DEL - Close Socket
      
      Also, use Begin/EndUpdate() calls to batch updates to the ListView in Timer
      tick (no visible difference, but it's the right thing to do).
      
      I don't know why C++Builder increased the TextHeight value of this form from
      13 to 15, but doesn't seem to really matter (or at least, I couldn't tell).
      c31203fc
    • Rob Swindell's avatar
      Change the height of the horizontal splitter to the minimum (1 pixel) · 513715f0
      Rob Swindell authored
      I don't know why this was set so wide (10 pixels), but that did help to easily
      see that it was being placed in the wrong spot in the form (between the tool
      button bar and the top panel). But we don't need it to be that thick. 1 pixel
      is still enough to be able to grab it with the mouse and resize the top/bottom
      panels.
      513715f0
    • Rob Swindell's avatar
      Display horizontal splitter in the correct spot. · 89637f0d
      Rob Swindell authored
      For who knows how long now, the horizontal splitter that allows the sysop
      to control the size of the top 2 panels (server forms), was displayed above
      the top panel, not between the top and bottom panel, thus making the panel
      heights not controllable. Weird. Change the order of making the controls
      visible to insure that the splitter is displayed below the top panel and
      on top of the bottom panel.
      
      Also (non-functional changes):
      Remove redunant mutex from client_on() - makes no difference.
      Use try/catch in client_on() to try to catch VCL exceptions - doesn't catch
      the "invalid index" error popups that we see on occasion. <shrug>
      89637f0d
    • Rob Swindell's avatar
      Fix crash due to use after free or double-free · aff554a4
      Rob Swindell authored
      ... bug introduced in commit 29a35642.
      
      strListMerge() doesn't realloc the strings in the list, so we don't want to
      free the strings in this list here.
      
      This is likely the cause of the crash Keyop eluded to in #synchronet.
      aff554a4
  7. Sep 12, 2024
    • Rob Swindell's avatar
      Close an open message base after just 10 seconds of client inactivity · 3f0bbb17
      Rob Swindell authored
      ... and log a debug-level log message when doing so.
      
      The current input/receive timeout duration (5 minutes) might be a bit long to
      leave a message base open (though, there's no known issue with doing so). For
      example, when users read message bases using the terminal server, they can sit
      for much longer than 5 minutes reading an open message base.
      3f0bbb17
    • Rob Swindell's avatar
      Close any open message base after input timeout (5 minutes) · 04340d91
      Rob Swindell authored
      As Nelgin pointed out, the nntpservice can leave a message bases open while
      a client is idle. Normally, an inactive client would be disconnected after 5
      minutes of inactivity, so that wouldn't be much of an issue. However, if
      authenticated as a user with the H-exemption, no auto-disconnection after
      input timeout would happen. So let's close any open message base for good
      measure.
      
      The input/receive timeout probably should be configurable and lowered to
      a smaller duration (one minute?). I'll leave that for another commit.
      04340d91
    • Rob Swindell's avatar
      Split-up the opening and writing of msg pointer files, to help debug issue · 20cfdb18
      Rob Swindell authored
      Reported by Keyop (upon being auto-disconnected overnight):
      !ERROR 9 (Bad file descriptor) in data_ovl.cpp line 47 (putmsgptrs) writing
      "message pointers" access=0
      
      Unfortunately, the way putmsgptrs() was written, we couldn't tell if this was
      an open (data/user/*.subs file) issue or a writing issue.
      
      So create putmsgptrs_fp() and use that from sbbs_t::putmsgptrs(), so we can
      log a different error (with more accurate details) if it's a file-open failure
      versues a file-write failure.
      20cfdb18
    • Rob Swindell's avatar
      Merge branch 'ree/websocketservice-debug' into 'master' · 72f27c93
      Rob Swindell authored
      Fix #782 - websocketservice.js garbles input on Banana Pi running Armbian
      
      Closes #782
      
      See merge request !458
      72f27c93
    • Rick Parrish's avatar
      Fix #782 - websocketservice.js garbles input on Banana Pi running Armbian · 93434d07
      Rick Parrish authored and Rob Swindell's avatar Rob Swindell committed
      93434d07
    • Rob Swindell's avatar
      Blocked IP addresses in ip-silent.can weren't filtered from QWK and REP pkts · 29a35642
      Rob Swindell authored
      The "from_ip" header field of QWK messages is checked against blocked IP
      addresses, but was only checking against IP addresses from ip.can, not any
      addresses listed in ip-silent.can. These 2 list files are now merged together
      for the purposes of filtering during QWK/REP packet import.
      29a35642
Loading