Skip to content
Snippets Groups Projects
  1. Jan 06, 2025
    • Rob Swindell's avatar
      New @-codes: FILE_FTP_PATH and FILE_WEB_PATH (don't include scheme and host) · 95191fa9
      Rob Swindell authored
      These @-codes can be used to construct ftp[s] and http[s] URLs to display to
      users. For use in new/optional display file text/menu/download.*
      
      Add optional configurable 'vpath' (per-directory) for directories that have
      web/ftp aliases, so they preferred/short path (alias) will be used in the
      expanded @-codes.
      
      In SCFG, display each directory's virtual file path ([auto-generated] or set
      manually).
      
      getfilevpath() no longer assumes the target buf is >= MAX_PATH+1 bytes long
      
      Add dir_vpath() to get a directory's vpath
      
      Extend maximum file library parent directory from 47 to 100 chars. This limit
      was likely imposed because we didn't have horiztonal scrolling input in UIFC
      getstr() support at the time. We're no longer limited by that.
      95191fa9
  2. Oct 26, 2024
  3. Sep 17, 2024
    • Rob Swindell's avatar
      Only use liberal file pattern matching in the terminal server listfile funcs · b7aaac27
      Rob Swindell authored
      Commit 3a3c889b (2 years ago now) changed loadfiles() to use liberal file
      matching (e.g. "syncterm.exe" matched both "syncterm.exe" and
      "syncterm_v1.2b.exe").
      
      This could produce surprising results when doing file list querieis/operations
      with the FileBase methods via JS (e.g. jsexec utils) and (now that I look at
      it), the FTP server too.
      
      So we should not have been doing liberal file matching *everywhere* loadfiles
      is used, just where it was a usability issue (due to displayed filenames being
      truncated to 12 chars for <=80 column terminals).
      
      Now solved by add/use of new liberal_filepattern() function only in the
      built-in file listing methods: sbbs_t::listfiles() and sbbs_t::listfileinfo().
      
      Note: Custom JS file searching/listing scripts may now need their own
      work-arounds for this usability issue, if they have it.
      b7aaac27
  4. Jan 20, 2024
    • Rob Swindell's avatar
      The great BOOL->bool conversion in xpdev · 118984e9
      Rob Swindell authored
      Still using BOOL where we need Win32 API compatibility.
      Using JSBool instead of BOOL or bool where it matters.
      Changed most relevant TRUE/FALSE to true/false too (though it's not as critical).
      
      You shouldn't need to #include <stdbool.h> anywhere now - gen_defs.h should do that automatically/correctly based on the language/version/tool. In C23, stdbool.h isn't even needed for bool/true/false definitions (they're keywords), so we don't bother including stdbool.h in that case.
      Microsoft didn't define __STDC_VERSION__ in their older tool chains (even though they were C99 compatible and had stdbool.h), so we use a _MSC_VER check to know that there's a stdbool.h we should use in that case.
      
      For other/old compilers (e.g. Borland C) we #define bool/true/false following the pattern of stdbool.h (doesn't use a typedef).
      
      I didn't convert UIFC yet.
      
      This addresses issue #698
      118984e9
  5. 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
  6. Mar 13, 2023
    • Rob Swindell's avatar
      Fix issue with DIZ extraction creating subdirs in temp · 67d6cf3c
      Rob Swindell authored
      For archives with directories, the first call to extract_files_from_archive() from extract_diz() would create sub-directories in the target (temp) directory, but no files within them.
      
      To correctly solve the original problem identified in commit 79a302f4, introduce/use a new 'recurse' argument to extract_files_from_archive() which means to recursively apply the file_list filter (if specified). Always pass 'with_path' argument as false to prevent sub-dir creation.
      
      The JS Archive.extract() method now excepts an additional boolean argument (recurse) following the file list arguments, default is false.
      
      Remove extra whitespace in Archive JSDOC method descriptions to be consistent with other object/class docs.
      67d6cf3c
  7. Jan 13, 2023
  8. Nov 12, 2022
    • Rob Swindell's avatar
      Change iniOpenFile() argument meaning from "create" and "for_modify" · f4d2e708
      Rob Swindell authored
      Now, if the BOOL argument value is FALSE, then the .ini file is opened read-only (and thus only read permissions are needed, resolving issue #455).
      
      If the BOOL argument value is TRUE, create-if-not-exist is implied. There are no use cases where we would want to open an .ini file for writing only if it already existed.
      f4d2e708
  9. Apr 30, 2022
    • Rob Swindell's avatar
      Fix DIZ extraction/use for FTP uploads · 77d72d0e
      Rob Swindell authored
      1. Was not setting f->dir to the correct directory number, so only ftp-uploads to the *first* directory (dirnum = 0) would extract DIZ files of uploaded files.
      
      Removing the 'dirnum' parameter to addfile() since that implied that you did not have to initialize the 'dir' element of the passed file_t, but you do: to get the correct file path for file size/date detection and the DIZ extraction.
      
      2. Was getting heap-corruption when freeing the imported/formatted DIZ text on Windows once the above problem was fixed: can't free() in one DLL memory that was allocated in another DLL. Created and now using free_diz() to free the memory allocated in read_diz().
      
      format_diz() handles a NULL 'lines' argument correctly/gracefully, so no need for the NULL lines check in sbbs_t::uploadfile().
      
      Added FTP server log messages for successful file upload or update by user.
      77d72d0e
  10. Apr 28, 2022
  11. Jan 27, 2022
    • Rob Swindell's avatar
      Allow files to be removed from batch queues by number · 2dfde4da
      Rob Swindell authored
      This fixes issue #328.
      
      The user actually *can* remove files from the batch queues in v3.19b, but you have to type the filenames which is not obvious from the prompt which implies you need to type the file index position (e.g. '1' for the first file in the queue). In all Synchronet versions prior, you could only remove by number (and not by name).
      
      The fix is to allow either the number or the name of the file to be entered at the RemoveWhich prompt and the file is removed from the queue successfully.
      
      Thanks Ragnarok!
      2dfde4da
  12. Jan 16, 2022
  13. Jan 04, 2022
    • Rob Swindell's avatar
      Add overwrite argument to extract_file_from_archive and Archive.extract · 45ab903f
      Rob Swindell authored
      Previously, extracted files were always overwritten (so that is the "default" for Archive.extract() and mostly what I'm specifying in the C/C++ code by default now), but this caused a problem with DIZ extraction: archives that contained multiple DIZ files (e.g in sub-directories), the last to be extracted would be used. A maximum of 3 DIZs can be extracted, so it would usually be the 3rd DIZ in the archive if there were that many.
      
      Another solution would be to *only* extract DIZ files from the root of the archive and I should look into that as well, but the always-overwrite behavior also seemed to be wrong, so that *also* needed fixing (allow caller to control behavior).
      
      This fixes issue #317, at least for archives where the root DIZ exists *before* any nested DIZ files. I'll have to try and create a purposeful archive to test the other conditions (where the root DIZ would appear *after* the nested DIZ(s)).
      45ab903f
  14. Jun 10, 2021
    • Rob Swindell's avatar
      Standardize on "metadata" as the description of a file's "tail" dfield · 1993a13c
      Rob Swindell authored
      It's anticipated that this will be used for JS-populated file metadata in JSON format in the future (and not just "archive contents" in .ini format).
      
      Also, fix the double-free issue that was occurring when moving files with extended file descriptions (sbbs_t::movefile()). This was actually the primary problem I was fixing here, but noticed the metadata issue: metadata would not have been moved along with the other file info between bases.
      1993a13c
  15. Jun 06, 2021
    • Rob Swindell's avatar
      Give sysop more control over characters allowed in uploaded filenames · ee941a02
      Rob Swindell authored
      5 options:
      - Safest Subset
      - Most ASCII, Excluding Spaces (the default)
      - Most ASCII, Including Spaces
      - Most CP437, Excluding Spaces
      - Most CP437, Including Spaces
      ee941a02
    • Rob Swindell's avatar
      More uniform safe/illegal/allowed filename (for upload) determination · d46ae0d1
      Rob Swindell authored
      sbbs_t::checkfname() now checks the file.can too.
      new filedat.c functions:
      - safest_filename() - not currently used
      - illegal_filename() - returns true for a highly-suspicious (e.g. hack attempt) filename
      - allowed_filename() - returns true if the filename is good for upload (assumed to be already checked to be legal as well).
      
      Importantly, filenames beginning or ending in a '.' are now unallowed:
      - 'dot files' are hidden (by default) on *nix
      - files ending in a '.' are problematic on Windows
      d46ae0d1
  16. May 13, 2021
  17. May 04, 2021
  18. May 02, 2021
    • Rob Swindell's avatar
      Store contents (list) of archive files in filebase (in the "msg tail") · 875a92d8
      Rob Swindell authored
      This will allow fast/easy display of archive contents without actually reading the archive files.
      
      Introduces some new functions:
      - list_archive_contents()
      - smb_adddfile_withlist()
      
      A new SMB convenience variable ("tail", aliased as "content" for a file).
      A new file detail level ("file_detail_content", exposed in JS as FileBase.DETAIL.CONTENTS) which adds a "content" array property to file metadata objects for JS FileBase.get().
      
      Files already added to the new filebases won't have this archive content automatically - I'm looking into that now (likely a new or updated JS script to run).
      875a92d8
  19. Apr 24, 2021
    • Rob Swindell's avatar
      3c9e022f
    • Rob Swindell's avatar
      DIZ enhancements: Read/use SAUCE data, support ANSI, increase max 1->4K · ef4eb8da
      Rob Swindell authored
      Inspired by Blocktronics (and other ANSI art group) packs' FILE_ID.DIZ/ANS files:
      * Support (and prioritize) FILE_ID.ANS
      * Convert ANSI color/attribute sequences in DIZ files to Ctrl-A equivalent (uses SAUCE width and ICE color, if specified)
      * Don't treat DIZ as a series of lines, they're not always nowadays.
      * New putmsg() mode: P_INDENT to print files indented by current column
      * Display full (up to 64-char) filenames in lists when using 132+ column terminal.
      * Use the Author, Group, and Title fields from the SAUCE if present/non-blank
      * 2 new text.dat strings: 301 (FiAuthor) and 302 (FiGroup)
      * Also fix bug with repeated Cost header field on bulk-uploaded files.
      
      I know this'll break the *nix build (sauce.c dependency), but I'll fix that next.
      ef4eb8da
  20. Apr 22, 2021
  21. Apr 17, 2021
    • Rob Swindell's avatar
      Restore the user-to-user file transfer feature · be1ac465
      Rob Swindell authored
      I forget who it was that said they were still using this feature in v3.18, but here you go, it's working again (the /D and /U commands). I'm not migrating any file sender/recipient info from v3.18, so only files added after upgrading to this will be downloadable from the "user" directory (if you have one).
      
      Something that I never implemented before but noticed is missing is the removal (or dereferencing) of user-to-user files that were sent from/to a user that is then deleted. So that's still a TODO item.
      be1ac465
  22. 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
  23. Nov 23, 2020
    • Rob Swindell's avatar
      The great C function dependency refactor of 2020 · cee2d280
      Rob Swindell authored
      The goal of this commit is that: only modules that either are part-of sbbs.dll/libsbbs.so or need to link with/use that library, will #include "sbbs.h" and thus be dependent on its subsequent includes (e.g. cryptlib.h, jsapi.h). This should mean extdeps.mk can be trimmed way down.
      
      I also removed CVS keyword/comments and trimmed up the boilerplate copyright notice in modified and added source/header files in this commit.
      
      There is no functional change in behavior in this comment.
      cee2d280
  24. Aug 16, 2020
  25. Jul 08, 2019
  26. Jul 24, 2018
    • rswindell's avatar
      The great Copyright year update and (mostly) removal of 2018: · f869ad3d
      rswindell authored
      Most of the copyright years in the source code were misleading (the date of
      most recent publish was actually later) and all were unnecessary. I've been
      removing copyright years piecemeal, for a long time, but I decided it was time
      to just perform a bulk search and (mostly) replace. In some cases, I left
      old copyright years on files that either are not used (and soon to be removed)
      or obsolete and unlikely to ever be touched again (e.g. Win9x FOSSIL VXD). Some
      of the runtime binaries still contain copyright years and those were updated to
      2018.
      f869ad3d
  27. Nov 08, 2011
    • rswindell's avatar
      At Deuce's request, revert his change: · 62b2e592
      rswindell authored
      "Change the last argument of wordwrap() to a flags argument and support
      making a bare LF not be ignored."
      If soft line breaks (bare LFs) are stored in the message base, they're
      expected to wrapped for 80-column terminal only.
      62b2e592
  28. Nov 04, 2011
  29. Mar 12, 2010
  30. Feb 10, 2009
  31. May 15, 2003
  32. Apr 01, 2003
  33. Apr 26, 2002
  34. Nov 11, 2000
Loading