• src/sbbs3/js_filebase.c

    From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Sun Apr 4 13:38:22 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/659f6e0d87fea403aae9236d
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Fix memory leaks caught by Coverity.
    --- 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 Apr 4 15:13:57 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/bc4f24f5626f1c7bdf528680
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Alt paths aren't supported/used any longerFixes CID 330973
    --- 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 Apr 4 15:13:57 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/aee8542a6afaf51083b869d2
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    dirnum is unsigned, so do not check for negativeCID 330990
    --- 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 6 18:37:13 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/e719d289fb2b2f836fb6b321
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Include all properties in getter when detail is MAXAdds from/tags/desc/extdesc properties, even when absent or blank.When parsing a file object, set the from,
    desc, tags and cost properties only if they already have been set or the new values is non-blank/0.
    --- 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 6 19:17:30 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/bf1644a88808595973c4a494
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Fix missing paren warnings.
    --- 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 6 19:23:56 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/0d215884b2c89383ff6c59b4
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Don't expand empty from, tags, desc properties unless detail=MAX
    --- 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 6 23:32:34 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/e7efe6d343ca10a959dfae4e
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Fix hash() method broken in commit bc4f24f5 - file needs the dir num
    --- 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 Apr 11 20:33:28 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/8b59ee66aa45470694ded86b
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Add format_name() method to format a filename for displayIt's a wrapper for filedat.c -> format_filename() which can truncate and pad a filename for display purposes.
    --- 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 Apr 12 20:49:19 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/cc06b0b54b403549e83a268d
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Fix some memory leaks
    --- 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 13 01:09:41 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/c487956b0d81725b50057cb2
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Check return value of JS_ValueToInt32()CID 331092
    --- 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 Apr 18 15:43:05 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/2eb90776e1b0c1845d21c516
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    remove() method needs to read message header (not just index)Or else it fails with the following base error:!smb_putmsghdr illegal header length increase: 70
    (1 blocks, 0 hfields, 0 dfields) vs 0 (0 blocks)
    --- 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 Apr 18 17:01:43 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/e5ccdb106973f01eb85dd564
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    get_size() and get_path() methods need to read the header record tooFor files with names > 64 chars.
    --- 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 2 01:17:07 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/63a2631feccde997f9ddb0fc
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    JSDOC updatesFinally document the file-meta-object properties now that things are solidifying.
    --- 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 2 01:43:45 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/24bf49ea8843706ebbc7dfc9
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Add a 'readd_always' option to the update() methodThis will cause archive file contents to be re-captured/added
    --- 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 23:57:52 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/b3d55fd249366cd28d4bfc99
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    The optional JSON-metadata string property is now "metadata"The old "content" array property goes away.
    --- 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 23:57:52 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/1c96d408344fc24113b40be7
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Allow the metadata property to be set with add() and update()Sorry for the impending imminent merge hassle Deuce!
    --- 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 May 13 00:06:54 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/2b047cf6edd3d3108107a5ac
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Don't populate metadata property unless there is metadata Or detail level is MAX.
    --- 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:11:53 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/3e5326e0e81d2497468e238c
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Correct JSDOCS for get_path, get_size, and get_time methodsThese methods also (optionally) accept a file-meta-object as an argument.
    --- 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 Jan 19 00:09:12 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/2d033355aab58a6a6c78db5d
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Fix typo (wrong default size value) in JSDOCS for format_name()The default is 'size' parameter value is 12 characters, not 13.
    --- 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 Feb 1 19:13:49 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/70898b5bbf5f1b993a0f1cfc
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    add() method will now parse added, last_downloaded, and times_downloadedThese 3
    'stats' properties were read-only (never used when adding a file). To support moving files between FileBases while retaining these stats, support the parse/use of these file-meta-object property values.Should fix issue #333 reported by Nightfox.
    --- 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 Mar 20 20:32:05 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/623c49e43906d3f86fb3c247
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    File's meta-object's "size" and "time" properties reflect current valuesQuery the disk for file's current "size" and "time" values when get_list() or get() method is used with a "detail" level of >= DETAIL.NORMAL and the "check file existence" toggle option is enabled for this directory in SCFG.I pondered and contemplated whether this configuration setting should be checked/applied here or in the various JS scripts (e.g. filelist.js) and decided here was best to provide the most uniform/expected behavior, even though there is a performance impact. If a script doesn't need/use these properties, they should probably be specifying the DETAIL.MIN (minimal) detail level in their queries anyway, which
    will then bypass these performance-impacting disk queries.
    --- SBBSecho 3.15-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 Sun Dec 24 17:33:28 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/41ace72c24800de0fa0b3b23
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Fix filebase corruption caused by FileBase.renew()

    echicken reported this problem: pretty severe filebase corruption as a result of calling FileBase.renew(). The problem seemed pretty obvious (only loading the file's index record), but I do think the underlying SMBLIB functions
    should be more resilient to misuse and not corrupt the base. So, that's still
    a TODO.

    No existing scripts were using FileBase.renew(), so this problem has gone unnoticed since SBBS v3.19.
    --- 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 Dec 25 20:29:47 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/22d7343f21cbd9cee29a4118
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Rename the METADATA and metadata properties to AUXDATA and auxdata

    To eliminate confusion with the file-meta-object that this API deals with
    more than anything else.

    echicken's suggestion

    Nothing used this property before now, so this should be fine.
    --- 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 Thu Dec 28 18:10:58 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/ad309d463528da40cfd32354
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Fix misuse of JSVAL_TO_DOUBLE() for "cost" and "size" file-meta-obj properties

    As pointed out by echicken: when setting the "cost" property to any value, the actual
    file's cost would be set to 9223372036854776000 regardless of what number was in the
    provided file metadata object. Most jsval numbers aren't doubles (they're ints)
    so
    need to use JS_ValueToNumber() to do the proper conversion, regardless of underlying
    type.

    Noticed the same problem with the "size" property.

    Thanks for the tests and report echicken!
    --- 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 Fri Dec 29 17:10:27 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/0dbd3f064a2dee66cca6c409
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Fix some apparent memory leaks when using file's auxdata

    Nobody's really using this auxdata yet, besides echicken, so no impact for others.
    --- 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 Fri Dec 29 17:10:27 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/831ddd710d935eee37639446
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    When FileBase.update() is called with readd_always=true, update date-added

    The use from addfiles.js (the -readd option) implies this is what's expected. And echicken was suprised the 'added' date/time-stamp wasn't udpated.
    --- SBBSecho 3.20-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 Mon Jun 17 20:38:51 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/946e42d6fc4e56de23c8c664
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    FileBase.add() now supports override to *never* extract/use DIZ if desired

    Working on fileman.js, when moving files to another base, the output of unzip (trying to extra a FILE_ID.DIZ) was corrupting the display. We don't really want a DIZ file to get imported when moving files between bases anyway.

    So the second parameter to FileBase.add() can be either:
    - undefined: will try to extract/use DIZ only if there's no ext desc already
    - true: will try to extract/use a DIZ even if there's an ext desc already
    - false: will never try to extract/use a DIZ

    If the directory is not configured for DIZ support, then the DIZ extraction/use will never occur under any condition.
    --- SBBSecho 3.20-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 Mon Jun 17 20:38:51 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/35cde60c2a947b8a5e2ce2c4
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Better JSDOC description of use_diz param to FileBase.add()
    --- 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 Thu Jun 20 15:00:05 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/32e880895b1acec254d426ad
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Fix 64-char filename length limit for FileBase.get[_path/size/time] methods

    This was only a problem when these methods were passed a file-meta-object instead of the file name. In hindsight, that's kind of a dumb API "feature" since we're just parsing the name property out of the object.

    The file_t.file_idx.name is limited to 64 chars, so don't use that struct element to store the parsed "name" property of the passed file-meta-object.
    --- SBBSecho 3.20-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 Fri Jun 21 00:26:42 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/f532bee963c7e7fb6df4fc77
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Fix bug with FileBase.get_time() for filenames > 64 chars in length

    We need to read the file header (not just index) entry to get the actual
    full filename.

    Also, removed some extraneous calls to getfilepath() that served no
    purposed.
    --- SBBSecho 3.20-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 Fri Jun 21 12:45:08 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/726a08527c590b38136b7ef7
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Fix new small memory leak (no need to use strdup here)

    Fix CID 497098
    --- SBBSecho 3.20-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 Fri Sep 13 20:08:11 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/2fc23c32c4b0b19685f2cb0e
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    FileBase.update() method throws more exceptions upon error

    This will help to determine cause of any file update (e.g. rename)
    failures, as reported by Nelgin.
    --- SBBSecho 3.20-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 Fri Sep 13 20:45:33 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/397d6ebe5b0185bdff5c0c59
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Don't allow FileBase.update() to create a duplicate file

    FileBase.update() will now throw an exception if attempting to rename a file
    to a filename that already exists in the filebase index.

    Prior to this change, one could (via JS methods) rename a file in the base to create a duplicate filename which would corrupt the base (one index entry and two header records for the same filename).
    --- 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 Sep 16 18:52:34 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/2391c3c9a3912622b8016333
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Update JSDOC description of update() method

    Clarify that this is the method to use to rename a file.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)