1. 02 Jun, 2022 1 commit
  2. 10 May, 2022 1 commit
  3. 21 Mar, 2022 2 commits
    • Rob Swindell's avatar
      SMB items (messages or files) can now have 32-bit or 64-bit cost value · 9db7a614
      Rob Swindell authored
      To fully support files > 4GB in size in file bases, credit values larger than 32-bits must be supported too.
      
      There's a couple of todo comments/items included in this commit, but that's mainly to do with messages (which don't really have costs anyway).
      
      The main thing to deal with now is the fact that users can't have more than 4GB in credits in the first place! That's got to be fixed next.
      9db7a614
    • Rob Swindell's avatar
      Support files > 4MB in SMB filebase indexes · b72813e8
      Rob Swindell authored
      Used the reserved 16-bits in the file index record to extend the supported index-file-size from 4294967295 (4GB) to 281474976710655 (281TB). I think that's big enough for the foreseeable future. :-)
      b72813e8
  4. 14 Mar, 2022 2 commits
    • Rob Swindell's avatar
      Fix heap corruption of qp_decode() · 6895c8da
      Rob Swindell authored
      qp_decode (quoted-printable in-place decode of a string) could write 2 characters *beyond* the allocated buffer by appending "\r\n" to a string that was not quoted-printable in the first place. i.e. the  contents of buf were not actually changed in the decode loop. This could result in a corrupted heap and crash of sbbs or smbutil when reading such a message.
      
      This change may result in a lack of CRLF appended to decoded plain text output, so we'll have to keep an eye out for that and resolve it some other way. One possibility could be to only append the CRLF if the destination pointer is sufficiently behind the source pointer.
      
      This solves the crash that Kirkman reported with a specific message in his "mail" base. The header for the message said it was quoted-printable encoded, but the body text was not actually encoded at all:
      OtherHeader      Content-Type: text/plain; charset="iso-8859-1"
      OtherHeader      MIME-Version: 1.0
      OtherHeader      Content-Transfer-Encoding: quoted-printable
      6895c8da
    • Rob Swindell's avatar
      3503816f
  5. 03 Mar, 2022 1 commit
  6. 02 Mar, 2022 1 commit
  7. 24 Sep, 2021 1 commit
  8. 10 Jun, 2021 1 commit
    • Rob Swindell's avatar
      Standardize on "metadata" as the description of a file's "tail" dfield · 3549be9f
      Rob Swindell authored
      It's anticipated that this will be used for JS-populated file metadata in JSON format in the future (and not just "archive contents" in .ini format).
      
      Also, fix the double-free issue that was occurring when moving files with extended file descriptions (sbbs_t::movefile()). This was actually the primary problem I was fixing here, but noticed the metadata issue: metadata would not have been moved along with the other file info between bases.
      3549be9f
  9. 14 May, 2021 1 commit
  10. 13 May, 2021 1 commit
    • Rob Swindell's avatar
      Fix crash in smb_addfile_withlist() when passed a non-NULL empty list · cfee914f
      Rob Swindell authored
      Don't allocate and memset a buffer of -1:
      #1  0x0000559222bc167f in strListCombine (list=0x559224220720, buf=0x559224226550 "", maxlen=18446744073709551615,
          delimit=0x559222bcce0a "\r\n") at str_list.c:447
      447             memset(buf, 0, maxlen);
      (gdb) print maxlen
      $1 = 18446744073709551615
      (gdb) up
      #2  0x0000559222ba3841 in smb_addfile_withlist (smb=0x7ffce63a7e90, file=0x7ffce63a5bc0, storage=1, extdesc=0x0,
          list=0x559224220720, path=0x7ffce63a6e80 "/xfer/loons/manhater.mp3") at smbfile.c:365
      365                     strListCombine(list, content, size - 1, "\r\n");
      (gdb) print list
      $2 = (str_list_t) 0x559224220720
      (gdb) print list[0]
      $3 = 0x0
      
      Found/reported by plt via irc. Thanks!
      cfee914f
  11. 03 May, 2021 1 commit
  12. 02 May, 2021 1 commit
    • Rob Swindell's avatar
      Store contents (list) of archive files in filebase (in the "msg tail") · 5374a113
      Rob Swindell authored
      This will allow fast/easy display of archive contents without actually reading the archive files.
      
      Introduces some new functions:
      - list_archive_contents()
      - smb_adddfile_withlist()
      
      A new SMB convenience variable ("tail", aliased as "content" for a file).
      A new file detail level ("file_detail_content", exposed in JS as FileBase.DETAIL.CONTENTS) which adds a "content" array property to file metadata objects for JS FileBase.get().
      
      Files already added to the new filebases won't have this archive content automatically - I'm looking into that now (likely a new or updated JS script to run).
      5374a113
  13. 24 Apr, 2021 2 commits
  14. 22 Apr, 2021 1 commit
  15. 04 Apr, 2021 1 commit
    • Rob Swindell's avatar
      A poll() failure with EINTR does not mean a socket is closed. · fcf58640
      Rob Swindell authored
      This won't impact Synchronet as it has a separate signal handling
      thread, but we still need to behave properly for processes that
      don't.  I'm also saying that ENOMEM does not indicate a disconnection,
      though it may be better to pretend it was disconnected...
      fcf58640
  16. 22 Feb, 2021 1 commit
  17. 15 Feb, 2021 2 commits
  18. 05 Feb, 2021 1 commit
  19. 23 Jan, 2021 1 commit
  20. 21 Jan, 2021 2 commits
    • Rob Swindell's avatar
      Fix new GCC warning about return type. · 7b05a613
      Rob Swindell authored
      7b05a613
    • Rob Swindell's avatar
      Support single-part MIME-encoded messages in SMBLIB · c90ba307
      Rob Swindell authored
      This involved the removal of the content-transfer-decoding feature of the SMTP mail server since we need single-part MIME-attached file contents to be stored in their original encoded form (e.g. base64-encoded) and not in binary, for the message body text (where NULs aren't allowed, CR/LF is appended, etc).
      
      I accidentally made this change to smbtxt.c in the new_file_base branch and then copied over here, so there's some unrelated innocuous changes (comment header, removal of SMBCALL) that hopefully won't cause a merge conflict later.
      
      I don't actually receive single-part MIME attached files, so depending on others (e.g. Nelgin and Dream Master) to test for me.
      c90ba307
  21. 25 Dec, 2020 1 commit
    • Rob Swindell's avatar
      Add/use new FTN "BBSID" control paragraph (kludge line) · f257f2ff
      Rob Swindell authored
      Advertise the system's QWK-ID (a.k.a. BBS ID) in exported echomail messages. This will allow correlation of avatars that were imported via SYNCDATA carried via QWKnet (e.g. DOVE-Net) with messages imported from those same BBSes via FTN.
      
      The alternative was to have SYNCDATA Avatar messages include all the AKAs of each BBS (in the body text), but that was looking like a rather complicated solution. This approach (the BBSID kludge) seems a much simpler solution.
      
      I still need to implement the JS side of this solution however (for avatar lookups using the FTN BBSID), but this was the first important step.
      f257f2ff
  22. 22 Dec, 2020 1 commit
  23. 11 Dec, 2020 1 commit
    • Rob Swindell's avatar
      Support forwarding of single-part HTML emails, add "Fwd:" subject prefix · d79e9514
      Rob Swindell authored
      When forwarding a single-part MIME-encoded HTML email, the preamble (original message header info) and any user comments, need to be HTML-encoded.
      
      Add the commonly-used "Fwd: " prefix to the default message subject, when forwarding.
      
      This required that smb_getplaintext() no longer always-NULLify the message's text_subtype (e.g. "html"). For single-part messages, this element was getting freed and NULLed.
      
      Add/use a new SMBLIB convenience function to add a string header field, but only if non-NULL: smb_hfield_string()
      d79e9514
  24. 10 Dec, 2020 2 commits
    • Rob Swindell's avatar
      Include comment headers in smb_getmsgtxt() returned buffer · 0c68700b
      Rob Swindell authored
      even when GETMSGTXT_PLAIN mode flag is used and the message contains a MIME-encoded plain-text portion. Obviously the GETMSGTXT_NO_HFIELDS exception still applies.
      
      The fixed problem was when forwarding a MIME-encoded email, the forwarding information (and user comment, if supplied) could be suppressed/lost.
      0c68700b
    • Rob Swindell's avatar
      Overhauled message forwarding, allow comments · 7b5c33e2
      Rob Swindell authored
      No longer derive the new message header from the original - too many problems. Simplified the forwarding support smblib (multiple SENDER* and RECIPIENT* header fields no longer expected/supported). Technically, the FORWARDED header field really serves no important purpose now.
      A comment can be passed into forwardmail() or (if NULL), will be prompted for. There is an issue where the added comment can be obscured by the receiving mail program if the original message is a multi-part MIME message. Not sure the best solution for that. Still a WIP in that regard.
      7b5c33e2
  25. 09 Dec, 2020 2 commits
    • Rob Swindell's avatar
      Dump the "forwarded" header field date/time nicely · 4617db4f
      Rob Swindell authored
      Use ctime_r() to dump the forwarded date/time.
      Correct some other unsafe uses of ctime() here (replace with cime_r).
      Fix the accidental reference to the GPL license (it's actually LGPL for smblib).
      4617db4f
    • Rob Swindell's avatar
      When a message has been forwarded, invalidate the "to" ext/net ptrs · 05104f13
      Rob Swindell authored
      The convenience pointers to_ext and to_net need to be invalidated (nullified) if we are going to allow forwarding from local email boxes to network mail and keep all the original message header fields in tact.
      
      The "Forwarded" field must now be added *before* any new recipient information (local user extension or network address of the forwarding destination).
      
      This is part of the solution to request #83, #108, and #141.
      05104f13
  26. 12 Nov, 2020 2 commits
    • Rob Swindell's avatar
      Fix crashing bug introduced in previous commit of this file · 6dd2aedb
      Rob Swindell authored
      Don't pass NULL to strcasestr().
      6dd2aedb
    • Rob Swindell's avatar
      Improved parsing of "charset" parameter in MIME Content-Type header. · ad79c591
      Rob Swindell authored
      In Issue #177, the reported problem message header was "Content-Type: text/plain; charset=utf-8; format=flowed"
      The fact that the "charset" value was not quoted and not space delimited means the charset would have been parsed as "utf-8;", which would not provide an exact match (against "utf-8") in smb_msg_is_utf8() and thus the message body would not be considered to be utf-8 encoded.
      
      The solution is to terminate the "charset" parameter value at the semicolon, if it exists, and the value was not quoted.
      
      Also, for good measure, only search for " charset" or ";charset" to avoid false-positive parameter matches,  like "notcharset".
      ad79c591
  27. 06 Nov, 2020 1 commit
    • Rob Swindell's avatar
      Replace ctype.h function calls with new MSVC-safe XPDEV macros · 8a7b7308
      Rob Swindell authored
      I'm fed-up with MSVC assertions in ctype functions (e.g. isdigit, isprint, isspace, etc.) when called with out-of-range (e.g. negative) values.
      
      This problem only affects MSVC debug builds, but if you run them (like I do), these things are like little time bombs that can drive you crazy (knocking your board out of service).
      
      The new macros names are bit more descriptive as well.
      8a7b7308
  28. 05 Nov, 2020 1 commit
  29. 26 Sep, 2020 1 commit
    • Rob Swindell's avatar
      Add smb_msg_type() and smb_msg_count() for index-based msg counting. · a3e430e0
      Rob Swindell authored
      In support of message bases with vote-messages and poll-closures:
      
      smb_msg_type() returns an enum smb_msg_type inferred from the combination
      of attribute flags specified (should match msghdr_t.type).
      
      smb_msg_count() calculates the number of message index records of the
      specified type(s) (a bit-field) by reading the message base index file. This
      value should only used for info/display purposes, so no locking is performed
      to return the result as fast as possible.
      
      This allows an accurate number of "posts" (posted *messages*) to be queried
      and displayed to a user when appropriate (e.g. instead of
      smb.status.total_msgs or just the size of the index file divided by the size
      of an index record). In that case, since vote messages and poll closures
      aren't displayed as messages to users, exclude those from the count to reduce
      confusion. For message bases that don't support voting, this scheme is not
      necessary.
      a3e430e0
  30. 15 Sep, 2020 1 commit
    • Rob Swindell's avatar
      Switch from static C runtime library to runtime DLL · 05c45f17
      Rob Swindell authored
      This fixes the stat() issue on Windows XP/2K3 by allowing sbbs to benefit
      from the run-time library updates that Microsoft releases periodically
      (like https://www.microsoft.com/en-us/download/details.aspx?id=53840).
      
      For more info on the stat() issue which caused all kinds of sbbs errors
      (e.g. creating directories initially, but a lot more):
      https://stackoverflow.com/questions/32452777/visual-c-2015-express-stat-not-working-on-windows-xp
      
      Since we are using cryptlib which requires the MSVC runtime DLL anyway
      (it is the default build behavior of MSVC), we weren't really gaining
      anything from statically linking the CRTL (LIBCMT.LIB). And for some reason,
      an up-to-date MSVC2019 still has (links-in) a LIBCMT.LIB file that includes
      this stat bug. All the online help resources I found just to seem to suggest
      updating the CRTL DLLs (on the target system), with no mention of any fixes
      available for the static CRTLs on the build system. But with the no gain
      from static linking anyway, I figured it was time to switch to DLL CRTLs.
      
      The debug builds are still statically linking the CRTL for no particular
      reason.
      05c45f17
  31. 16 Aug, 2020 2 commits