• src/sbbs3/ftpsrvr.c

    From Rob Swindell@VERT to Git commit to main/sbbs/master on Monday, January 30, 2023 16:00:04
    https://gitlab.synchro.net/main/sbbs/-/commit/5fdf8f0fddbcc5016c033af8
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    Don't MQTT-publish the download of temp files

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows)@VERT to Git commit to main/sbbs/master on Thursday, February 02, 2023 17:51:37
    https://gitlab.synchro.net/main/sbbs/-/commit/8e94a448a7346a36d4a85dbe
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    Fix uploader-notification, credit awards, download-counters in FTP downloads

    Since v3.19 (the new filebases), when a user FTP-downloaded a file, we failed to properly find/load that file's record from the filebase (searching for the file's full path, rather than just the filename), so the code the increments the file's download counter, notifies the uploader, awards credits, etc. did not ever execute. This means that FTP-downloads for all files downloaded via FTP were effectively "free" (and nobody noticed). No error was logged either.

    I discovered this while debugging the case of "(null)" filenames in the action/download MQTT topic messages being published by the FTP server. So
    that issue is fixed as part of this commit as well.

    Oh, and if this code had executed before, it would have memory-leaked the
    file information, so that's fixed too (added call to smb_freefilemem). Ugh.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows)@VERT to Git commit to main/sbbs/master on Thursday, February 09, 2023 12:43:11
    https://gitlab.synchro.net/main/sbbs/-/commit/3709ae9d438cc0932f70c46f
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    Free/zero out the file_t struct *after* sending the MQTT action msg

    ... not before. This explains why FTP-uploaded actions had a (null) filename.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on ChromeOS)@VERT to Git commit to main/sbbs/master on Saturday, March 18, 2023 19:40:18
    https://gitlab.synchro.net/main/sbbs/-/commit/448e18156d14b0b8a2bb535a
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    Add free disk space check against minimum space configured

    Disallow uploads when free disk space falls below minimum configured
    minimum free disk space.

    This fixes issue #535

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on ChromeOS)@VERT to Git commit to main/sbbs/master on Saturday, March 18, 2023 19:40:18
    https://gitlab.synchro.net/main/sbbs/-/commit/36fea1c5acf774be516d1df6
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    Limit uploaded file sizes, accounting for free disk space

    The lower of the configured maximum file size (for the FTP server) and
    the available disk space minus the configured minimum free disk space
    is used as the maximum file size to allow upload. Appended files
    are accounted for too.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (in GitKraken)@VERT to Git commit to main/sbbs/master on Friday, March 24, 2023 12:01:53
    https://gitlab.synchro.net/main/sbbs/-/commit/2e93426824b48954395c0b1f
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    Fix some signed/unsigned comparison warnings from MSVC

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows)@VERT to Git commit to main/sbbs/master on Thursday, April 13, 2023 18:45:54
    https://gitlab.synchro.net/main/sbbs/-/commit/3e2c3176de6108c697d25a69
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    Fix false "SUSPECTED BOUNCE ATTACK ATTEMPT" for IPv6 FTP-data connections

    This bug only impacted non-passive FTP connections. Using an FTP client
    with active (not passive) data connections over an IPv6 connection would false-trigger the "bounce attack" detection and the FTP server responded with "504 Bad port number" and logged a hack attempt in data/hack.log.

    The issue was that we were comparing the socket address structure (which contains other fields besides the address itself) between the control and proposed-data connections. While this logic worked okay for IPv4,
    it did not for IPv6 (the 2 structs contained some non-address differences). Rather than modify the socket address structures to match where needed, I'm just comparing the string representation of the addresses, since that's
    what we really care about anyway.

    Thank to "mark i" of Truck Stop BBS for alerting me to this issue

    ---
    þ 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 Sunday, November 12, 2023 16:47:50
    https://gitlab.synchro.net/main/sbbs/-/commit/5d903235ca2629f59dc78999
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    Log errno description upon QWK pack mutex file creation failure

    ---
    þ 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 Tuesday, January 09, 2024 17:20:47
    https://gitlab.synchro.net/main/sbbs/-/commit/339599be4e8c05ed8e3fabe9
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    Fix MSLT and MSLD response for QWK packet filename in root directory

    Reusing the variable 'str' here for multiple purposes meant the QWK packet filename was overwritten by the owner name (the system's BBS-ID):

    mlsd
    229 Entering Extended Passive Mode (|||2001|)
    150 Opening ASCII mode data connection for MLSD.
    Type=file;Perm=r;UNIX.ownername=VERT; 00index
    Type=cdir;Perm=elc;UNIX.ownername=VERT; /
    Type=file;Perm=r;UNIX.ownername=VERT; VERT

    That last file there should have been "VERT.qwk"

    ---
    þ 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 Tuesday, January 09, 2024 17:20:47
    https://gitlab.synchro.net/main/sbbs/-/commit/3a25ed550b4f5d6563da0d8a
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    Use safe string copying in get_owner_name() via strlcpy()

    ---
    þ 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 Tuesday, January 09, 2024 17:20:47
    https://gitlab.synchro.net/main/sbbs/-/commit/bb4ccdaad2c07262560ddab9
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    Restore ftpalias.cfg support for MLSx commands

    Support was accidentally removed as part of commit 0d01544d, meaning
    the ftpalias.cfg wasn't used at all in responses to the MLSx commands as reported by Max (WESTLINE) using Total Commander, FileZilla and Directory
    opus. The traditional "LIST" commands still worked fine with ftpalias.cfg contents just fine.

    The reason this code was accidentally removed was due to the errant
    copy/pasted comparison with startup->html_index_file that did not belong here and made the block appear related to HTML index file generation. It was not. This was just a bug in the initial implementation of MLSx support in
    commit d4deb4b3.

    Also included in this commit:
    - Return the date/size of the user's QWK packet file, if it exists, in MLSx
    response.
    - send_mlsx_entry() won't report negative time_t values as file modify dates
    (flength returns -1 upon failure/file-not-found).
    - get_owner_name() returns the string, making it easier to use in function
    calls.

    There appears to still be some work to do to make the MLSx commands fully compliant with RFC 3659 (e.g. "mlst filename" from ftpalias.cfg should work
    but does not), but at least FileZilla displays ftpalias.cfg files and directories correctly now.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Wednesday, February 07, 2024 13:41:41
    https://gitlab.synchro.net/main/sbbs/-/commit/e1b0164230ba4987cae0c3df
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    Mostly time_t printfs, but also an odd bit where it's printing a
    value that's not an off_t as one.

    ---
    þ 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 Wednesday, March 20, 2024 20:31:50
    https://gitlab.synchro.net/main/sbbs/-/commit/0ca7156dc5215b928bf5a689
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    Reduce log severity of QWK-packet removal error log message to WARNING

    This allows each call to ftp_remote() to specify the log level for any remove failure. All others file-removal failures will continue to log at ERROR level.

    I get this particular (harmless) error a lot, so just reducing to warning:
    ftp ... !ERROR 13 (Permission denied) (line 860) removing file: path/to/*.qwk

    ---
    þ 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 Thursday, March 21, 2024 21:56:39
    https://gitlab.synchro.net/main/sbbs/-/commit/05420809878c8fd7f272fa87
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    ftp_remove() returns a bool (not an int) now, so do the right thing

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/master on Tuesday, October 22, 2024 14:15:38
    https://gitlab.synchro.net/main/sbbs/-/commit/51ce7e6f71c2009c1804679f
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    Attempt to fix issue #799

    receive_thread() needs to use the control session correctly for
    TLS connections.

    ---
    þ 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 Tuesday, October 22, 2024 17:20:46
    https://gitlab.synchro.net/main/sbbs/-/commit/17912ca377006ca652483b1e
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    IP addresses are logged (most) everywhere else in square brackets

    There are still places where it could be logged in <> (if username is not yet known).

    ---
    þ 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 Saturday, November 16, 2024 19:16:05
    https://gitlab.synchro.net/main/sbbs/-/commit/ffba326dad6263eedc29ed94
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    Fix the "ERROR x getting data user y" log message (usernum was 0).

    Add the errno value to help root-cause.

    We really should be using safe_strerror() everywhere.

    ---
    þ 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 Saturday, November 16, 2024 20:08:50
    https://gitlab.synchro.net/main/sbbs/-/commit/569efded81398f71ad35f70b
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    Use safe_strerror() in place of strerror() - everything multithreaded should

    ---
    þ 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 Sunday, November 17, 2024 03:11:30
    https://gitlab.synchro.net/main/sbbs/-/commit/6fc2a6b6ff98fab8f98bf955
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    A little beautification of errno logging

    ---
    þ 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 Monday, November 18, 2024 01:50:47
    https://gitlab.synchro.net/main/sbbs/-/commit/8b4d02103bb4a63ffcc360f3
    Modified Files:
    src/sbbs3/ftpsrvr.c
    Log Message:
    Correct initialization of fmutex_t so the file descriptor is -1

    For some reason, MSVC was initializing the time_t (second element of the struct) to -1, not the int fd (the first element), which was initialized to
    0. Weird.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Digital Man@VERT to Rob Swindell (on Windows 11) on Monday, November 18, 2024 12:01:14
    Re: src/sbbs3/ftpsrvr.c
    By: Rob Swindell (on Windows 11) to Git commit to main/sbbs/master on Mon Nov 18 2024 01:50 am

    For some reason, MSVC was initializing the time_t (second element of the struct) to -1, not the int fd (the first element), which was initialized to 0. Weird.

    Actually, this assessment was wrong. fmutex_open() was memsetting the fmutex_t to zero.
    --
    digital man (rob)

    Synchronet/BBS Terminology Definition #88:
    UART = Universal Asynchronous Receiver/Transmitter
    Norco, CA WX: 61.5øF, 38.0% humidity, 2 mph W wind, 0.00 inches rain/24hrs
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net