- From 045502ef2d60b0f3c9f939a12df9839a14de6289 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 17 Jan 2026 14:34:58 +0100
- Subject: [PATCH 1/6] sys: |map_queryfile_error()|+|map_setfile_error()| should
- handle |ERROR_INVALID_NAME|
- |map_queryfile_error()|+|map_setfile_error()| should map |ERROR_INVALID_NAME|
- to |STATUS_OBJECT_NAME_INVALID|.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41sys_fileinfo.c | 2 ++
- 1 file changed, 2 insertions(+)
- diff --git a/sys/nfs41sys_fileinfo.c b/sys/nfs41sys_fileinfo.c
- index 2945a42..ded8df4 100644
- --- a/sys/nfs41sys_fileinfo.c
- +++ b/sys/nfs41sys_fileinfo.c
- @@ -198,6 +198,7 @@ NTSTATUS map_queryfile_error(
- switch (error) {
- case ERROR_ACCESS_DENIED: return STATUS_ACCESS_DENIED;
- case ERROR_NETNAME_DELETED: return STATUS_NETWORK_NAME_DELETED;
- + case ERROR_INVALID_NAME: return STATUS_OBJECT_NAME_INVALID;
- case ERROR_INVALID_PARAMETER: return STATUS_INVALID_PARAMETER;
- case ERROR_NOT_SUPPORTED: return STATUS_NOT_SUPPORTED;
- case ERROR_INTERNAL_ERROR: return STATUS_INTERNAL_ERROR;
- @@ -590,6 +591,7 @@ NTSTATUS map_setfile_error(
- case ERROR_FILE_TOO_LARGE: return STATUS_FILE_TOO_LARGE;
- case ERROR_INSUFFICIENT_BUFFER: return STATUS_BUFFER_TOO_SMALL;
- case ERROR_MORE_DATA: return STATUS_BUFFER_OVERFLOW;
- + case ERROR_INVALID_NAME: return STATUS_OBJECT_NAME_INVALID;
- case ERROR_INTERNAL_ERROR: return STATUS_INTERNAL_ERROR;
- default:
- print_error("map_setfile_error: "
- --
- 2.51.0
- From 93ebad22488b14b9e82cab85399a01b4689e053b Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 17 Jan 2026 14:37:01 +0100
- Subject: [PATCH 2/6] daemon: NFS named attr filename prefix for Win32 named
- streams should be "win32.stream."
- NFS named attr filename prefix for Win32 named streams should be "win32.stream.",
- not "win32.streams.".
- Reported-by: Cedric Blancher <cedric.blancher@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/winstreams.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
- diff --git a/daemon/winstreams.c b/daemon/winstreams.c
- index df620e5..8e3f2f8 100644
- --- a/daemon/winstreams.c
- +++ b/daemon/winstreams.c
- @@ -45,8 +45,8 @@
- * "SUNWattr_ro" will fail, because the attribute file is
- * read-only).
- */
- -#define WIN_NFS4_STREAMS_NAME_PREFIX "win32.streams."
- -#define WIN_NFS4_STREAMS_NAME_PREFIX_LEN (14)
- +#define WIN_NFS4_STREAMS_NAME_PREFIX "win32.stream."
- +#define WIN_NFS4_STREAMS_NAME_PREFIX_LEN (13)
- static
- --
- 2.51.0
- From 526476c0ad640912372cdded8ca756dee1dd2cee Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 17 Jan 2026 16:31:27 +0100
- Subject: [PATCH 3/6] daemon,tests: Implement NTFS-style Win32 named stream
- renaming support
- Implement NTFS-style Win32 named stream renaming support, e.g.
- |FileRenameInformation| with "relative stream name", e.g.
- ':mystrname1:$DATA'.
- Reported-by: Dan Shelton <dan.f.shelton@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/lookup.c | 3 +-
- daemon/nfs41_ops.c | 142 ++++++++++++++++++++++++++++++++++-----
- daemon/setattr.c | 47 ++++++++++++-
- daemon/winstreams.c | 14 +++-
- daemon/winstreams.h | 1 +
- tests/manual_testing.txt | 3 +-
- 6 files changed, 189 insertions(+), 21 deletions(-)
- diff --git a/daemon/lookup.c b/daemon/lookup.c
- index 6dd5905..53517ae 100644
- --- a/daemon/lookup.c
- +++ b/daemon/lookup.c
- @@ -514,7 +514,8 @@ int nfs41_lookup(
- bool is_stream = false;
- /* Parse the stream syntax */
- - status = parse_win32stream_name(path.path, &is_stream, base_name, stream_name);
- + status = parse_win32stream_name(path.path, false,
- + &is_stream, base_name, stream_name);
- if (status)
- goto out;
- diff --git a/daemon/nfs41_ops.c b/daemon/nfs41_ops.c
- index 3476484..9d3d720 100644
- --- a/daemon/nfs41_ops.c
- +++ b/daemon/nfs41_ops.c
- @@ -36,9 +36,7 @@
- #include "delegation.h"
- #include "daemon_debug.h"
- #include "util.h"
- -#ifdef NFS41_WINSTREAMS_SUPPORT
- #include "winstreams.h"
- -#endif /* NFS41_WINSTREAMS_SUPPORT */
- #ifdef NFS41_DRIVER_STABILITY_HACKS
- /*
- @@ -492,7 +490,7 @@ int nfs41_open(
- #ifdef NFS41_WINSTREAMS_SUPPORT
- if (file->name.name) {
- if (is_stream_path_fh(file)) {
- - status = parse_win32stream_name(file->name.name,
- + status = parse_win32stream_name(file->name.name, false,
- &is_stream, base_buf, stream_buf);
- if (status)
- goto out;
- @@ -711,7 +709,7 @@ int nfs41_create(
- if (file->name.name) {
- if (is_stream_path_fh(file)) {
- - status = parse_win32stream_name(file->name.name,
- + status = parse_win32stream_name(file->name.name, false,
- &is_stream, base_buf, stream_buf);
- if (status)
- goto out;
- @@ -1436,7 +1434,7 @@ int nfs41_remove(
- if (target->name) {
- if (is_stream_component(target)) {
- - status = parse_win32stream_name(target->name,
- + status = parse_win32stream_name(target->name, false,
- &is_stream, base_buf, stream_buf);
- if (status)
- goto out;
- @@ -1527,8 +1525,8 @@ int nfs41_rename(
- {
- int status;
- nfs41_compound compound;
- - nfs_argop4 argops[8];
- - nfs_resop4 resops[8];
- + nfs_argop4 argops[16];
- + nfs_resop4 resops[16];
- nfs41_sequence_args sequence_args;
- nfs41_sequence_res sequence_res;
- nfs41_putfh_args src_putfh_args;
- @@ -1542,16 +1540,74 @@ int nfs41_rename(
- nfs41_getattr_res src_getattr_res NDSH(= { 0 }), dst_getattr_res NDSH(= { 0 });
- nfs41_file_info src_info, dst_info;
- bitmap4 attr_request;
- - nfs41_restorefh_res restorefh_res;
- +
- + DPRINTF(1, ("--> nfs41_rename("
- + "src_dir=(path='%.*s' name='%.*s'), src_name='%.*s', "
- + "dst_dir=(path='%.*s' name='%.*s'), dst_name='%.*s')\n",
- + (int)src_dir->path->len, src_dir->path->path,
- + (int)src_dir->name.len, src_dir->name.name,
- + (int)src_name->len, src_name->name,
- + (int)dst_dir->path->len, dst_dir->path->path,
- + (int)dst_dir->name.len, dst_dir->name.name,
- + (int)dst_name->len, dst_name->name));
- #ifdef NFS41_WINSTREAMS_SUPPORT
- + char src_base_buf[NFS41_MAX_PATH_LEN+1];
- + char src_stream_buf[NFS41_MAX_COMPONENT_LEN+1];
- + char dst_base_buf[NFS41_MAX_PATH_LEN+1];
- + char dst_stream_buf[NFS41_MAX_COMPONENT_LEN+1];
- + bool src_is_stream = false;
- + bool dst_is_stream = false;
- + nfs41_component src_base_comp = {0};
- + nfs41_component src_stream_comp = {0};
- + nfs41_lookup_args src_lookup_args;
- + nfs41_lookup_res src_lookup_res;
- + nfs41_openattr_args src_openattr_args;
- + nfs41_openattr_res src_openattr_res;
- + nfs41_component dst_base_comp = {0};
- + nfs41_component dst_stream_comp = {0};
- + nfs41_lookup_args dst_lookup_args;
- + nfs41_lookup_res dst_lookup_res;
- + nfs41_openattr_args dst_openattr_args;
- + nfs41_openattr_res dst_openattr_res;
- +
- if (src_name->name) {
- - EASSERT_MSG(is_stream_component(src_name) == false,
- - ("nfs41_rename: Streams not implemented yet\n"));
- + if (is_stream_component(src_name)) {
- + status = parse_win32stream_name(src_name->name, false,
- + &src_is_stream, src_base_buf, src_stream_buf);
- + if (status)
- + goto out;
- +
- + if (src_is_stream) {
- + src_base_comp.name = src_base_buf;
- + src_base_comp.len = (unsigned short)strlen(src_base_buf);
- + src_stream_comp.name = src_stream_buf;
- + src_stream_comp.len = (unsigned short)strlen(src_stream_buf);
- + }
- + }
- }
- +
- if (dst_name->name) {
- - EASSERT_MSG(is_stream_component(dst_name) == false,
- - ("nfs41_rename: Streams not implemented yet\n"));
- + if (is_stream_component(dst_name)) {
- + status = parse_win32stream_name(dst_name->name, false,
- + &dst_is_stream, dst_base_buf, dst_stream_buf);
- + if (status)
- + goto out;
- +
- + if (dst_is_stream) {
- + dst_base_comp.name = dst_base_buf;
- + dst_base_comp.len = (unsigned short)strlen(dst_base_buf);
- + dst_stream_comp.name = dst_stream_buf;
- + dst_stream_comp.len = (unsigned short)strlen(dst_stream_buf);
- + }
- + }
- + }
- +
- + if (src_is_stream && dst_is_stream) {
- + if (dst_dir->name.len == 0) {
- + DPRINTF(1, ("nfs41_rename: dst_dir = src_dir\n"));
- + dst_dir = src_dir;
- + }
- }
- #endif /* NFS41_WINSTREAMS_SUPPORT */
- @@ -1567,22 +1623,76 @@ int nfs41_rename(
- src_putfh_args.file = src_dir;
- src_putfh_args.in_recovery = 0;
- +#ifdef NFS41_WINSTREAMS_SUPPORT
- + if (src_is_stream && (src_stream_comp.len > 0)) {
- + compound_add_op(&compound, OP_LOOKUP, &src_lookup_args, &src_lookup_res);
- + src_lookup_args.name = &src_base_comp;
- + compound_add_op(&compound, OP_OPENATTR, &src_openattr_args, &src_openattr_res);
- + /* Do not create the src named attr dir */
- + src_openattr_args.createdir = FALSE;
- + }
- +#endif /* NFS41_WINSTREAMS_SUPPORT */
- +
- compound_add_op(&compound, OP_SAVEFH, NULL, &savefh_res);
- compound_add_op(&compound, OP_PUTFH, &dst_putfh_args, &dst_putfh_res);
- dst_putfh_args.file = dst_dir;
- dst_putfh_args.in_recovery = 0;
- +#ifdef NFS41_WINSTREAMS_SUPPORT
- + if (dst_is_stream && (dst_stream_comp.len > 0)) {
- + compound_add_op(&compound, OP_LOOKUP, &dst_lookup_args, &dst_lookup_res);
- + dst_lookup_args.name = &dst_base_comp;
- + compound_add_op(&compound, OP_OPENATTR, &dst_openattr_args, &dst_openattr_res);
- + /*
- + * Create the dst named attr dir.
- + * (Technically the NFS spec does not allow renaming between different
- + * src and dst named attr dirs, but we do this for correctness reasons)
- + */
- + dst_openattr_args.createdir = TRUE;
- + }
- +#endif /* NFS41_WINSTREAMS_SUPPORT */
- +
- compound_add_op(&compound, OP_RENAME, &rename_args, &rename_res);
- - rename_args.oldname = src_name;
- - rename_args.newname = dst_name;
- +
- +#ifdef NFS41_WINSTREAMS_SUPPORT
- + if (src_is_stream) {
- + if (src_stream_comp.len > 0)
- + rename_args.oldname = &src_stream_comp;
- + else
- + rename_args.oldname = &src_base_comp;
- + }
- + else
- +#endif /* NFS41_WINSTREAMS_SUPPORT */
- + {
- + rename_args.oldname = src_name;
- + }
- +
- +#ifdef NFS41_WINSTREAMS_SUPPORT
- + if (dst_is_stream) {
- + if (dst_stream_comp.len > 0)
- + rename_args.newname = &dst_stream_comp;
- + else
- + rename_args.newname = &dst_base_comp;
- + }
- + else
- +#endif /* NFS41_WINSTREAMS_SUPPORT */
- + {
- + rename_args.newname = dst_name;
- + }
- +
- + compound_add_op(&compound, OP_PUTFH, &dst_putfh_args, &dst_putfh_res);
- + dst_putfh_args.file = dst_dir;
- + dst_putfh_args.in_recovery = 0;
- compound_add_op(&compound, OP_GETATTR, &getattr_args, &dst_getattr_res);
- getattr_args.attr_request = &attr_request;
- dst_getattr_res.obj_attributes.attr_vals_len = NFS4_OPAQUE_LIMIT_ATTR;
- dst_getattr_res.info = &dst_info;
- - compound_add_op(&compound, OP_RESTOREFH, NULL, &restorefh_res);
- + compound_add_op(&compound, OP_PUTFH, &src_putfh_args, &src_putfh_res);
- + src_putfh_args.file = src_dir;
- + src_putfh_args.in_recovery = 0;
- compound_add_op(&compound, OP_GETATTR, &getattr_args, &src_getattr_res);
- src_getattr_res.obj_attributes.attr_vals_len = NFS4_OPAQUE_LIMIT_ATTR;
- @@ -1630,6 +1740,8 @@ int nfs41_rename(
- ReleaseSRWLockShared(&dst_dir->path->lock);
- }
- out:
- + DPRINTF(1, ("<-- nfs41_rename(), status=%d\n", (int)status));
- +
- return status;
- }
- diff --git a/daemon/setattr.c b/daemon/setattr.c
- index 20a81e3..81737a7 100644
- --- a/daemon/setattr.c
- +++ b/daemon/setattr.c
- @@ -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>
- @@ -489,6 +489,51 @@ static int handle_nfs41_rename(void *daemon_context, setattr_upcall_args *args)
- status = ERROR_INVALID_PARAMETER;
- goto out;
- }
- +
- +#ifdef NFS41_WINSTREAMS_SUPPORT
- + /*
- + * Handle NTFS-style renaming of a Win32 named stream to another stream
- + * name of the same base filename, e.g.
- + * $ renamestream 'F:\namedstreamtest\file1:stream9' ':stream9_rename1' #
- + * (this is the only known way for NTFS on Win10 to rename a stream)
- + *
- + * |rename->FileName| will contain a "relative stream name", i.e. starting
- + * with ":<streamname>", and we have to add the base filename from the src
- + * filename.
- + */
- + if ((dst_path.len > 1) && (dst_path.path[0] == ':')) {
- + char *s;
- + s = strchr(src_name->name, ':');
- + if (s == NULL) {
- + eprintf("handle_nfs41_rename: dst is stream, src is '%s'\n",
- + src_name->name);
- + status = ERROR_INVALID_PARAMETER;
- + goto out;
- + }
- +
- + size_t len = s - src_name->name;
- +
- + if ((dst_path.len+len+1) >= NFS41_MAX_COMPONENT_LEN) {
- + eprintf("handle_nfs41_rename: "
- + "(dst_path.len(=%d)+len=(=%d)+1) >= NFS41_MAX_COMPONENT_LEN, "
- + "src is '%s'\n",
- + (int)dst_path.len,
- + (int)len,
- + src_name->name);
- + status = ERROR_INVALID_PARAMETER;
- + goto out;
- + }
- +
- + (void)memmove(&dst_path.path[len], &dst_path.path[0], dst_path.len+1);
- + (void)memcpy(&dst_path.path[0], src_name->name, len);
- + dst_path.len += (unsigned short)len;
- + DPRINTF(1,
- + ("handle_nfs41_rename: "
- + "streams: src_name->name='%s' dst_path.name='%s'\n",
- + src_name->name, dst_path.path));
- + }
- +#endif /* NFS41_WINSTREAMS_SUPPORT */
- +
- path_fh_init(&dst_dir, &dst_path);
- /* the destination path is absolute, so start from the root session */
- diff --git a/daemon/winstreams.c b/daemon/winstreams.c
- index 8e3f2f8..5f3e5af 100644
- --- a/daemon/winstreams.c
- +++ b/daemon/winstreams.c
- @@ -91,9 +91,11 @@ int parse_stream_filename_streamname_streamtype(
- return NO_ERROR;
- }
- - /* First colon exists: filename before ':' must be non-empty */
- - if (c1 == base)
- - return ERROR_INVALID_NAME;
- + /*
- + * First colon exists: filename before ':' can be empty in case if a
- + * rename destination. |filename| should then be obtained from the
- + * rename src filename
- + */
- /*
- * One colon case
- @@ -143,6 +145,7 @@ int parse_stream_filename_streamname_streamtype(
- int parse_win32stream_name(
- IN const char *restrict path,
- + IN bool allow_empty_base_name,
- OUT bool *restrict is_stream,
- OUT char *restrict base_name,
- OUT char *restrict stream_name)
- @@ -163,6 +166,11 @@ int parse_win32stream_name(
- return status;
- }
- + if ((allow_empty_base_name == false) &&
- + (filenamebuff[0] == '\0')) {
- + return ERROR_INVALID_NAME;
- + }
- +
- DPRINTF(WINSTRLVL,
- ("parse_win32stream_name: "
- "parse_stream_filename_streamname_streamtype(path='%s') returned "
- diff --git a/daemon/winstreams.h b/daemon/winstreams.h
- index 3f9a117..5500c3a 100644
- --- a/daemon/winstreams.h
- +++ b/daemon/winstreams.h
- @@ -59,6 +59,7 @@ bool is_stream_component(const nfs41_component *restrict comp)
- int parse_win32stream_name(
- IN const char *restrict path,
- + IN bool allow_empty_base_name,
- OUT bool *restrict is_stream,
- OUT char *restrict base_name,
- OUT char *restrict stream_name);
- diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
- index 7e44ca7..691d627 100644
- --- a/tests/manual_testing.txt
- +++ b/tests/manual_testing.txt
- @@ -1,5 +1,5 @@
- #
- -# ms-nfs41-client manual testing sequence, 2026-01-15
- +# ms-nfs41-client manual testing sequence, 2026-01-17
- #
- # Draft version, needs to be turned into automated tests
- # if possible
- @@ -235,6 +235,7 @@ rm -f file1 && echo "file1data" >file1 && cmd /c 'echo file1_line1 >>file1:files
- powershell -Command 'Get-Item -LiteralPath file1 -Stream * | Select *'
- # FIXME: tests for stream removal, enumeration and sparse data
- +# FIXME: Add tests for stream NTFS-style renaming (e.g. FileRenameInformation with "relative stream name", e.g. ':mystrname1:$DATA')
- #
- --
- 2.51.0
- From c8ce1e9d81476bd2d9f5718157a1f23b95d9a8f4 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 17 Jan 2026 16:36:32 +0100
- Subject: [PATCH 4/6] tests: manual_testing.txt: Fix typos in Win32 named
- stream tests
- manual_testing.txt: Fix typos in Win32 named stream tests.
- Reported-by: Cedric Blancher <cedric.blancher@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/manual_testing.txt | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
- diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
- index 691d627..4cf0bb2 100644
- --- a/tests/manual_testing.txt
- +++ b/tests/manual_testing.txt
- @@ -227,10 +227,10 @@ rm -Rf dir1 && mkdir dir1 && cmd /c 'echo dir_line1 >>dir1:dirstr1 & echo dir_li
- # these five tests should print $'file1data\nfile1_line1\nfile1_line2\n'
- rm -f file1 && echo "file1data" >file1 && cmd /c 'echo file1_line1 >>file1:filestr1 & echo file1_line2 >>file1:filestr1:$DATA & C:\cygwin64\bin\cat.exe <file1 & C:\cygwin64\bin\cat.exe <file1:filestr1'
- -rm -f file1 && echo "file1data" >file1 && cmd /c 'echo file1_line1 >>file1:filestr1 & echo file1_line2 >>file1:filestr1:$DATA && type file1' && powershell -Command 'Get-Content -Path .\file1 -Stream filestr1'# this should list stream "filestr1"
- +rm -f file1 && echo "file1data" >file1 && cmd /c 'echo file1_line1 >>file1:filestr1 & echo file1_line2 >>file1:filestr1:$DATA && type file1' && powershell -Command 'Get-Content -Path .\file1 -Stream filestr1'
- rm -f file1 && echo "file1data" >file1 && cmd /c 'echo file1_line1 >>file1:filestr1 & type file1' && powershell -Command 'Add-Content .\file1 -Stream filestr1 -Value "file1_line2" ; Get-Content -Path .\file1 -Stream filestr1'
- rm -f file1 && echo "file1data" >file1 && cmd /c 'echo file1_line1 >>file1:filestr1 & type file1' && powershell -Command 'Add-Content .\file1:filestr1 -Value "file1_line2" ; Get-Content -Path .\file1 -Stream filestr1'
- -rm -f file1 && echo "file1data" >file1 && cmd /c 'echo file1_line1 >>file1:filestr1' && powershell -Command 'Add-Content .\file1:filestr1 -Value "file1_line2" ; Get-Content -Path .\file1 -Stream ":DATA" ; Get-Content -Path .\file1 -Stream filestr1'
- +rm -f file1 && echo "file1data" >file1 && cmd /c 'echo file1_line1 >>file1:filestr1' && powershell -Command 'Add-Content .\file1:filestr1 -Value "file1_line2" ; Get-Content -Path .\file1 -Stream "$DATA" ; Get-Content -Path .\file1 -Stream filestr1'
- # list all streams for file "file1" (should be "filestr1")
- powershell -Command 'Get-Item -LiteralPath file1 -Stream * | Select *'
- --
- 2.51.0
- From e464e62065fdf592710057e143892e71a803916a Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 17 Jan 2026 18:32:50 +0100
- Subject: [PATCH 5/6] sys: Add more upcall buffer size debug output in case the
- buffer is too small
- Add more upcall buffer size debug output in case the buffer is too small.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41sys_acl.c | 8 +++++++-
- sys/nfs41sys_dir.c | 5 ++++-
- sys/nfs41sys_driver.c | 8 +++++++-
- sys/nfs41sys_ea.c | 8 +++++++-
- sys/nfs41sys_fileinfo.c | 6 ++++++
- sys/nfs41sys_fsctl.c | 11 ++++++++++-
- sys/nfs41sys_lock.c | 8 +++++++-
- sys/nfs41sys_mount.c | 5 ++++-
- sys/nfs41sys_openclose.c | 6 ++++++
- sys/nfs41sys_readwrite.c | 5 ++++-
- sys/nfs41sys_symlink.c | 5 ++++-
- sys/nfs41sys_volinfo.c | 5 ++++-
- 12 files changed, 70 insertions(+), 10 deletions(-)
- diff --git a/sys/nfs41sys_acl.c b/sys/nfs41sys_acl.c
- index e9b0a6e..52eb845 100644
- --- a/sys/nfs41sys_acl.c
- +++ b/sys/nfs41sys_acl.c
- @@ -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>
- @@ -87,6 +87,9 @@ NTSTATUS marshal_nfs41_getacl(
- header_len = *len + sizeof(SECURITY_INFORMATION);
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_getacl: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- @@ -129,6 +132,9 @@ NTSTATUS marshal_nfs41_setacl(
- header_len = *len + sizeof(SECURITY_INFORMATION) +
- sizeof(ULONG) + entry->u.Acl.buf_len;
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_setacl: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- diff --git a/sys/nfs41sys_dir.c b/sys/nfs41sys_dir.c
- index 77c2aca..e3c0925 100644
- --- a/sys/nfs41sys_dir.c
- +++ b/sys/nfs41sys_dir.c
- @@ -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>
- @@ -86,6 +86,9 @@ NTSTATUS marshal_nfs41_dirquery(
- header_len = *len + 2 * sizeof(ULONG) + sizeof(HANDLE) +
- length_as_utf8(entry->u.QueryFile.filter) + 3 * sizeof(BOOLEAN);
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_dirquery: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- diff --git a/sys/nfs41sys_driver.c b/sys/nfs41sys_driver.c
- index 6e2c583..7c48137 100644
- --- a/sys/nfs41sys_driver.c
- +++ b/sys/nfs41sys_driver.c
- @@ -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>
- @@ -275,6 +275,9 @@ NTSTATUS marshal_nfs41_header(
- header_len = sizeof(entry->version) + sizeof(entry->xid) +
- sizeof(entry->opcode) + 2 * sizeof(HANDLE);
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_header: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- @@ -375,6 +378,9 @@ NTSTATUS marshal_nfs41_set_daemon_debuglevel(
- header_len = *len + sizeof(LONG);
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_set_daemon_debuglevel: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- diff --git a/sys/nfs41sys_ea.c b/sys/nfs41sys_ea.c
- index 8499cbc..0d821f8 100644
- --- a/sys/nfs41sys_ea.c
- +++ b/sys/nfs41sys_ea.c
- @@ -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>
- @@ -86,6 +86,9 @@ NTSTATUS marshal_nfs41_easet(
- header_len = *len + length_as_utf8(entry->filename) +
- sizeof(ULONG) + entry->u.SetEa.buf_len + sizeof(DWORD);
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_easet: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- @@ -136,6 +139,9 @@ NTSTATUS marshal_nfs41_eaget(
- 3 * sizeof(ULONG) + entry->u.QueryEa.EaListLength + 2 * sizeof(BOOLEAN);
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_eaget: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- diff --git a/sys/nfs41sys_fileinfo.c b/sys/nfs41sys_fileinfo.c
- index ded8df4..6de73b5 100644
- --- a/sys/nfs41sys_fileinfo.c
- +++ b/sys/nfs41sys_fileinfo.c
- @@ -86,6 +86,9 @@ NTSTATUS marshal_nfs41_filequery(
- header_len = *len + 2 * sizeof(ULONG);
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_filequery: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- @@ -127,6 +130,9 @@ NTSTATUS marshal_nfs41_fileset(
- header_len = *len + length_as_utf8(entry->filename) +
- 2 * sizeof(ULONG) + entry->u.SetFile.buf_len;
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_fileset: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- diff --git a/sys/nfs41sys_fsctl.c b/sys/nfs41sys_fsctl.c
- index 204631e..27c0946 100644
- --- a/sys/nfs41sys_fsctl.c
- +++ b/sys/nfs41sys_fsctl.c
- @@ -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>
- @@ -273,6 +273,9 @@ NTSTATUS marshal_nfs41_queryallocatedranges(
- sizeof(ULONG) +
- sizeof(HANDLE);
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_queryallocatedranges: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- @@ -568,6 +571,9 @@ NTSTATUS marshal_nfs41_setzerodata(
- header_len = *len + sizeof(FILE_ZERO_DATA_INFORMATION);
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_setzerodata: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- @@ -894,6 +900,9 @@ NTSTATUS marshal_nfs41_duplicatedata(
- sizeof(void *) +
- 3*sizeof(LONGLONG);
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_duplicatedata: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- diff --git a/sys/nfs41sys_lock.c b/sys/nfs41sys_lock.c
- index 85d6c32..be7bcb5 100644
- --- a/sys/nfs41sys_lock.c
- +++ b/sys/nfs41sys_lock.c
- @@ -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>
- @@ -87,6 +87,9 @@ NTSTATUS marshal_nfs41_lock(
- header_len = *len + 2 * sizeof(LONGLONG) + 2 * sizeof(BOOLEAN);
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_lock: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- @@ -138,6 +141,9 @@ NTSTATUS marshal_nfs41_unlock(
- header_len = *len + sizeof(ULONG) +
- ((size_t)entry->u.Unlock.count * 2) * sizeof(LONGLONG);
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_unlock: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- diff --git a/sys/nfs41sys_mount.c b/sys/nfs41sys_mount.c
- index c25a132..0fd84c5 100644
- --- a/sys/nfs41sys_mount.c
- +++ b/sys/nfs41sys_mount.c
- @@ -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>
- @@ -115,6 +115,9 @@ NTSTATUS marshal_nfs41_mount(
- #endif /* NFS41_DRIVER_HACK_FORCE_FILENAME_CASE_MOUNTOPTIONS */
- ;
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_mount: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- diff --git a/sys/nfs41sys_openclose.c b/sys/nfs41sys_openclose.c
- index f1db990..dba6017 100644
- --- a/sys/nfs41sys_openclose.c
- +++ b/sys/nfs41sys_openclose.c
- @@ -133,6 +133,9 @@ NTSTATUS marshal_nfs41_open(
- #endif /* NFS41_DRIVER_ALLOW_CREATEFILE_ACLS */
- length_as_utf8(&entry->u.Open.symlink);
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_open: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- @@ -236,6 +239,9 @@ NTSTATUS marshal_nfs41_close(
- sizeof(BOOLEAN);
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_close: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- diff --git a/sys/nfs41sys_readwrite.c b/sys/nfs41sys_readwrite.c
- index f8b2090..41b40b9 100644
- --- a/sys/nfs41sys_readwrite.c
- +++ b/sys/nfs41sys_readwrite.c
- @@ -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>
- @@ -101,6 +101,9 @@ NTSTATUS marshal_nfs41_rw(
- header_len = *len + sizeof(entry->u.ReadWrite.buf_len) +
- sizeof(entry->u.ReadWrite.offset) + sizeof(HANDLE);
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_rw: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- diff --git a/sys/nfs41sys_symlink.c b/sys/nfs41sys_symlink.c
- index 5ed5cfe..d8f9c3d 100644
- --- a/sys/nfs41sys_symlink.c
- +++ b/sys/nfs41sys_symlink.c
- @@ -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>
- @@ -91,6 +91,9 @@ NTSTATUS marshal_nfs41_symlink(
- if (entry->opcode == NFS41_SYSOP_SYMLINK_SET)
- header_len += length_as_utf8(entry->u.Symlink.target);
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_symlink: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- diff --git a/sys/nfs41sys_volinfo.c b/sys/nfs41sys_volinfo.c
- index d2484b6..ed4444c 100644
- --- a/sys/nfs41sys_volinfo.c
- +++ b/sys/nfs41sys_volinfo.c
- @@ -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>
- @@ -86,6 +86,9 @@ NTSTATUS marshal_nfs41_volume(
- header_len = *len + sizeof(FS_INFORMATION_CLASS);
- if (header_len > buf_len) {
- + DbgP("marshal_nfs41_volume: "
- + "upcall buffer too small: header_len(=%ld) > buf_len(=%ld)\n",
- + (long)header_len, (long)buf_len);
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- --
- 2.51.0
- From 01180ec31a8eb873e594e6ed3f39567b373abe7a Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 17 Jan 2026 18:48:38 +0100
- Subject: [PATCH 6/6] daemon: Add "Windows features" section to superblock
- properties logging
- Add "Windows features" section to superblock properties logging.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/nfs41_superblock.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
- diff --git a/daemon/nfs41_superblock.c b/daemon/nfs41_superblock.c
- index 4095ca0..fb84865 100644
- --- a/daemon/nfs41_superblock.c
- +++ b/daemon/nfs41_superblock.c
- @@ -225,6 +225,19 @@ static int get_superblock_attrs(
- superblock->fsid.major, superblock->fsid.minor);
- }
- + /* Windows features */
- + is = infobuff;
- + *is = '\0';
- + if (superblock->nfs_namedattr_support) {
- + is = stpcpy(is, "Win32 named streams");
- + *is++ = ',';
- + is = stpcpy(is, "Win32 extended attributes");
- + }
- + logprintf("get_superblock_attrs(fsid=(%llu,%llu)): "
- + "Supported Windows features: { %s }\n",
- + superblock->fsid.major, superblock->fsid.minor,
- + infobuff);
- +
- /* Windows/DOS attributes */
- is = infobuff;
- *is = '\0';
- --
- 2.51.0
msnfs41client: Patches for Win32 named stream renaming support, fix NFS named attr Win32 named stream filename prefix, tests+misc, 2026-01-17
Posted by Anonymous on Sat 17th Jan 2026 17:57
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