Skip to content
Snippets Groups Projects
  1. Jan 14, 2025
  2. Jan 11, 2025
  3. Dec 21, 2024
    • Rob Swindell's avatar
      Encode local wallclock (not time_t) in SMB's when_t.time · 445394f9
      Rob Swindell authored
      Increment SMBLIB version to 3.10
      
      Fix issue #845: Changing system/OS time zone, changes dates/times of posted
      messages
      
      Sysops and users shouldn't notice any change unless they change the time zone
      of their system/OS (not accounting changes for daylight/standard time) and
      the result will be that message dates appear the same after such a change.
      
      For backward compatibily, any stored time_t's in msghdr_t.when_written.time
      (i.e. all existing SMB messages) will still be decoded and displayed properly.
      We detect a time_t value by the upper 6 bits being non-zero. When the upper
      6 bits of a when_written.time value are zero, then we know the 'year' is
      stored in the 16-bits before the when_written field (never used bits of the
      netattr field, now part of the when_t structure definition) and the Month,
      Day, Hour, Minute, and Second of the wallclock at the poster's site are
      encoded in the low 26 bits of the time field.
      
      This also eliminates more uses of 32-bit time_t that'll likely start being
      a problem 2038 and really fall over and die in 2106. At least messages'
      posting dates won't have any issue now. The "when_imported" values could use
      a similar treatment someday I suppose - and we could get rid of the
      when_imported.zone value as its not really needed we could use those 16-bits
      for the when_imported.year.
      
      Didn't change anything with filebases (still using time_t's though the
      when_written hdr field isn't used for much with regards to files).
      
      Yes, we could have converted all imported "broken down" message dates to
      UTC and continued to store them as a time_t using timegm() instead of mktime()
      for conversion to time_t, and I considered that. But we would have needed to
      create/use a flag in the message header to indicate such stored date/times
      (since they'd have to go through different adjustment for original time zone
      before display, basically reversing the logic of all the places we display the
      message dates/times using localtime verus gmtime/UTC C RTL functions),
      couldn't just initialize the time with a call to time() upon import of local
      messages (unless the local timezone happened to be UTC). And in the end, we'd
      still have a 32-bit time_t value. So this seemed the better path.
      
      I would have liked to have stored the date fields in a more human readable
      encoding (BCD or decimal, ala isoDate and isoTime_t), but I just didn't have
      the spare bits in the fixed portion of message headers to be wasteful like
      that.
      
      Here's an example from smbutil v of a message header posted after this change:
        when_written     03292595 41E0 Fri Dec 20 18:22:21 2024 PST
        when_imported    6766265D 41E0 Fri Dec 20 18:22:21 2024 PST
      
      Notice the difference in the hex encoding of the date/time between the 2
      header fields: when_imported still uses time_t. The when_written.year value
      isn't output here.
      445394f9
  4. Oct 28, 2024
  5. Oct 23, 2024
  6. Mar 17, 2024
  7. Jun 09, 2023
    • Rob Swindell's avatar
      <Deuce> ... billion-and-one result of comparison of constant 100000 warnings. · 2b087b8b
      Rob Swindell authored
      So Clang-FreeBSD was warning (in compiles of scfg/scfg*.c by Deuce):
      result of comparison of constant 100000 with expression of type 'uint16_t'
      (aka 'unsigned short') is always true
      
      Why? Cause a uint16_t's max value is 65535 (less than 100000). Sure we could
      have just lowered the UIFC max number of config items to 65535, but that would
      have been too easy. And why are these compared-with values of type uint16_t to
      begin with? Because most ctrl/*.cnf lists (of configuration items) were
      limited to 65535 entries cause ... 16-bit DOS, historically. Now that *.cnf
      files aren't used, we could just increase these scfg_t.*_total type sizes from
      16 to 32-bits, yeah? The result is this commit.
      
      I went to (signed) int so we could still keep -1 as the special illegal
      sub/dir num value (e.g. INVALID_SUB, which is sometimes used to indicate the
      email message base). Theoretically, 2 billion configuration items could be
      supported in these lists, but SCFG will limit you to 100000 anyway. So there's
      a whole lot of s/uint/int in this commit.
      
      I'd be very surprised if this doesn't result in some new GCC/Clang warnings,
      but at least the old "comparison of constant 100000" warnings are now gone!
      2b087b8b
  8. Mar 04, 2023
  9. Feb 19, 2023
    • Rob Swindell's avatar
      The great 'long int' purge of 2023 part 2 · 0932bcda
      Rob Swindell authored
      Mostly [s]printf format fixups
      0932bcda
    • Rob Swindell's avatar
      The great 'long int' purge of 2023 part 1 · 59d8974c
      Rob Swindell authored
      At one time, Synchronet was a 16-bit DOS project, plagued by the 16-bit [u]int, so long's were used everywhere > 16-bits were known to be needed/wanted (This is before the days of the standard sized types from stdint.h), and they've persisted.
      
      But '[u]long int' is 64-bits on *nix 64-bit builds, 32-bits everywhere else (even 64-bit Windows builds if/when we ever get around to that), so this could lead to insidious bugs that would only show up on one flavor or the other. Since [u]int is 32-bits on everything we currently support, we'll use that instead of [u]long.
      
      This "part 1" because I'm sure there's going to be warnings and errors from the GCC/Clang builds as a result, which I'll get to next.
      59d8974c
  10. Oct 18, 2022
    • Rob Swindell's avatar
      Full read/write support of new user.tab userbase file · 8a22b246
      Rob Swindell authored
      Also resolved some 32 vs 64-bit 'long' issues/ambiguities that have long-remained. :-)
      
      This commit also removes logon.lst file support.
      
      There's a TODO block remaining in js_user.c for setting portions of a user's birthdate (e.g. just the year or month or day).
      8a22b246
  11. Jul 03, 2022
    • Rob Swindell's avatar
      Paranoia around use of smb.subnum as an index into scfg.sub[] · b8035cae
      Rob Swindell authored
      Use the is_valid_subnum() function before using the smb.subnum as an index into (s)cfg.sub[]. Related to the previous committed fix of writemsg(): leaving the global smb.subnum as -1 (INVALID_SUB) after replying to a post via email or netmail, resulting in a crash here.
      b8035cae
  12. Mar 24, 2022
    • Rob Swindell's avatar
      Fix newly-introduced GCC warnings · d20ba4ab
      Rob Swindell authored
      d20ba4ab
    • Rob Swindell's avatar
      Support user credits and transfer stats > 4GB in total · 2d4ec7b8
      Rob Swindell authored
      Credits and daily free credits are accurate to the byte up to (a maximum) of 18446744073709551615 (that's 18 Exbibytes - 1).
      
      User's upload and download byte stats are now similarly extended in maximum range, but the accuracy is only "to the byte" for values less than 10,000,000,000. Beyond that value, the accuracy declines, but is generally pretty damn accurate (to 4 decimal places beyond the nearest multiple of a power of 1024), so I don't expect that to be an issue. This method of storing upload/download byte stats allowed me to use the same 10-character user record fields in the user.dat file.
      
      As a side-effect of this enhancements:
      * User and file credit values are now expressed in multiples of powers of 1024 (e.g. 4.0G rather than 4,294,967,296).
      * Free credits per day per security level has now been extended from 32 to 64-bits (to accommodate values >= 4GB).
      * adjustuserrec() now longer takes the record length since we can easily determine that automatically and don't need more "sources of truth" that can be out-of-sync (e.g. the U_CDT field length going from 10 to 20 chars with this change).
      * setting the stage for locale-dependent thousands-separators (e.g. space instead of comma) - currently still hard-coded to comma
      * more/better support for files > 4GB in size (e.g. in the batch download queue)
      * user_t ulong fields changed to either uint32_t or uint64_t - I didn't realize how many long/ulong's remained in the code (which are sometmies 32-bit, sometimes 64-bit) - ugh
      * Steve's ultoac() function renamed to u32toac() and created a C++ wrapper that still uses the old name, for homage
      2d4ec7b8
  13. Mar 03, 2022
  14. Feb 11, 2022
  15. Apr 04, 2021
    • Rob Swindell's avatar
      A poll() failure with EINTR does not mean a socket is closed. · 925e3b0a
      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...
      925e3b0a
  16. Mar 04, 2021
    • Rob Swindell's avatar
      Ignore filenames in subject that aren't valid filenames, e.g. "Fwd:" · e6f7ab9c
      Rob Swindell authored
      There were 2 bug identified by issue #230:
      - the "Fwd:" prefix being added to the message subject was being treated as a filename. I first thought to just remove this subject tag, but then thought it best to just ignore obviously invalid filenames in the subject in the first place.
      
      - when forwarding files to a netmail address, the 'to' extension (user number) is 0, so the file will be in the data/file/####.out directory of the sender instead.
      
      We have 4 places (at least) where the message subjects are parsed and only one of those places currently supports quoted filenames (e.g. with spaces in them) and some of the others (e.g. QWK) don't support multiple filenames at all. That should be fixed.
      e6f7ab9c
  17. Feb 15, 2021
  18. Jan 21, 2021
  19. Dec 20, 2020
  20. Dec 10, 2020
  21. Dec 09, 2020
    • Rob Swindell's avatar
      Some message attributes (auxiliary and network) weren't shown · 9de1b02f
      Rob Swindell authored
      Copy some code from atcodes.cpp to show all the aux and network attributes.
      
      Also, the MsgAttr text.dat string only contains 17 %s's but we were passing 18, so the last attribute (KillSent) would never be shown.
      
      Instead, split this into 3 strings and just pass those 3 strings to the MsgAttr format string along with a ton of blank strings. So we don't have to keep updating the MsgAttr text.dat string every time we add more attribute flags (that was kind of ridiculous).
      9de1b02f
  22. Sep 27, 2020
  23. Aug 16, 2020
  24. May 08, 2020
    • rswindell's avatar
      Add mouse hot spot support: · 87c9982c
      rswindell authored
      - hot spots are clickable screen areas (e.g. in menus and prompts) that   generate key-strokes
      - commands may be from 1 to 127 ASCII-characters in length
      - currently using the X10 mouse reporting mode, may change
      - all mnemonics strings (~Example) are automatically hot-spots
      - The new ~ @-code defines a hot spot
      - Any screen-clear operation clears all hot spots
      - sbbs now tracks the current screen (cursor position) row
      - eliminated the old "tos" (top-of-screen) boolean (row == 0 indicates "tos")
      - created an sbbs_t::ungetstr() method
      - keep track if in pause (hit a key) prompt, for special mouse behavior
      
      new JS console object:
      - row property
      - tos property is now read-only (and deprecated)
      - new methods:
        add_hotspot()
        clear_hotspots()
        scroll_hotspots()
      
      redrwstr() gets some UTF8 touch-ups as part of this commit. <shrug>
      87c9982c
  25. Oct 08, 2019
  26. Aug 24, 2019
  27. Aug 17, 2019
  28. Aug 08, 2019
  29. Aug 07, 2019
  30. Aug 04, 2019
    • rswindell's avatar
      More UTF-8 fun: · 3313a87e
      rswindell authored
      - bstrlen() moved to sbbs_t, accepts an option pmode argument so it can account
        for UTF-8 encoded strings correctly
      - JS console.strlen() now accepts an optional pmode argument (e.g. P_UTF8)
      - Renamed sbbs_t::utf8_to_cp437 to sbbs_t::print_utf8_as_cp437
      - Create/use msghdr_hfield() to perform UTF-8->CP437 conversions as needed for
        printing/copying UTF-8 encoded message header fields.
      - Defined XTRN_UTF8 misc setting flag. If a message editor does *not* have this
        flag, it is assumed to *not* support UTF-8. Will likely use this for UTF-8
        doors as some point too (none known to exist, yet).
      3313a87e
  31. Aug 03, 2019
Loading