- From d7b0ba827842b4b47e1b565e4310760ab83dc581 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 15 Jan 2026 16:43:27 +0100
- Subject: [PATCH 1/5] tests: Add ReactOS build via RosBE to manual tests
- Add ReactOS build via RosBE to manual tests.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/manual_testing.txt | 31 ++++++++++++++++++++++++++++++-
- 1 file changed, 30 insertions(+), 1 deletion(-)
- diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
- index f12d057..7e44ca7 100644
- --- a/tests/manual_testing.txt
- +++ b/tests/manual_testing.txt
- @@ -1,5 +1,5 @@
- #
- -# ms-nfs41-client manual testing sequence, 2026-01-03
- +# ms-nfs41-client manual testing sequence, 2026-01-15
- #
- # Draft version, needs to be turned into automated tests
- # if possible
- @@ -1211,5 +1211,34 @@ filedisk /umount U:
- lssparse /cygdrive/n/winntfs_filedisk_001.img
- rm /cygdrive/n/winntfs_filedisk_001.img
- +
- +#
- +# Build ReactOS
- +# (free Windows NT clone)
- +#
- +
- +#### Setup:
- +- Mount case-insensitive filesystem
- +- Install RosBE (ReactOS Build Environment)
- +$ curl --remote-name 'https://downloads.sourceforge.net/reactos/RosBE-2.2.1.exe'
- +$ chmod a+x RosBE-2.2.1.exe
- +$ ./RosBE-2.2.1.exe
- +
- +#### Build ReactOS/i386 (green terminal, $ cmd.exe /t:0B /k "C:\RosBE\RosBE.cmd" #):
- +<inside RosBE command prompt>
- +git clone https://github.com/reactos/reactos
- +cd reactos
- +configure.cmd
- +cd output-MinGW-i386
- +ninja bootcd livecd
- +
- +#### Build ReactOS/AMD64 (blue terminal, $ cmd.exe /t:0B /k "C:\RosBE\RosBE.cmd" amd64 #):
- +<inside RosBE command prompt>
- +git clone https://github.com/reactos/reactos
- +cd reactos
- +configure.cmd -DARCH=amd64
- +cd output-MinGW-amd64
- +ninja bootcd livecd
- +
- #
- # EOF.
- --
- 2.51.0
- From 3016e29c0368a67fbeb94c8b309d9811ceeff60a Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Thu, 15 Jan 2026 17:30:12 +0100
- Subject: [PATCH 2/5] libtirpc: Fix clang printf()-style format warnings
- Fix clang printf()-style format warnings.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- libtirpc/src/auth_sspi.c | 6 ++++--
- libtirpc/src/clnt_vc.c | 9 +++++----
- libtirpc/src/wintirpc.c | 6 ++++--
- 3 files changed, 13 insertions(+), 8 deletions(-)
- diff --git a/libtirpc/src/auth_sspi.c b/libtirpc/src/auth_sspi.c
- index 4e82183..bc15ca2 100644
- --- a/libtirpc/src/auth_sspi.c
- +++ b/libtirpc/src/auth_sspi.c
- @@ -929,7 +929,8 @@ void log_hexdump(bool_t on, const char *title, const u_char *buf,
- if (!on) return;
- - fprintf(fd_out, "%04x: %s (len=%d)\n", GetCurrentThreadId(), title, len);
- + fprintf(fd_out, "%04lx: %s (len=%d)\n",
- + (unsigned long)GetCurrentThreadId(), title, len);
- for (i = 0; i < len; i += 0x10) {
- fprintf(fd_out, " %04x: ", (u_int)(i + offset));
- jm = len - i;
- @@ -962,7 +963,8 @@ void log_debug(const char *fmt, ...)
- va_list ap;
- va_start(ap, fmt);
- - fprintf(fd_out, "%04x: rpcsec_gss: ", GetCurrentThreadId());
- + fprintf(fd_out, "%04lx: rpcsec_gss: ",
- + (unsigned long)GetCurrentThreadId());
- vfprintf(fd_out, fmt, ap);
- fprintf(fd_out, "\n");
- fflush(fd_out);
- diff --git a/libtirpc/src/clnt_vc.c b/libtirpc/src/clnt_vc.c
- index fc22b3a..aabb8b4 100644
- --- a/libtirpc/src/clnt_vc.c
- +++ b/libtirpc/src/clnt_vc.c
- @@ -216,7 +216,7 @@ static const char __no_mem_str[] = "out of memory";
- (void)fprintf(stderr, \
- "#### FATAL: exception in " \
- "thr=%04lx'%s'/%ld ####\n", \
- - (long)GetCurrentThreadId(), \
- + (unsigned long)GetCurrentThreadId(), \
- __FILE__, (long)__LINE__); }
- #else
- #define TIRPCDbgEnter()
- @@ -238,7 +238,8 @@ static unsigned int WINAPI clnt_cb_thread(void *args)
- char cred_area[2 * MAX_AUTH_BYTES + RQCRED_SIZE];
- (void)fprintf(stderr/*stdout*/,
- - "%04lx: cb: Callback thread running\n", (long)GetCurrentThreadId());
- + "%04lx: cb: Callback thread running\n",
- + (unsigned long)GetCurrentThreadId());
- #ifdef DEBUG_TIRPC_CB_DEADLOCKS
- int cond_wait_timed_fails;
- @@ -550,9 +551,9 @@ clnt_vc_create(
- cl->cb_thread = (HANDLE)_beginthreadex(NULL,
- 0, clnt_cb_thread, cl, 0, NULL);
- if (cl->cb_thread == INVALID_HANDLE_VALUE) {
- - (void)fprintf(stderr, "%04lx: _beginthreadex() failed %d\n",
- + (void)fprintf(stderr, "%04lx: _beginthreadex() failed, lasterr=%d\n",
- (long)GetCurrentThreadId(),
- - GetLastError());
- + (int)GetLastError());
- goto err;
- } else
- fprintf(stdout, "%04lx: started the callback thread %04lx\n",
- diff --git a/libtirpc/src/wintirpc.c b/libtirpc/src/wintirpc.c
- index 71132c7..29e092b 100644
- --- a/libtirpc/src/wintirpc.c
- +++ b/libtirpc/src/wintirpc.c
- @@ -519,7 +519,8 @@ void wintirpc_syslog(int prio, const char *format, ...)
- default: prio_s = "UNKNOWN_ERROR"; break;
- }
- - (void)fprintf(stderr, "%04x: %s: ", GetCurrentThreadId(), prio_s);
- + (void)fprintf(stderr, "%04lx: %s: ",
- + (unsigned long)GetCurrentThreadId(), prio_s);
- (void)vfprintf(stderr, format, args);
- (void)fputc('\n', stderr);
- (void)fflush(stderr);
- @@ -531,7 +532,8 @@ void wintirpc_warnx(const char *format, ...)
- {
- va_list args;
- va_start(args, format);
- - (void)fprintf(stderr, "%04x: ", GetCurrentThreadId());
- + (void)fprintf(stderr, "%04lx: ",
- + (unsigned long)GetCurrentThreadId());
- (void)vfprintf(stderr, format, args);
- (void)fflush(stderr);
- va_end(args);
- --
- 2.51.0
- From 01c62bbf71911ceff248c7268538e6bb89025ebe Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Thu, 15 Jan 2026 17:47:29 +0100
- Subject: [PATCH 3/5] daemon: Fix clang
- -Wincompatible-pointer-types-discards-qualifiers warning in streams code
- Fix clang warning "daemon\winstreams.c(533,9): warning : passing
- 'FILE_STREAM_INFORMATION *restrict *restrict' (aka 'struct
- _FILE_STREAM_INFORMATION *restrict *restrict') to parameter of type
- 'PFILE_STREAM_INFORMATION *' (aka 'struct _FILE_STREAM_INFORMATION **')"
- discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers].
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/winstreams.c | 6 +++---
- daemon/winstreams.h | 3 ++-
- 2 files changed, 5 insertions(+), 4 deletions(-)
- diff --git a/daemon/winstreams.c b/daemon/winstreams.c
- index 1d42f6e..df620e5 100644
- --- a/daemon/winstreams.c
- +++ b/daemon/winstreams.c
- @@ -299,7 +299,7 @@ void populate_stream_list(
- stream->NextEntryOffset =
- ALIGNED_STREAMINFOSIZE(stream->StreamNameLength);
- last_win_stream = stream;
- - stream = (PFILE_STREAM_INFORMATION)STREAMINFO_NEXT_ENTRY(stream);
- + stream = STREAMINFO_NEXT_ENTRY(stream);
- /*
- * Enumerate streams
- @@ -375,7 +375,7 @@ next_readdir_entry:
- if (is_win_stream) {
- stream->NextEntryOffset =
- ALIGNED_STREAMINFOSIZE(stream->StreamNameLength);
- - stream = (PFILE_STREAM_INFORMATION)STREAMINFO_NEXT_ENTRY(stream);
- + stream = STREAMINFO_NEXT_ENTRY(stream);
- }
- position += entry->next_entry_offset;
- @@ -387,7 +387,7 @@ int get_stream_list(
- IN OUT nfs41_open_state *state,
- IN nfs41_path_fh *streamfile,
- IN const nfs41_file_info *basefile_info,
- - OUT PFILE_STREAM_INFORMATION *restrict streamlist_out,
- + OUT FILE_STREAM_INFORMATION *restrict *restrict streamlist_out,
- OUT ULONG *streamlist_out_size)
- {
- unsigned char *entry_list;
- diff --git a/daemon/winstreams.h b/daemon/winstreams.h
- index c7a021c..3f9a117 100644
- --- a/daemon/winstreams.h
- +++ b/daemon/winstreams.h
- @@ -28,7 +28,8 @@
- #include "nfs41_types.h"
- #include "from_kernel.h"
- -#define STREAMINFO_NEXT_ENTRY(str) ((PBYTE)(str) + (str)->NextEntryOffset)
- +#define STREAMINFO_NEXT_ENTRY(str) \
- + ((PFILE_STREAM_INFORMATION)((PBYTE)(str) + (str)->NextEntryOffset))
- static __inline
- bool is_stream_path(const nfs41_abs_path *restrict path)
- --
- 2.51.0
- From 1c9fa138e8a1a21f2bf97292aaa0a40137def292 Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Thu, 15 Jan 2026 17:52:10 +0100
- Subject: [PATCH 4/5] daemon: Fix clang warning "warning : '&&' within '||'
- [-Wlogical-op-parentheses]" in parse_fs_location_server_address()
- Fix clang warning "warning : '&&' within '||' [-Wlogical-op-parentheses]" in
- parse_fs_location_server_address().
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/util.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- diff --git a/daemon/util.c b/daemon/util.c
- index 7029bb6..c12115c 100644
- --- a/daemon/util.c
- +++ b/daemon/util.c
- @@ -772,7 +772,7 @@ int parse_fs_location_server_address(IN const char *restrict inaddr,
- int colon_count = count_chars(inaddr, ':');
- if (((dot_count == 5) && (colon_count == 0)) ||
- - (colon_count == 7) && (dot_count == 2)) {
- + ((colon_count == 7) && (dot_count == 2))) {
- int num1, num2;
- const char *begin_dot = NULL;
- if (parse_last_two_numbers(inaddr, &begin_dot, &num1, &num2)) {
- --
- 2.51.0
- From 2b9d2dd8521ac3e72ee599efc9d2d02a4c64c737 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 15 Jan 2026 18:39:14 +0100
- Subject: [PATCH 5/5] daemon,sys,tests: Add #error statements for unsupported
- compilers
- Add #error statements for unsupported compilers.
- Reported-by: Dan Shelton <dan.f.shelton@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/sid.h | 12 +++++++-----
- sys/nfs41sys_driver.h | 12 ++++++++----
- sys/nfs41sys_openclose.c | 10 +++++++---
- tests/winfsinfo1/winfsinfo.c | 10 +++++++---
- tests/winsg/winsg.c | 12 +++++++-----
- 5 files changed, 36 insertions(+), 20 deletions(-)
- diff --git a/daemon/sid.h b/daemon/sid.h
- index e6f2be8..02942c5 100644
- --- a/daemon/sid.h
- +++ b/daemon/sid.h
- @@ -1,7 +1,7 @@
- /* NFSv4.1 client for Windows
- * Copyright (C) 2012 The Regents of the University of Michigan
- - * Copyright (C) 2023-2025 Roland Mainz <roland.mainz@nrubsig.org>
- + * Copyright (C) 2023-2026 Roland Mainz <roland.mainz@nrubsig.org>
- *
- * Olga Kornievskaia <aglo@umich.edu>
- * Casey Bodley <cbodley@umich.edu>
- @@ -48,20 +48,22 @@ extern sidcache group_sidcache;
- /*
- - * DECLARE_SID_BUFFER - declare a buffer for a SID value
- + * |DECLARE_SID_BUFFER| - declare a buffer for a SID value
- * Note that buffers with SID values must be 16byte aligned
- * on Windows 10/32bit, othewise the kernel might return
- * |ERROR_NOACCESS|(=998) - "Invalid access to memory location".
- */
- -#ifdef _MSC_BUILD
- +#if defined(_MSC_BUILD)
- /* Visual Studio */
- #define DECLARE_SID_BUFFER(varname) \
- __declspec(align(16)) char (varname)[MAX_SID_BUFFER_SIZE]
- -#else
- +#elif defined(__clang__)
- /* clang */
- #define DECLARE_SID_BUFFER(varname) \
- char (varname)[MAX_SID_BUFFER_SIZE] __attribute__((aligned(16)))
- -#endif /* _MSC_BUILD */
- +#else
- +#error Compiler not supported yet
- +#endif /* |_MSC_BUILD| */
- /* prototypes */
- diff --git a/sys/nfs41sys_driver.h b/sys/nfs41sys_driver.h
- index 6eb05d1..670285c 100644
- --- a/sys/nfs41sys_driver.h
- +++ b/sys/nfs41sys_driver.h
- @@ -1,6 +1,6 @@
- /* NFSv4.1 client for Windows
- * Copyright (C) 2012 The Regents of the University of Michigan
- - * Copyright (C) 2023-2025 Roland Mainz <roland.mainz@nrubsig.org>
- + * Copyright (C) 2023-2026 Roland Mainz <roland.mainz@nrubsig.org>
- *
- * Olga Kornievskaia <aglo@umich.edu>
- * Casey Bodley <cbodley@umich.edu>
- @@ -513,11 +513,15 @@ typedef struct _NFS41_SRV_OPEN {
- * |open_pg_sidbuff| - Note that buffers with SID values must be 16byte
- * aligned on Windows 10/32bit
- */
- -#ifdef _MSC_BUILD
- +#if defined(_MSC_BUILD)
- + /* Visual Studio */
- __declspec(align(16)) char open_pg_sidbuff[MAX_SID_BUFFER_SIZE];
- -#else
- +#elif defined(__clang__)
- + /* clang */
- char open_pg_sidbuff[MAX_SID_BUFFER_SIZE] __attribute__((aligned(16)));
- -#endif /* _MSC_BUILD */
- +#else
- +#error Compiler not supported yet
- +#endif /* |_MSC_BUILD| */
- /* |open_pg_sid| - PrimaryGroup SID used for opening this NFS handle */
- PSID open_pg_sid;
- diff --git a/sys/nfs41sys_openclose.c b/sys/nfs41sys_openclose.c
- index d25d719..f1db990 100644
- --- a/sys/nfs41sys_openclose.c
- +++ b/sys/nfs41sys_openclose.c
- @@ -1385,11 +1385,15 @@ NTSTATUS nfs41_ShouldTryToCollapseThisOpen(
- * |pg_sidbuff| - Note that buffers with SID values must be 16byte
- * aligned on Windows 10/32bit
- */
- -#ifdef _MSC_BUILD
- +#if defined(_MSC_BUILD)
- + /* Visual Studio */
- __declspec(align(16)) char pg_sidbuff[MAX_SID_BUFFER_SIZE];
- -#else
- +#elif defined(__clang__)
- + /* clang */
- char pg_sidbuff[MAX_SID_BUFFER_SIZE] __attribute__((aligned(16)));
- -#endif /* _MSC_BUILD */
- +#else
- +#error Compiler not supported yet
- +#endif /* |_MSC_BUILD| */
- PSID pg_sid = (PSID)&pg_sidbuff[0];
- (void)get_primarygroup_id(pg_sid);
- diff --git a/tests/winfsinfo1/winfsinfo.c b/tests/winfsinfo1/winfsinfo.c
- index a1c12b5..81bdf65 100644
- --- a/tests/winfsinfo1/winfsinfo.c
- +++ b/tests/winfsinfo1/winfsinfo.c
- @@ -1076,11 +1076,15 @@ int get_file_remote_protocol_info(const char *progname, const char *filename)
- {
- int res = EXIT_FAILURE;
- bool ok;
- -#ifdef _MSC_BUILD
- +#if defined(_MSC_BUILD)
- + /* Visual Studio */
- __declspec(align(16)) FILE_REMOTE_PROTOCOL_INFO frpi;
- -#else
- +#elif defined(__clang__)
- + /* clang */
- FILE_REMOTE_PROTOCOL_INFO frpi __attribute__((aligned(16)));
- -#endif
- +#else
- +#error Compiler not supported yet
- +#endif /* |_MSC_BUILD| */
- int i;
- (void)memset(&frpi, 0, sizeof(frpi));
- diff --git a/tests/winsg/winsg.c b/tests/winsg/winsg.c
- index ba8e8d2..75e405c 100644
- --- a/tests/winsg/winsg.c
- +++ b/tests/winsg/winsg.c
- @@ -2,7 +2,7 @@
- /*
- * MIT License
- *
- - * Copyright (c) 2024-2025 Roland Mainz <roland.mainz@nrubsig.org>
- + * Copyright (c) 2024-2026 Roland Mainz <roland.mainz@nrubsig.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- @@ -70,20 +70,22 @@
- #define MAX_SID_BUFFER_SIZE (128)
- /*
- - * DECLARE_SID_BUFFER - declare a buffer for a SID value
- + * |DECLARE_SID_BUFFER| - declare a buffer for a SID value
- * Note that buffers with SID values must be 16byte aligned
- * on Windows 10/32bit, othewise the kernel might return
- * |ERROR_NOACCESS|(=998) - "Invalid access to memory location".
- */
- -#ifdef _MSC_BUILD
- +#if defined(_MSC_BUILD)
- /* Visual Studio */
- #define DECLARE_SID_BUFFER(varname) \
- __declspec(align(16)) char (varname)[MAX_SID_BUFFER_SIZE]
- -#else
- +#elif defined(__clang__)
- /* clang */
- #define DECLARE_SID_BUFFER(varname) \
- char (varname)[MAX_SID_BUFFER_SIZE] __attribute__((aligned(16)))
- -#endif /* _MSC_BUILD */
- +#else
- +#error Compiler not supported yet
- +#endif /* |_MSC_BUILD| */
- /*
- * Performance hack:
- --
- 2.51.0
msnfs41client: Patches for clang/ReactOS, cleanup, tests+ misc, 2026-01-15
Posted by Anonymous on Thu 15th Jan 2026 17:56
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
rovema.kpaste.net RSS