• src/xpdev/dirwrap.c

    From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Tuesday, February 04, 2025 21:25:43
    https://gitlab.synchro.net/main/sbbs/-/commit/dfef8a98c12122a8d7441561
    Modified Files:
    src/xpdev/dirwrap.c
    Log Message:
    Remove pre-WinXP support from getdiskspace()

    No need to use LoadLibrary and GetProcessAddress here any more either

    ---
    � 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, February 08, 2025 13:21:24
    https://gitlab.synchro.net/main/sbbs/-/commit/f1f7b121785f300b994927ef
    Modified Files:
    src/xpdev/dirwrap.c
    Log Message:
    Use strlcpy instead of sprintf("%.*s") string truncation trick

    Resolves MSVC x64 build warnings.

    Also fixes a bug with wrong sizeof argument used in readdir() (!)

    ---
    � 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, December 27, 2025 01:17:57
    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 Sunday, July 26, 2026 23:08:15
    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) <[email protected]>

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