• src/smblib/smblib.c

    From rswindell@VERT to CVS commit on Wed Jul 15 16:43:31 2015
    src/smblib smblib.c 1.148 1.149
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv32407

    Modified Files:
    smblib.c
    Log Message:
    Add call to fflush() to smb_getstatus() to attempt to fix reported problem
    (on Linux) where the "total messages" value (stored in the SMB status header) is stale when the header is updated in another open instance of the message base. Sorry, I forgot to complete the commit earlier than I originally said I did.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From rswindell@VERT to CVS commit on Thu Nov 26 02:30:29 2015
    src/smblib smblib.c 1.149 1.150
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv21615

    Modified Files:
    smblib.c
    Log Message:
    Updated comment.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From rswindell@VERT to CVS commit on Thu Dec 10 11:45:33 2015
    src/smblib smblib.c 1.152 1.153
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv10811

    Modified Files:
    smblib.c
    Log Message:
    Fix bug new bug introduced in previous commit to this file:
    In smb_hfield_add_netaddr(), if the net_type is specifically set to NET_NONE and passed to this function, do not return SMB_ERR_NOT_FOUND (-110). This allows the nntpservice.js, for example, to create a message that is technically "local", but with a from_net_addr (the NNTP-posters email address).

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From rswindell@VERT to CVS commit on Fri Nov 11 17:34:01 2016
    src/smblib smblib.c 1.155 1.156
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv2745

    Modified Files:
    smblib.c
    Log Message:
    smb_updatethread() now sets the MSG_REPLIED attribute for the message being replied to. This may be used later for thread loading optimization (no need
    to load headers if there are no replies) - but for now, at least there will
    be a "Replied" attr value displayed in the message header indicating that
    the message was replied to. This attribute was previously only used in the "mail" base (for personal email/netmail).

    Also, I think I fixed what could have been an infinite loop if there was SMB corruption: if a message's thread_next value pointed back (to an earlier message, with a lower message number), we could have been caught in an
    infinite loop looking for the last message in the thread. This is just a theoretical problem and never reported, but apparently possible with just
    the right kind of corruption of the msgbase header.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From rswindell@VERT to CVS commit on Sat Nov 12 10:53:40 2016
    src/smblib smblib.c 1.156 1.157
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv1313

    Modified Files:
    smblib.c
    Log Message:
    smb_hfield_add_netaddr() will now return an error if passed a NULL "addr" pointer.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From rswindell@VERT to CVS commit on Tue Nov 22 23:35:54 2016
    src/smblib smblib.c 1.160 1.161
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv311

    Modified Files:
    smblib.c
    Log Message:
    Fix bug in smb_updatethread(), was setting the "REPLIED" attribute in the header of the original message (after the first reply), but wasn't setting the same flag in the index.
    This results in "Attributes mismatch" errors from chksmb.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From rswindell@VERT to CVS commit on Wed Nov 23 12:59:48 2016
    src/smblib smblib.c 1.161 1.162
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv22125

    Modified Files:
    smblib.c
    Log Message:
    Fix bug in smb_updatethread() introduced in last commit of this file:
    If the msg->offset is 0, we must call smb_getmsgidx() to find its offset, otherwise smb_putmsg() which calls smb_putmsgidx() will overwrite the index
    of the first message.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From rswindell@VERT to CVS commit on Wed Nov 23 13:16:51 2016
    src/smblib smblib.c 1.162 1.163
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/home/rswindell/sbbs/src/smblib

    Modified Files:
    smblib.c
    Log Message:
    Resolve use of parenthesis warning.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From rswindell@VERT to CVS commit on Thu Nov 16 01:05:57 2017
    src/smblib smblib.c 1.170 1.171
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/home/rswindell/sbbs/src/smblib

    Modified Files:
    smblib.c
    Log Message:
    When creating a message base with smb_create(), it'll create (or overwrite) <code>.ini and add a single key to the global/root section:
    Created = 0x<time_t> which can be used (e.g. by nntpservice.js) to determine the date/time the message base was created.
    This makes the <code>.ini files an official part of the SMB format. Wheee.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Tue Nov 21 15:24:20 2017
    src/smblib smblib.c 1.171 1.172
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv547

    Modified Files:
    smblib.c
    Log Message:
    smb_freemsgdat() [called by smb_freemsg_dfield() and smb_freemsg()]
    and smb_incmsg_dfields(), now lock and unlock the SMB header.
    This shouldprevent some mail base corruption as well as this error:
    -203 (smb_incmsgdat 13 'Permission denied' reading allocation record at offset 795568) incrementing data allocation units

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Digital Man@VERT to rswindell on Tue Nov 21 17:24:39 2017
    Re: src/smblib/smblib.c
    By: rswindell to CVS commit on Tue Nov 21 2017 03:24 pm

    src/smblib smblib.c 1.171 1.172
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv547

    Modified Files:
    smblib.c
    Log Message:
    smb_freemsgdat() [called by smb_freemsg_dfield() and smb_freemsg()]
    and smb_incmsg_dfields(), now lock and unlock the SMB header.
    This shouldprevent some mail base corruption as well as this error:
    -203 (smb_incmsgdat 13 'Permission denied' reading allocation record at offset 795568) incrementing data allocation units

    This was an erroneous commit of the wrong file, so I removed this revision from CVS. You can ignore this particular commit message.

    digital man

    This Is Spinal Tap quote #15:
    Review on "Shark Sandwich", merely a two word review: "Shit Sandwich".
    Norco, CA WX: 81.2øF, 25.0% humidity, 0 mph S wind, 0.00 inches rain/24hrs
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sat Mar 3 20:07:14 2018
    src/smblib smblib.c 1.172 1.173
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/home/rswindell/sbbs/src/smblib

    Modified Files:
    smblib.c
    Log Message:
    Include hex values of invalid base/header IDs in the error message.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sun Mar 4 14:59:41 2018
    src/smblib smblib.c 1.173 1.174
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/home/rswindell/sbbs/src/smblib

    Modified Files:
    smblib.c
    Log Message:
    Fix potential bug:
    If caller doesn't zero-initialize smb_t, then the 'lock' member could've
    been non-zero (garbage) and some functions would then not lock the SMB
    header, used for protecting against corruption from multiple process or thread modification of the same base.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sun Mar 4 16:35:43 2018
    src/smblib smblib.c 1.174 1.175
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/home/rswindell/sbbs/src/smblib

    Modified Files:
    smblib.c
    Log Message:
    smb_addmsghdr() will now confirm the index file length against the status.total_msgs value: if they don't match, don't add header & index
    to the message base, it's apparently corrupted and we're only going to
    make things worse as smb_putmsgidx() will fail (after we've stored the hdr) with an "invalid index offset" error.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Thu Mar 8 20:53:58 2018
    src/smblib smblib.c 1.175 1.176
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/home/rswindell/sbbs/src/smblib

    Modified Files:
    smblib.c
    Log Message:
    A couple of the smb last_error strings had "index" and "header"
    conflated. Added " file" as well.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sat Jul 7 21:02:26 2018
    src/smblib smblib.c 1.177 1.178
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/home/rswindell/sbbs/src/smblib

    Modified Files:
    smblib.c
    Log Message:
    smb_lockmsghdr() - if the 'locked' smb instance property is already set,
    don't try to (re)lock it, just return SMB_SUCCESS.

    I honestly don't recall why I made this change, but it makes sense, so I'm committing it finally.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Mon Oct 22 21:38:53 2018
    src/smblib smblib.c 1.181 1.182
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv16447

    Modified Files:
    smblib.c
    Log Message:
    Removed stray (extra) semicolon - no effect.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sat Feb 16 04:09:15 2019
    src/smblib smblib.c 1.183 1.184
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv29070

    Modified Files:
    smblib.c
    Log Message:
    Performance optimization: When performing sequential index or header reads,
    the read buffer may be utilized more efficiently if you do *not* perform an (unnecessary) seek operation just before the read. By eliminating unnecessary seeks in smb_getmsgidx() and smb_getmsghdr(), I was able to reduce the time required to load 9000+ index and header records over a network (Samba/CIFS) share from 15+ seconds to less than 5.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Mon Feb 18 23:11:53 2019
    src/smblib smblib.c 1.185 1.186
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv17040

    Modified Files:
    smblib.c
    Log Message:
    Fixed a couple of function return-value comments.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Tue Mar 19 16:02:02 2019
    src/smblib smblib.c 1.186 1.187
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/home/rswindell/sbbs/src/smblib

    Modified Files:
    smblib.c
    Log Message:
    Use DEFFILEMODE for file creation mode in smb_addcrc() - another potential
    for file permissions issues when smblib creates *.sch files.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sat Apr 6 01:00:14 2019
    src/smblib smblib.c 1.187 1.188
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv10033

    Modified Files:
    smblib.c
    Log Message:
    smb_copymsgmem() fix:
    Did not clear/set convenience pointers (e.g. msg.subj), so they would point
    to the source message hfield_dat buffers which may be freed or garbage. Apparently nothing that used smb_copymsgmem() used the convenience pointers (before now), so it hasn't been a problem before now. <shrug>
    It became a problem becaue I'm going to use this function in js_put_msg_header to fix a problem where the underlying smbmsg_t representation is not current even after MsgBase.put_msg_header() is used.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sun Apr 28 20:56:48 2019
    src/smblib smblib.c 1.193 1.194
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv7937

    Modified Files:
    smblib.c
    Log Message:
    Actually set and clear the smbmsg_t.forward_path (SMTPFORWARDPATH) convenience pointer - apparently this has never actually been used before.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sun May 5 04:06:52 2019
    src/smblib smblib.c 1.197 1.198
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/home/rswindell/sbbs/src/smblib

    Modified Files:
    smblib.c
    Log Message:
    Clear the new convenience pointers: text_subtype and text_charset
    in clear_convenience_ptrs() - otherwise they can be double-freed when the message (smbmsg_t) is copied with smb_copymsgmem().


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Mon Jul 8 00:16:10 2019
    src/smblib smblib.c 1.199 1.200
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv18855

    Modified Files:
    smblib.c
    Log Message:
    Increment SMBLIB version 2.61 (added new function: smb_msg_is_utf8).


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Wed Jul 17 20:09:12 2019
    src/smblib smblib.c 1.200 1.201
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv17444

    Modified Files:
    smblib.c
    Log Message:
    Address warnings reported by Visual Studio 2017 - Windows XP (v141_xp) toolset

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sat Jul 20 12:10:27 2019
    src/smblib smblib.c 1.201 1.202
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/home/rswindell/sbbs/src/smblib

    Modified Files:
    smblib.c
    Log Message:
    Fix some new GCC warnings about printf arg type mismatches.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sat Apr 4 15:11:36 2020
    src/smblib smblib.c 1.205 1.206
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/home/rswindell/sbbs/src/smblib

    Modified Files:
    smblib.c
    Log Message:
    Include more details in "illegal header length increase" error msg.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Tue Apr 14 01:22:54 2020
    src/smblib smblib.c 1.206 1.207
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv6132

    Modified Files:
    smblib.c
    Log Message:
    On Windows, smb_addmsg() was slow because smb_updatethread() was slow:

    So on Windows, calling unlock() on a file region that you don't have locked, incurs a delay. Likewise, calling lock() on a file region that already have locked incurs a delay. These delays were seriously throttling message imports on Windows (e.g. importing echomail or QWK packets). What should take a few seconds, was taking minutes with noticeable delays. This code has been performing redundant locks/unlocks for over 15 years, so I can only conclude that the performance penalty is a new behavior introduced in recent version(s) of Windows.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Tue Apr 14 01:50:32 2020
    src/smblib smblib.c 1.207 1.208
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv11249

    Modified Files:
    smblib.c
    Log Message:
    Some very old, yet inconsistent, behavior of smb_hfield_add() could pretty easily result in a message body being added to a message base with no accompanying message header: if the header data was 0-length, the hfield_dat was not actually allocated and the applicable smbmsg_t convenience pointer was not set accordingly. This had the side effect that if a message were to be imported with a blank recipient ("To" field), the header was not created at
    all (to support mutliple header, single body msgs, i.e. bulkmail).
    The other functions that set the convenience pointers do not treat 0-length header field data special, so this was inconsistent behavior.
    Most message types (e.g. networks) don't want 0-length "to" fields, but that shoudl be enforced somewhere else, not here.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Thu May 7 12:30:23 2020
    src/smblib smblib.c 1.208 1.209
    Update of /cvsroot/sbbs/src/smblib
    In directory cvs:/tmp/cvs-serv3248

    Modified Files:
    smblib.c
    Log Message:
    smb_hfield_add_netaddr():
    Don't strip the "user@" portion of a *NETADDR header field if the specified net-type is NET_NONE.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Wed Dec 9 00:42:43 2020
    https://gitlab.synchro.net/main/sbbs/-/commit/05104f134188b139a6f3e5ba
    Modified Files:
    src/smblib/smblib.c
    Log Message:
    When a message has been forwarded, invalidate the "to" ext/net ptrs

    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.
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun May 2 17:14:43 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/ba1f38cc4126d388c6a897ef
    Modified Files:
    src/smblib/smblib.c
    Log Message:
    When adding a msg/file header, remove the DELETE attribute

    When moving or renewing files, they're first removed and then added and they were being added with the DELETE attribute set. The filenames are displayed in red when staged for deletion/removal, so that's how I noticed. Oops.
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows)@VERT to Git commit to main/sbbs/master on Mon May 8 18:07:50 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/2ee37e4ee9e91ddb2d790f72
    Modified Files:
    src/smblib/smblib.c
    Log Message:
    Fix the relocation of enlarged message headers in smb_putmsghdr()

    The first commit of this feature would leave the base corrupted for a couple
    of reasons (.sha file wasn't opened, using modified header when re-writing the old header to set the DELETED attribute). Both fixed.
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Mon May 8 18:09:07 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/b5c5630c1ccd675a559dd98d
    Modified Files:
    src/smblib/smblib.c
    Log Message:
    More detail in error strings in smb_getmsghdr()
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows)@VERT to Git commit to main/sbbs/master on Mon May 8 18:16:05 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/4985797d2b07ca169326ab6f
    Modified Files:
    src/smblib/smblib.c
    Log Message:
    Streamlined code: we need only one check for hyper-alloc'd msg base here

    No functional change.
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Fri Dec 29 17:10:28 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/47fe4a60247147dc217ad02b
    Modified Files:
    src/smblib/smblib.c
    Log Message:
    Fix stale comments (msg.offset became msg.idx_offset a couple years back).
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Fri Sep 13 20:08:11 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/1ab4ef2bfe0d0b1c7598cc53
    Modified Files:
    src/smblib/smblib.c
    Log Message:
    smb_getmsgidx() now reads entire index records from file bases too

    chksmb needed this to perform filename checks (index against headers).
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Fri Sep 13 20:30:10 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/ffa2c51ba23c59641e1a6e47
    Modified Files:
    src/smblib/smblib.c
    Log Message:
    MSVC requires a 0 in the struct initializer
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Sun Nov 10 16:14:22 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/6224ce6476a079f5e1e7a880
    Modified Files:
    src/smblib/smblib.c
    Log Message:
    Fix printf formatting issue in error message

    GCC and Coverity (x 2) both flagged this one.
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net