- From 5a2d50a1e86e8ffa119d02c35a9ba6526b65aeef Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 14 Dec 2023 15:10:05 +0100
- Subject: [PATCH 1/3] sys/nfs41_driver: |copy_nfs41_mount_config()| needs
- SecFlavor buf init
- |copy_nfs41_mount_config()| did not init the SecFlavor buffer
- correctly to it's own copy, leaving to spodaric UNC path failures.
- Reported-by: Martin Wege <martin.l.wege@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41_driver.c | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
- diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
- index 9f35859..b9e0f86 100644
- --- a/sys/nfs41_driver.c
- +++ b/sys/nfs41_driver.c
- @@ -289,7 +289,7 @@ typedef struct _NFS41_MOUNT_CONFIG {
- UNICODE_STRING SrvName; /* hostname, or hostname@port */
- WCHAR mntpt_buffer[NFS41_SYS_MAX_PATH_LEN];
- UNICODE_STRING MntPt;
- - WCHAR sec_flavor[MAX_SEC_FLAVOR_LEN];
- + WCHAR sec_flavor_buffer[MAX_SEC_FLAVOR_LEN];
- UNICODE_STRING SecFlavor;
- DWORD timeout;
- } NFS41_MOUNT_CONFIG, *PNFS41_MOUNT_CONFIG;
- @@ -485,6 +485,7 @@ void copy_nfs41_mount_config(NFS41_MOUNT_CONFIG *dest, NFS41_MOUNT_CONFIG *src)
- RtlCopyMemory(dest, src, sizeof(NFS41_MOUNT_CONFIG));
- dest->SrvName.Buffer = dest->srv_buffer;
- dest->MntPt.Buffer = dest->mntpt_buffer;
- + dest->SecFlavor.Buffer = dest->sec_flavor_buffer;
- }
- void print_debug_header(
- @@ -2692,7 +2693,7 @@ void nfs41_MountConfig_InitDefaults(
- Config->MntPt.Buffer = Config->mntpt_buffer;
- Config->SecFlavor.Length = 0;
- Config->SecFlavor.MaximumLength = MAX_SEC_FLAVOR_LEN;
- - Config->SecFlavor.Buffer = Config->sec_flavor;
- + Config->SecFlavor.Buffer = Config->sec_flavor_buffer;
- RtlCopyUnicodeString(&Config->SecFlavor, &AUTH_SYS_NAME);
- Config->timeout = UPCALL_TIMEOUT_DEFAULT;
- }
- @@ -3106,7 +3107,7 @@ NTSTATUS nfs41_CreateVNetRoot(
- status = map_sec_flavor(&Config->SecFlavor, &pVNetRootContext->sec_flavor);
- if (status != STATUS_SUCCESS) {
- - DbgP("Invalid rpcsec security flavor %wZ\n", &Config->SecFlavor);
- + DbgP("Invalid rpcsec security flavor '%wZ'\n", &Config->SecFlavor);
- goto out_free;
- }
- --
- 2.42.1
- From 2cd67a7d200af6354bd487c0f4b9d0aaf932392b Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 14 Dec 2023 15:27:15 +0100
- Subject: [PATCH 2/3] Cygwin binary tarball should have a README
- The Cygwin binary tarball should come with a README
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/Makefile | 8 +-
- cygwin/README.bintarball.txt | 163 +++++++++++++++++++++++++++++++++++
- 2 files changed, 169 insertions(+), 2 deletions(-)
- create mode 100644 cygwin/README.bintarball.txt
- diff --git a/cygwin/Makefile b/cygwin/Makefile
- index 9b4ff11..8eb25fa 100644
- --- a/cygwin/Makefile
- +++ b/cygwin/Makefile
- @@ -101,12 +101,16 @@ installdest: $(VS_BUILD_DIR)/nfsd.exe \
- "$(DESTDIR)/cygdrive/c/cygwin64/sbin/"
- bintarball: installdest
- - (cd destdir && \
- + ( \
- + base_filename="msnfs41client_cygwin_binaries_git$$(git rev-parse --short HEAD)_$$(date +%Y%m%d_%Hh%Mm)" ; \
- + cd destdir && \
- + cp "../cygwin/README.bintarball.txt" "$${base_filename}.readme" && \
- tar -cvf - \
- --owner=SYSTEM:18 \
- --group=SYSTEM:18 \
- cygdrive/c/cygwin64 | \
- - bzip2 -9 >"msnfs41client_cygwin_binaries_git$$(git rev-parse --short HEAD)_$$(date +%Y%m%d_%Hh%Mm).tar.bz2")
- + bzip2 -9 >"$${base_filename}.tar.bz2" \
- + )
- #
- # clean destdir/, but only if nfsd*.exe does not use it right now
- diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
- new file mode 100644
- index 0000000..493deb4
- --- /dev/null
- +++ b/cygwin/README.bintarball.txt
- @@ -0,0 +1,163 @@
- +###
- +### msnfs41client Cygwin binary tarball README
- +###
- +
- +##
- +## WARNING: ALPHA VERSION, ONLY SUITEABLE FOR BUG HUNTING!!
- +##
- +
- +##
- +## Installation/Deinstallation
- +##
- +
- +# 1. Requirements:
- +- Windows 10
- +- Cygwin 3.5.0
- + - Packages:
- + cygwin
- + cygwin-devel
- + cygrunsrv
- + cygutils
- + cygutils-extra
- + bash
- + bzip2
- + coreutils
- + getent
- + gdb
- + grep
- + hostname
- + less
- + pax
- + pbzip2
- + procps-ng
- + sed
- + tar
- + time
- + util-linux
- + wget
- +
- +
- +# 2. Installation (as "Administrator"):
- +$ mkdir -p ~/download
- +$ cd ~/download
- +$ wget 'http://www.nrubsig.org/people/gisburn/work/msnfs41client/releases/alpha/msnfs41client_cygwin_binaries_git148e927_20231214_12h31m.tar.bz2'
- +$ (cd / && tar -xf ~/download/msnfs41client_cygwin_binaries_git148e927_20231214_12h31m.tar.bz2 )
- +$ /sbin/msnfs41client install
- +
- +
- +# 3. Deinstallation:
- +$ (set -x ; cd / && tar -tf ~/download/msnfs41client_cygwin_binaries_git148e927_20231214_12h31m.tar.bz2 | while read i ; do [[ -f "$i" ]] && rm "$i" ; done)
- +
- +
- +##
- +## Usage
- +##
- +
- +# Run the NFSv4 client daemon:
- +# - run this preferably as "Adminstrator", but this is not a requirement
- +# - requires seperate terminal
- +$ /sbin/msnfs41client run_daemon
- +
- +# Mount a filesystem and use it
- +$ /sbin/nfs_mount -o rw N 10.49.20.110:/net_tmpfs2
- +Successfully mounted '10.49.20.110@2049' to drive 'N:'
- +$ cd /cygdrive/n/
- +$ ls -la
- +total 4
- +drwxrwxrwt 5 Unix_User+0 Unix_Group+0 100 Dec 7 14:17 .
- +dr-xr-xr-x 1 roland_mainz Kein 0 Dec 14 13:48 ..
- +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 80 Dec 12 16:24 10492030
- +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 60 Dec 13 17:58 directory_t
- +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 60 Dec 7 11:01 test2
- +
- +# Unmount filesystem:
- +$ cd ~
- +$ net use N: /delete
- +
- +#
- +# Notes:
- +#
- +- Idmapping (including uid/gid mapping) between NFSv4 client and NFSv4
- + server works via /lib/msnfs41client/cygwin_idmapper.ksh, which
- + either uses builtin static data, or /usr/bin/getent passwd and
- + /usr/bin/getent group.
- + As getent uses the configured name services it should work with LDAP
- + too.
- + This is still work-in-progress, with the goal that both NFSv4 client
- + and server can use different uid/gid numeric values for client and
- + server side.
- +
- +- UNC paths are supported, after successful mounting /sbin/nfs_mount
- + will list the paths in Cygwin UNC format.
- +
- +- SIDs work, users with valid Windows accounts (see Cygwin idmapping
- + above get their SIDs, unknown users with valid uid/gid values get
- + Unix_User+id/Unix_Group+id SIDs, and all others are mapped
- + to nobody/nogroup SIDs.
- +
- +- Cygwin symlinks are supported, but might require
- + $ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1 #.
- + This includes symlinks to UNC paths, e.g. as Admin
- + $ cmd /c 'mklink /d c:\home\rmainz \\derfwpc5131_ipv6@2049\nfs4\export\home2\rmainz' #
- + and then $ cd /cygdrive/c/home/rmainz/ # should work
- +
- +- performace: All binaries are build without any optimisation, so
- + the filesystem is much slower than it could be.
- +
- +- bad performance due to Windows Defender AntiVirus:
- + Option 1:
- + # disable Windows defender realtime monitoring
- + # (requires Admin shell)
- + powershell -Command 'Set-MpPreference -DisableRealtimeMonitoring 1'
- + Option 2:
- + Add "nfsd.exe", "nfsd_debug.exe", ksh93.exe, bash.exe, git.exe and
- + other offending commands to process name whitelist.
- +
- +- performance: Use vmxnet3 in VMware to improve performance
- +
- +- ACLs are supported via the normal Windows ACL tools, but on
- + Linux require the nfs4_getfacl/nfs4_setfacl utilties to see the
- + data.
- + Example (assuming that Windows, Linux NFSv4 client and NFSv4
- + server have a user "siegfried_wulsch"):
- + - On Windows on a NFSv4 filesystem, :
- + $ icacls myhorribledata.txt /grant "siegfried_wulsch:WD" #
- + - On Linux NFSv4 clients you will then see this:
- + ---- snip ----
- + $ nfs4_getfacl myhorribledata.txt
- + A::OWNER@:rwatTcCy
- + A::siegfried_wulsch@global.loc:rwatcy
- + A::GROUP@:rtcy
- + A::EVERYONE@:rtcy
- + ---- snip ----
- +
- +
- +#
- +# Known issues:
- +#
- +- The kernel driver ("nfs41_driver.sys") does not have a cryptographic
- + signature for SecureBoot - which means it will only work if SecureBoot
- + is turned off (otherwise $ /sbin/msnfs41client install # will FAIL!)
- +- If nfsd_debug.exe crashes or gets killed, the only safe way
- + to run it again requires a reboot
- +- LDAP support does not work yet
- +- Attribute caching is to agressiv, making $ tail -f ... # not seeing
- + new data.
- + Workaround: Use GNU tail'S $ tail --follow=name ... #
- +- krb5p security with AES keys do not work against the linux server,
- + as it does not support gss krb5 v2 tokens with rotated data.
- +- When recovering opens and locks outside of the server's grace period,
- + client does not check whether the file has been modified by another
- + client.
- +- If nfsd.exe is restarted while a drive is mapped, that drive needs
- + to be remounted before further use.
- +- Does not allow renaming a file on top of an existing open file.
- + Connectathon's special test op_ren has been commented out.
- +- Extended attributes are supported with some limitations:
- + a) the server must support NFS Named Attributes,
- + b) the order of listings cannot be guaranteed by NFS, and
- + c) the EaSize field cannot be reported for directory queries of
- + FileBothDirInformation, FileFullDirInfo, or FileIdFullDirInfo.
- +
- +# EOF.
- +
- --
- 2.42.1
- From 15c98413e99fd71086e3e91f53e167c9d5226ac8 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 14 Dec 2023 15:40:44 +0100
- Subject: [PATCH 3/3] sys/nfs41_driver: Put %wZ/%s in quotes to see space in
- debug output
- Put %wZ/%s in single quotes (e.g. %wZ ---> '%wZ', %s ---> '%s') to
- make it easier to see space characters in debug output.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41_driver.c | 82 +++++++++++++++++++++++-----------------------
- 1 file changed, 41 insertions(+), 41 deletions(-)
- diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
- index b9e0f86..3b467d1 100644
- --- a/sys/nfs41_driver.c
- +++ b/sys/nfs41_driver.c
- @@ -495,7 +495,7 @@ void print_debug_header(
- PIO_STACK_LOCATION IrpSp = RxContext->CurrentIrpSp;
- if (IrpSp) {
- - DbgP("FileOject %p name %wZ access r=%d,w=%d,d=%d share r=%d,w=%d,d=%d\n",
- + DbgP("FileOject %p name '%wZ' access r=%d,w=%d,d=%d share r=%d,w=%d,d=%d\n",
- IrpSp->FileObject, &IrpSp->FileObject->FileName,
- IrpSp->FileObject->ReadAccess, IrpSp->FileObject->WriteAccess,
- IrpSp->FileObject->DeleteAccess, IrpSp->FileObject->SharedRead,
- @@ -539,7 +539,7 @@ NTSTATUS marshall_unicode_as_utf8(
- status = RtlUnicodeToUTF8N(NULL, 0xffff,
- &ActualCount, str->Buffer, str->Length);
- if (status) {
- - print_error("RtlUnicodeToUTF8N('%wZ') failed with 0x%08X\n",
- + print_error("RtlUnicodeToUTF8N('%wZ') failed with 0x%08X\n",
- str, status);
- goto out;
- }
- @@ -550,7 +550,7 @@ NTSTATUS marshall_unicode_as_utf8(
- status = RtlUnicodeToUTF8N(ansi.Buffer, ansi.MaximumLength,
- &ActualCount, str->Buffer, str->Length);
- if (status) {
- - print_error("RtlUnicodeToUTF8N(%hu, '%wZ', %hu) failed with 0x%08X\n",
- + print_error("RtlUnicodeToUTF8N(%hu, '%wZ', %hu) failed with 0x%08X\n",
- ansi.MaximumLength, str, str->Length, status);
- goto out;
- }
- @@ -595,7 +595,7 @@ NTSTATUS marshal_nfs41_header(
- #ifdef DEBUG_MARSHAL_HEADER
- if (MmIsAddressValid(entry->filename))
- - DbgP("[upcall header] xid=%lld opcode=%s filename=%wZ version=%d "
- + DbgP("[upcall header] xid=%lld opcode='%s' filename='%wZ' version=%d "
- "session=0x%x open_state=0x%x\n", entry->xid,
- ENTRY_OPCODE2STRING(entry), entry->filename,
- entry->version, entry->session, entry->open_state);
- @@ -657,8 +657,8 @@ NTSTATUS marshal_nfs41_mount(
- *len = header_len;
- #ifdef DEBUG_MARSHAL_DETAIL
- - DbgP("marshal_nfs41_mount: server name=%wZ mount point=%wZ "
- - "sec_flavor=%s rsize=%d wsize=%d\n",
- + DbgP("marshal_nfs41_mount: server name='%wZ' mount point='%wZ' "
- + "sec_flavor='%s' rsize=%d wsize=%d\n",
- entry->u.Mount.srv_name, entry->u.Mount.root,
- secflavorop2name(entry->u.Mount.sec_flavor), entry->u.Mount.rsize,
- entry->u.Mount.wsize);
- @@ -751,7 +751,7 @@ NTSTATUS marshal_nfs41_open(
- *len = header_len;
- #ifdef DEBUG_MARSHAL_DETAIL
- - DbgP("marshal_nfs41_open: name=%wZ mask=0x%x access=0x%x attrs=0x%x "
- + DbgP("marshal_nfs41_open: name='%wZ' mask=0x%x access=0x%x attrs=0x%x "
- "opts=0x%x dispo=0x%x open_owner_id=0x%x mode=%o "
- #ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- "owner_local_uid=%lu owner_group_local_gid=%lu "
- @@ -937,7 +937,7 @@ NTSTATUS marshal_nfs41_close(
- *len = header_len;
- #ifdef DEBUG_MARSHAL_DETAIL
- - DbgP("marshal_nfs41_close: name=%wZ remove=%d srv_open=%p renamed=%d\n",
- + DbgP("marshal_nfs41_close: name='%wZ' remove=%d srv_open=%p renamed=%d\n",
- entry->filename->Length?entry->filename:&SLASH,
- entry->u.Close.remove, entry->u.Close.srv_open, entry->u.Close.renamed);
- #endif
- @@ -998,7 +998,7 @@ NTSTATUS marshal_nfs41_dirquery(
- *len = header_len;
- #ifdef DEBUG_MARSHAL_DETAIL
- - DbgP("marshal_nfs41_dirquery: filter='%wZ'class=%d len=%d "
- + DbgP("marshal_nfs41_dirquery: filter='%wZ'class=%d len=%d "
- "1st\\restart\\single=%d\\%d\\%d\n", entry->u.QueryFile.filter,
- entry->u.QueryFile.InfoClass, entry->buf_len,
- entry->u.QueryFile.initial_query, entry->u.QueryFile.restart_scan,
- @@ -1073,7 +1073,7 @@ NTSTATUS marshal_nfs41_fileset(
- *len = header_len;
- #ifdef DEBUG_MARSHAL_DETAIL
- - DbgP("marshal_nfs41_fileset: filename='%wZ' class=%d\n",
- + DbgP("marshal_nfs41_fileset: filename='%wZ' class=%d\n",
- entry->filename, entry->u.SetFile.InfoClass);
- #endif
- out:
- @@ -1111,7 +1111,7 @@ NTSTATUS marshal_nfs41_easet(
- *len = header_len;
- #ifdef DEBUG_MARSHAL_DETAIL
- - DbgP("marshal_nfs41_easet: filename=%wZ, buflen=%d mode=0x%x\n",
- + DbgP("marshal_nfs41_easet: filename='%wZ', buflen=%d mode=0x%x\n",
- entry->filename, entry->buf_len, entry->u.SetEa.mode);
- #endif
- out:
- @@ -1158,7 +1158,7 @@ NTSTATUS marshal_nfs41_eaget(
- *len = header_len;
- #ifdef DEBUG_MARSHAL_DETAIL
- - DbgP("marshal_nfs41_eaget: filename=%wZ, index=%d list_len=%d "
- + DbgP("marshal_nfs41_eaget: filename='%wZ', index=%d list_len=%d "
- "rescan=%d single=%d\n", entry->filename,
- entry->u.QueryEa.EaIndex, entry->u.QueryEa.EaListLength,
- entry->u.QueryEa.RestartScan, entry->u.QueryEa.ReturnSingleEntry);
- @@ -1200,7 +1200,7 @@ NTSTATUS marshal_nfs41_symlink(
- *len = header_len;
- #ifdef DEBUG_MARSHAL_DETAIL
- - DbgP("marshal_nfs41_symlink: name %wZ symlink target %wZ\n",
- + DbgP("marshal_nfs41_symlink: name '%wZ' symlink target '%wZ'\n",
- entry->filename,
- entry->u.Symlink.set?entry->u.Symlink.target : NULL);
- #endif
- @@ -1323,7 +1323,7 @@ void nfs41_invalidate_cache (
- RtlCopyMemory(&srv_open, buf, sizeof(HANDLE));
- #ifdef DEBUG_INVALIDATE_CACHE
- - DbgP("nfs41_invalidate_cache: received srv_open=%p %wZ\n",
- + DbgP("nfs41_invalidate_cache: received srv_open=%p '%wZ'\n",
- srv_open, srv_open->pAlreadyPrefixedName);
- #endif
- if (MmIsAddressValid(srv_open))
- @@ -1619,7 +1619,7 @@ void unmarshal_nfs41_header(
- RtlCopyMemory(&tmp->errno, *buf, sizeof(tmp->errno));
- *buf += sizeof(tmp->errno);
- #ifdef DEBUG_MARSHAL_HEADER
- - DbgP("[downcall header] xid=%lld opcode=%s status=%d errno=%d\n", tmp->xid,
- + DbgP("[downcall header] xid=%lld opcode='%s' status=%d errno=%d\n", tmp->xid,
- ENTRY_OPCODE2STRING(tmp), tmp->status, tmp->errno);
- #endif
- }
- @@ -1735,7 +1735,7 @@ NTSTATUS unmarshal_nfs41_open(
- RtlCopyMemory(cur->u.Open.symlink.Buffer, *buf,
- cur->u.Open.symlink.MaximumLength);
- #ifdef DEBUG_MARSHAL_DETAIL
- - DbgP("unmarshal_nfs41_open: ERROR_REPARSE -> '%wZ'\n", &cur->u.Open.symlink);
- + DbgP("unmarshal_nfs41_open: ERROR_REPARSE -> '%wZ'\n", &cur->u.Open.symlink);
- #endif
- }
- #ifdef DEBUG_MARSHAL_DETAIL
- @@ -2523,12 +2523,12 @@ NTSTATUS _nfs41_CreateSrvCall(
- // validate the server name with the test name of 'pnfs'
- #ifdef DEBUG_MOUNT
- - DbgP("SrvCall: Connection Name Length: %d %wZ\n",
- + DbgP("SrvCall: Connection Name Length: %d '%wZ'\n",
- pSrvCall->pSrvCallName->Length, pSrvCall->pSrvCallName);
- #endif
- if (pSrvCall->pSrvCallName->Length > SERVER_NAME_BUFFER_SIZE) {
- - print_error("Server name '%wZ' too long for server entry (max %u)\n",
- + print_error("Server name '%wZ' too long for server entry (max %u)\n",
- pSrvCall->pSrvCallName, SERVER_NAME_BUFFER_SIZE);
- status = STATUS_NAME_TOO_LONG;
- goto out;
- @@ -2640,7 +2640,7 @@ NTSTATUS nfs41_mount(
- #ifdef DEBUG_MOUNT
- DbgEn();
- - DbgP("Server Name %wZ Mount Point %wZ SecFlavor %d\n",
- + DbgP("Server Name '%wZ' Mount Point '%wZ' SecFlavor %d\n",
- &config->SrvName, &config->MntPt, sec_flavor);
- #endif
- status = nfs41_UpcallCreate(NFS41_MOUNT, NULL, *session,
- @@ -2736,11 +2736,11 @@ NTSTATUS nfs41_MountConfig_ParseDword(
- *Value = Minimum;
- if (*Value > Maximum)
- *Value = Maximum;
- - DbgP(" '%ls' -> '%wZ' -> %lu\n", Name, usValue, *Value);
- + DbgP(" '%ls' -> '%wZ' -> %lu\n", Name, usValue, *Value);
- #endif
- }
- else
- - print_error("Failed to convert %s='%wZ' to unsigned long.\n",
- + print_error("Failed to convert '%s'='%wZ' to unsigned long.\n",
- Name, usValue);
- }
- @@ -2846,7 +2846,7 @@ NTSTATUS nfs41_MountConfig_ParseOptions(
- }
- else {
- status = STATUS_INVALID_PARAMETER;
- - print_error("Unrecognized option '%ls' -> '%wZ'\n",
- + print_error("Unrecognized option '%ls' -> '%wZ'\n",
- Name, usValue);
- }
- @@ -2983,7 +2983,7 @@ NTSTATUS nfs41_CreateVNetRoot(
- print_v_net_root(0, pVNetRoot);
- DbgP("pVNetRoot=%p pNetRoot=%p pSrvCall=%p\n", pVNetRoot, pNetRoot, pSrvCall);
- - DbgP("pNetRoot=%wZ Type=%d pSrvCallName=%wZ VirtualNetRootStatus=0x%x "
- + DbgP("pNetRoot='%wZ' Type=%d pSrvCallName='%wZ' VirtualNetRootStatus=0x%x "
- "NetRootStatus=0x%x\n", pNetRoot->pNetRootName,
- pNetRoot->Type, pSrvCall->pSrvCallName,
- pCreateNetRootContext->VirtualNetRootStatus,
- @@ -3003,7 +3003,7 @@ NTSTATUS nfs41_CreateVNetRoot(
- * only claim paths of the form '\\server\nfs4\path' */
- status = has_nfs_prefix(pSrvCall->pSrvCallName, pNetRoot->pNetRootName);
- if (status) {
- - print_error("nfs41_CreateVNetRoot: NetRootName %wZ doesn't match "
- + print_error("nfs41_CreateVNetRoot: NetRootName '%wZ' doesn't match "
- "'\\nfs4'!\n", pNetRoot->pNetRootName);
- goto out;
- }
- @@ -3291,7 +3291,7 @@ VOID nfs41_ExtractNetRootName(
- NetRootName->Length = NetRootName->MaximumLength
- = (USHORT)((PCHAR)w - (PCHAR)wlow);
- #ifdef DEBUG_MOUNT
- - DbgP("In: pSrvCall %p PathName=%wZ SrvCallName=%wZ Out: NetRootName=%wZ\n",
- + DbgP("In: pSrvCall %p PathName='%wZ' SrvCallName='%wZ' Out: NetRootName='%wZ'\n",
- SrvCall, FilePathName, SrvCall->pSrvCallName, NetRootName);
- #endif
- return;
- @@ -3857,8 +3857,8 @@ retry_on_link:
- status = RxPrepareToReparseSymbolicLink(RxContext,
- entry->u.Open.symlink_embedded, &AbsPath, TRUE, &ReparseRequired);
- #ifdef DEBUG_OPEN
- - DbgP("RxPrepareToReparseSymbolicLink(%u, '%wZ') returned %08lX, "
- - "FileName is '%wZ'\n", entry->u.Open.symlink_embedded,
- + DbgP("RxPrepareToReparseSymbolicLink(%u, '%wZ') returned %08lX, "
- + "FileName is '%wZ'\n", entry->u.Open.symlink_embedded,
- &AbsPath, status, &RxContext->CurrentIrpSp->FileObject->FileName);
- #endif
- if (status == STATUS_SUCCESS) {
- @@ -3966,7 +3966,7 @@ retry_on_link:
- !nfs41_fcb->StandardInfo.Directory) {
- ULONG flag = DISABLE_CACHING;
- #ifdef DEBUG_OPEN
- - DbgP("nfs41_Create: reopening (changed) file %wZ\n",
- + DbgP("nfs41_Create: reopening (changed) file '%wZ'\n",
- SrvOpen->pAlreadyPrefixedName);
- #endif
- RxChangeBufferingState((PSRV_OPEN)SrvOpen, ULongToPtr(flag), 1);
- @@ -4256,7 +4256,7 @@ void print_debug_filedirquery_header(
- PRX_CONTEXT RxContext)
- {
- print_debug_header(RxContext);
- - DbgP("FileName='%wZ', InfoClass = %s\n",
- + DbgP("FileName='%wZ', InfoClass = '%s'\n",
- GET_ALREADY_PREFIXED_NAME_FROM_CONTEXT(RxContext),
- print_file_information_class(RxContext->Info.FileInformationClass));
- }
- @@ -4265,7 +4265,7 @@ void print_querydir_args(
- PRX_CONTEXT RxContext)
- {
- print_debug_filedirquery_header(RxContext);
- - DbgP("Filter='%wZ', Index=%d, Restart/Single/Specified/Init=%d/%d/%d/%d\n",
- + DbgP("Filter='%wZ', Index=%d, Restart/Single/Specified/Init=%d/%d/%d/%d\n",
- &RxContext->pFobx->UnicodeQueryTemplate,
- RxContext->QueryDirectory.FileIndex,
- RxContext->QueryDirectory.RestartScan,
- @@ -4407,7 +4407,7 @@ void print_queryvolume_args(
- PRX_CONTEXT RxContext)
- {
- print_debug_header(RxContext);
- - DbgP("FileName='%wZ', InfoClass = %s BufferLen = %d\n",
- + DbgP("FileName='%wZ', InfoClass = '%s' BufferLen = %d\n",
- GET_ALREADY_PREFIXED_NAME_FROM_CONTEXT(RxContext),
- print_fs_information_class(RxContext->Info.FileInformationClass),
- RxContext->Info.LengthRemaining);
- @@ -5611,7 +5611,7 @@ NTSTATUS check_nfs41_setattr_args(
- UNICODE_STRING dst = { (USHORT)rinfo->FileNameLength,
- (USHORT)rinfo->FileNameLength, rinfo->FileName };
- #ifdef DEBUG_FILE_SET
- - DbgP("Attempting to rename to '%wZ'\n", &dst);
- + DbgP("Attempting to rename to '%wZ'\n", &dst);
- #endif
- if (isFilenameTooLong(&dst, pVNetRootContext)) {
- status = STATUS_OBJECT_NAME_INVALID;
- @@ -5630,7 +5630,7 @@ NTSTATUS check_nfs41_setattr_args(
- UNICODE_STRING dst = { (USHORT)linfo->FileNameLength,
- (USHORT)linfo->FileNameLength, linfo->FileName };
- #ifdef DEBUG_FILE_SET
- - DbgP("Attempting to add link as '%wZ'\n", &dst);
- + DbgP("Attempting to add link as '%wZ'\n", &dst);
- #endif
- if (isFilenameTooLong(&dst, pVNetRootContext)) {
- status = STATUS_OBJECT_NAME_INVALID;
- @@ -5851,7 +5851,7 @@ NTSTATUS nfs41_ComputeNewBufferingState(
- FCB_STATE_WRITECACHING_ENABLED | FCB_STATE_WRITEBUFFERING_ENABLED);
- }
- #ifdef DEBUG_TIME_BASED_COHERENCY
- - DbgP("nfs41_ComputeNewBufferingState: %wZ pSrvOpen %p Old %08x New %08x\n",
- + DbgP("nfs41_ComputeNewBufferingState: '%wZ' pSrvOpen %p Old %08x New %08x\n",
- pSrvOpen->pAlreadyPrefixedName, pSrvOpen, oldFlags,
- pSrvOpen->BufferingFlags);
- *pNewBufferingState = pSrvOpen->BufferingFlags;
- @@ -5909,7 +5909,7 @@ void enable_caching(
- nfs41_fcb_list_entry, next);
- if (cur->fcb == SrvOpen->pFcb) {
- #ifdef DEBUG_TIME_BASED_COHERENCY
- - DbgP("enable_caching: Looked&Found match for fcb=%p %wZ\n",
- + DbgP("enable_caching: Looked&Found match for fcb=%p '%wZ'\n",
- SrvOpen->pFcb, SrvOpen->pAlreadyPrefixedName);
- #endif
- cur->skip = FALSE;
- @@ -5918,7 +5918,7 @@ void enable_caching(
- }
- if (pEntry->Flink == &openlist.head) {
- #ifdef DEBUG_TIME_BASED_COHERENCY
- - DbgP("enable_caching: reached EOL looking for fcb=%p %wZ\n",
- + DbgP("enable_caching: reached EOL looking for fcb=%p '%wZ'\n",
- SrvOpen->pFcb, SrvOpen->pAlreadyPrefixedName);
- #endif
- break;
- @@ -6483,13 +6483,13 @@ void print_reparse_buffer(
- Reparse->SymbolicLinkReparseBuffer.SubstituteNameOffset/sizeof(WCHAR)];
- name.MaximumLength = name.Length =
- Reparse->SymbolicLinkReparseBuffer.SubstituteNameLength;
- - DbgP("SubstituteName: %wZ\n", &name);
- + DbgP("SubstituteName: '%wZ'\n", &name);
- name.Buffer = &Reparse->SymbolicLinkReparseBuffer.PathBuffer[
- Reparse->SymbolicLinkReparseBuffer.PrintNameOffset/sizeof(WCHAR)];
- name.MaximumLength = name.Length =
- Reparse->SymbolicLinkReparseBuffer.PrintNameLength;
- - DbgP("PrintName: %wZ\n", &name);
- + DbgP("PrintName: '%wZ'\n", &name);
- }
- NTSTATUS check_nfs41_setreparse_args(
- @@ -6757,7 +6757,7 @@ NTSTATUS nfs41_FsdDispatch (
- DbgEn();
- DbgP("CURRENT IRP = %d.%d\n", IrpSp->MajorFunction, IrpSp->MinorFunction);
- if(IrpSp->FileObject)
- - DbgP("FileOject %p Filename %wZ\n", IrpSp->FileObject,
- + DbgP("FileOject %p Filename '%wZ'\n", IrpSp->FileObject,
- &IrpSp->FileObject->FileName);
- #endif
- @@ -6993,7 +6993,7 @@ VOID fcbopen_main(PVOID ctx)
- if (srv_open->DesiredAccess &
- (FILE_READ_DATA | FILE_WRITE_DATA | FILE_APPEND_DATA)) {
- #ifdef DEBUG_TIME_BASED_COHERENCY
- - DbgP("fcbopen_main: ************ Invalidate the cache %wZ"
- + DbgP("fcbopen_main: ************ Invalidate the cache '%wZ'"
- "************\n", srv_open->pAlreadyPrefixedName);
- #endif
- RxIndicateChangeOfBufferingStateForSrvOpen(
- @@ -7075,7 +7075,7 @@ NTSTATUS DriverEntry(
- &dev_exts->VolAttrsLen);
- RtlInitUnicodeString(&user_dev_name, NFS41_SHADOW_DEVICE_NAME);
- - DbgP("calling IoCreateSymbolicLink %wZ %wZ\n", &user_dev_name, &dev_name);
- + DbgP("calling IoCreateSymbolicLink '%wZ' '%wZ'\n", &user_dev_name, &dev_name);
- status = IoCreateSymbolicLink(&user_dev_name, &dev_name);
- if (status != STATUS_SUCCESS) {
- print_error("Device name IoCreateSymbolicLink failed: %08lx\n", status);
- --
- 2.42.1
msnfs41client: Patch for UNC path issue, debugging and bintarball README, 2023-12-14
Posted by Anonymous on Thu 14th Dec 2023 15:26
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.