• src/xpdev/dirwrap.c

    From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Sat Dec 27 01:17:57 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/1d1f7a32c3f216063e232728
    Modified Files:
    src/xpdev/dirwrap.c
    Log Message:
    Fix off-by-one bug in size argument to strlcpy()

    As noted in strlcpy man page: "a byte for the NUL should be included in size."

    ---
    þ 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 Thu Jul 2 21:40:51 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/6fdf8828782a16d7dc633bf5
    Modified Files:
    src/xpdev/dirwrap.c
    Log Message:
    getfilecase(..., true) return false if the path is a file (not a directory)

    SCFG uses getdircase() which calls getfilecase(..., true) to determine if the specified path is a directory (and fix its case if wrong). The underlying function returned true on *nix even if the path was a file (without wildcards) and not a directory, but worked as expected on Windows.

    This caused exporting message lists (e.g. to ../data/areas.bbs) to not prompt for overwrite/append but just complain that the "Directory exists" (when it
    was not actually a directory).

    Reported by Nelgin in IRC

    ---
    þ 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 Sun Jul 26 23:08:15 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/d394e7bef6a9b4045a3f3f13
    Modified Files:
    src/xpdev/dirwrap.c
    Log Message:
    xpdev: copy a file's permissions along with the file

    CopyFile() creates the destination with fopen(dest, "wb"), so it was born
    with mode 0666 & ~umask and the source's permission bits were dropped.
    Copying an executable therefore produced a file that could not be
    executed -- a door binary installed this way failed at launch with
    "ERROR 13 (Permission denied)", and nothing about the copy step said why.

    This is the POSIX stand-in for the Win32 API of the same name, which
    preserves the source's attributes, so the two platforms disagreed on what file_copy() means. The function also already went to the trouble of
    preserving the source's modification time; permissions were the omission.

    fstat() the source and fchmod() the destination to match. The mode is
    masked to 0777: set-user-ID and set-group-ID bits are deliberately left
    behind rather than propagated to a copy.

    Measured before and after against source modes 0755, 0770, 0600, 0666 and
    04755 under umask 022: every destination was 0644 before, and now matches
    its source (with 04755 landing as 0755).

    GitLab #1202.

    Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

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