• src/sbbs3/filedat.c

    From rswindell@1:103/705 to CVS commit on Tue Feb 20 03:22:20 2018
    src/sbbs3 filedat.c 1.37 1.38
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv6412

    Modified Files:
    filedat.c
    Log Message:
    Address Coverity-reported resource leaks.

    --- SBBSecho 3.03-Win32
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From rswindell@1:103/705 to CVS commit on Sat Jan 12 00:11:13 2019
    src/sbbs3 filedat.c 1.39 1.40
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv30817

    Modified Files:
    filedat.c
    Log Message:
    Optimized getfiledat():
    rather than calling both flength() and fdate() (which both call stat()), just call stat() once and use the result for both file size and date/time.

    --- SBBSecho 3.06-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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).
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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 < normalWhen 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.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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/patternExtracting 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)
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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 successThis may have contributed to plt's file editing woes.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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_tResolve 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ΓÇÖ
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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 listNot 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.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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 msgHopefully this helps get to the bottom of Ragnarok's reported problem creating ZIP QWK files with libarchive.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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 charsAs 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".
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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 pointerCID 345291It'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.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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_listThe 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.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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
    --- SBBSecho 3.15-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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>
    --- SBBSecho 3.15-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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 headerWhen loadfiles() calls sortfiles(), only the file's index records have beenread 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 thenatural index order of the files already (order imported/added), onlyobserved when sorting by date descending (newest at the top).
    --- SBBSecho 3.15-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 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() betterAddress issue reported by Nightfox via DOVE-Net:Today I was using the Archive class to extract exactly one file from a zipfile, and I'm a little confused on the exception throwing behavior regardingthe max_files parameter. When calling extract(), I gave it a filename patternand expected exactly 1 file to be extracted, so I also gave a max_filesargument as 1. It extracted the one file,
    but it threw an exception with theerror "Error: maximum number of files (1) extracted (after extracting 1 itemsuccessfully)".Should that be an error condition to throw an exception? I expected 1 file tobe extracted, and that file was extracted successfully. If I specify max_filesas 2, then it doesn't throw an exception.
    --- SBBSecho 3.15-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 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 lengthThis is just extra paranoia now since the reading of file.ini enforces the value range8
    <-> 65535 now.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (in GitKraken)@1:103/705 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.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Mon Feb 12 10:27:35 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/31ded19d6a8e8933b9f999e4
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Resolve warning: enumeration value ΓÇÿFILE_SORT_NATURALΓÇÖ not handled in switch
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)