• src/sbbs3/filedat.c

    From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun Apr 4 15:13:57 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/613d4f56a66bb8caac6aa213
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    If error is NULL, insure maxerrlen is 0.

    Hopefully this will eliminate the "Dereference after null check" warnings by Coverity (e.g. CID 330993).

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Wed Apr 7 20:33:48 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/4391ca758f32b9af128c87b8
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Sorted loadfiles() results were corrupted when detail was < normal

    When only reading the index (detail = file_detail_index), smb_getfile() just sets the file->name convenience pointer to point to the name in the index. Then when loadfiles() would sort the list, these pointers would not be adjusted (so they would point to the wrong names) resulting in a corrupted file list (e.g. name/size mismatches and no logical sort order).

    The solution is to call smb_getfile() on each file *after* the read index records have been sorted.

    This also means that the sort-by-name routines needed to always sort using the index name and not the convenience pointer (which is NULL in this case).

    While fixing this, I noticed there was no bounds checking in the loadfiles() and loadfilenames() read-loops, so if the indexes happened to be longer than the total_files value from the status header, a buffer under-alloc/overflow would occur and a likely crash as a result. So stop reading the index when the expected maximum number of index records have been read.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Tue Apr 20 21:59:28 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/64a903eb179981ba0cf6fb2c
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Fail on "disallowed filename" after filtering for filename/pattern

    Extracting a file_id.diz would fail if the file contained any disallowed filenames before the DIZ, e.g.:
    Error: disallowed filename '_blockmen_res[v]olution.ans' (after extracting 0 items successfully)

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sat Apr 24 20:23:32 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/18af43a4ca8901b0d760b104
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Address Coverity defects.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Tue May 4 22:21:44 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/4ebe38f5c7ad7f7ac884ace3
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Don't sort the keys in the content sections of a file.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Wed May 12 20:41:10 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/024319d68e4a95a33297492b
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Speed up list_archive_contents()

    Don't use iniSet* since we know we're not updating existing ini entries. Use strListAppendFormat() instead.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sat May 15 23:09:55 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/83b8f43a4e95b481dd21abc1
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Fix typo that caused updatefile() to return false on success

    This may have contributed to plt's file editing woes.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun May 16 00:16:37 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/ed3fb8cc83a90671ea3ecce3
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Check return value of fseek() and fstat()

    CID 330960, 330967, 330988

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sat May 22 17:10:09 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/92fa411c3bc19ac6bed11a12
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Use int64_t instead of la_int64_t

    Resolve error reported on irc with Ubuntu (don't know what version):
    <rjwboys> ok now i get filedat.c:896:3: error: unknown type name ‘la_int64_t’

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Tue Jun 8 22:39:27 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/04a41e14f817b95731ceda27
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Remove tbz (tarred bzip) files from supported archive list

    Not supported by default on Windows and perhaps not on all *nix systems.
    You can still support creation of tbz files if you like, but you'll need to setup an external "Compressible File Type" in SCFG to do it.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Tue Jun 8 23:02:32 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/a2110bfca79e1f4dfb584517
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Include archive_error_string() in archive_write_header failure msg

    Hopefully this helps get to the bottom of Ragnarok's reported problem creating ZIP QWK files with libarchive.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Jan 3 19:11:06 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/0553ef9b362cd580092cade6
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    The simpler fix to issue #317 (nested DIZ files)

    By extracting with with_path=true, the file_list matching won't match the nested DIZ files.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Jan 10 19:55:52 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/60e4d7af2800557e2435af16
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    loadfiles() will perform liberal filename matching when len > 12 chars

    As discovered while making the Synchronet v3.18b feature video (https://www.youtube.com/watch?v=_IWzIV0_sZ4), when only a shortened version of a long filename is displayed (e.g. due to 80 column terminal width limitations), trying to download that filename by specifying the filename at the Download File(s) Filespec [All Files]: prompt can be problematic.

    For example (as seen in the video), the file "SyncTERM-1.1-setup.exe" is displayed as "SyncTERM.exe" (on an 80-column terminal), yet trying to download "SyncTERM.exe" (or "syncterm.exe") using the 'D'ownload command would fail to find a file with that name (understandably, but frustratingly so).

    This change will transform the requested filename-to-load if it is at least 12 characters in length and contains no wildcards (* or ?), to include a filename extending wildcard: "filename.txt" will become "filename*.txt" and "longfilename" will become "longfilename*".

    For requested filespecs of NULL (all files) or specs containing wildcards or specs (filenames) less than 12 characters in length, no filespec transform takes place: so trying to list/download "a" doesn't match "apple.txt".

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Thu Jan 13 19:06:35 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/063d470031c30c732d27caf8
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Address Coverty reported issue about dereferencing a NULL pointer

    CID 345291
    It's actually a false positive because if an extension (".suffix") exists in filespec, it must also exist in newfilespec since it's a copy, but whatever. It's better form to check.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sat Jan 15 20:14:02 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/27f8668cd1429dd8b03b87af
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Fix printf format issue in previous commit.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun Jan 23 13:44:55 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/77e2d88edb57a1f4c06ee4ed
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    create_archive() will skip directories in supplied file_list

    The file_list[] parameter was expected to contain only files, but the directory() function (used to create that file_list[]) returns a list of all directory entries, including sub-directories. I could (and maybe will) add an option to directory() to only include files or dirs, but this seemed the more direct fix for the problem reported by DesotoFireflite (VALHALLA):

    TickIT's nodelist_handler.js appears to be creating and leaving behind a sub-directory of the temp directory, triggering this error:
    1/23 11:36:56a QNET libarchive error -1 (13 opening c:\SBBS\temp\event\nodelist_handler/) creating c:\SBBS\data\VERT.REP

    Why isn't the temp directory fully cleaned up after/between events? That's another thing to look into.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Wed Feb 23 00:19:23 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/067556d75a33774e350ecae7
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Strip CP437 "graphics" characters in prep_file_desc()

    If the extended description is UTF-8, first convert it to CP437.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Tue Mar 1 22:43:08 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/4bb4130cd565b4945a999f43
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Add some NULL argument value checking

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Tue Mar 29 20:18:45 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/59200e330f416573be8a49d1
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Some archives don't have DIZ in the root directory

    (I'm looking at you, mist1221.zip)

    ... so first try to extract DIZ files from the root of the archive, then try again searching nested directories too. <sigh>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Thu Mar 31 18:59:38 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/67d3c3e2c8db7368570944e2
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Fix file list sorting by date, need to use the index not the header

    When loadfiles() calls sortfiles(), only the file's index records have been read in, so trying to sort on any header field won't work.

    This bug wasn't observable when sorting by date ascending, since that's the natural index order of the files already (order imported/added), only
    observed when sorting by date descending (newest at the top).

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Tue Aug 2 17:20:24 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/bff68ad04b5051effdd82bb0
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Check max_files value in extract_files_from_archive() better

    Address issue reported by Nightfox via DOVE-Net:
    Today I was using the Archive class to extract exactly one file from a zip file, and I'm a little confused on the exception throwing behavior regarding the max_files parameter. When calling extract(), I gave it a filename pattern and expected exactly 1 file to be extracted, so I also gave a max_files argument as 1. It extracted the one file, but it threw an exception with the error "Error: maximum number of files (1) extracted (after extracting 1 item successfully)".

    Should that be an error condition to throw an exception? I expected 1 file to be extracted, and that file was extracted successfully. If I specify max_files as 2, then it doesn't throw an exception.

    ---
    þ 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 Sat Feb 4 17:13:14 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/ef2fa232ddcb2cef11c7458a
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    If filename_maxlen is 0, don't use it enforce a maximum filename length

    This is just extra paranoia now since the reading of file.ini enforces the value range
    8 <-> 65535 now.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (in GitKraken)@VERT to Git commit to main/sbbs/master on Thu Mar 2 18:56:50 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/9a57677a496ff570f4038cd2
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Avoid possible divide-by-zero in gettimetodl()

    Default to 100000 (cps) if passed a rate_cps argument value of 0.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net