- From d69478f43ad6119a654aa0ef3c1850adb1d35179 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 14 Aug 2025 11:00:43 +0200
- Subject: [PATCH 1/3] cygwin: /sbin/msnfs41client install should not work while
- the ms-nfs41-client servcices are running
- /sbin/msnfs41client install should not work while the ms-nfs41-client
- servcices are running, and provide instructions what to do in this case.
- Reported-by: Lionel Cons <Lionelcons1972@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/devel/msnfs41client.bash | 44 +++++++++++++++++++++++++++++++++
- 1 file changed, 44 insertions(+)
- diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
- index d00e59e..492921f 100755
- --- a/cygwin/devel/msnfs41client.bash
- +++ b/cygwin/devel/msnfs41client.bash
- @@ -117,6 +117,40 @@ function check_machine_arch
- # not reached
- }
- +function is_service_stopped
- +{
- + typeset service_name="$1"
- + typeset -i res
- + typeset stdout
- +
- + stdout="$( sc query "$service_name" )" ; (( res=$? ))
- +
- + if (( res != 0 )) ; then
- + printf "%s: sc failed, msg=%q\n" "$0" "$stdout" 1>&2
- + return 1
- + fi
- +
- + if [[ "$stdout" == *STOPPED* ]] ; then
- + return 0
- + fi
- +
- + return 1
- +}
- +
- +function is_service_installed
- +{
- + typeset service_name="$1"
- + typeset -i res
- +
- + sc getdisplayname "$service_name" >'/dev/null' 2>&1 ; (( res=$? ))
- +
- + if (( res == 0 )) ; then
- + return 0
- + fi
- +
- + return 1
- +}
- +
- function nfsclient_install
- {
- set -o nounset
- @@ -127,6 +161,16 @@ function nfsclient_install
- typeset use_secureboot=false
- + if is_service_installed 'ms-nfs41-client-service' ; then
- + if ! is_service_stopped 'ms-nfs41-client-service' ; then
- + set -o xtrace # make message below more readable
- + printf 'ms-nfs41-client-service is still running.\n'
- + printf 'Please disable the service via $ /sbin/msnfs41client disableautostartservices #,\n'
- + printf 'reboot and then install the new version of ms-nfs41-client via $ /sbin/msnfs41client install #\n'
- + return 1
- + fi
- + fi
- +
- # switch to the location where this script is installed,
- # because on Cygwin the script will be installed
- # in /cygdrive/c/cygwin/lib/msnfs41client/ (32bit) or
- --
- 2.45.1
- From 469bc289f0881bc003d8c36c870deb5eb1d916d3 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 14 Aug 2025 11:03:13 +0200
- Subject: [PATCH 2/3] cygwin: Replace ksh93-specific print(1) usage with
- printf(1)
- Replace ksh93-specific print(1) ($ print -u2 ... #) usage with
- printf(1) ($ printf ... 1>&2 #).
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/devel/msnfs41client.bash | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
- diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
- index 492921f..cc104a6 100755
- --- a/cygwin/devel/msnfs41client.bash
- +++ b/cygwin/devel/msnfs41client.bash
- @@ -840,7 +840,7 @@ function nfsclient_system_mount_globaldirs
- set -o errexit
- if ! nfsclient_waitfor_clientdaemon ; then
- - print -u2 -f $"%s: nfsd*.exe not running.\n" "$0"
- + printf $"%s: nfsd*.exe not running.\n" "$0" 1>&2
- return 1
- fi
- @@ -862,7 +862,7 @@ function nfsclient_mount_homedir
- set -o errexit
- if ! nfsclient_waitfor_clientdaemon ; then
- - print -u2 -f $"%s: nfsd*.exe not running.\n" "$0"
- + printf $"%s: nfsd*.exe not running.\n" "$0" 1>&2
- return 1
- fi
- --
- 2.45.1
- From dc3805eb27c8f1859436cb51d074c0ee5c715a29 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 14 Aug 2025 14:14:59 +0200
- Subject: [PATCH 3/3] sys: Handle |MRxCreateVNetRoot()| \\IPC$ requests by DFS
- Handle |MRxCreateVNetRoot()| \\IPC$ requests which DFS uses to check whether
- this is a DFS path. We do not support DFS, so we return
- |STATUS_MORE_PROCESSING_REQUIRED|.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41sys_driver.c | 1 +
- sys/nfs41sys_driver.h | 1 +
- sys/nfs41sys_mount.c | 32 +++++++++++++++++++++++++++++++-
- 3 files changed, 33 insertions(+), 1 deletion(-)
- diff --git a/sys/nfs41sys_driver.c b/sys/nfs41sys_driver.c
- index c312ce2..4de1ab9 100644
- --- a/sys/nfs41sys_driver.c
- +++ b/sys/nfs41sys_driver.c
- @@ -84,6 +84,7 @@ DECLARE_CONST_UNICODE_STRING(AUTHGSS_KRB5I_NAME, L"krb5i");
- DECLARE_CONST_UNICODE_STRING(AUTHGSS_KRB5P_NAME, L"krb5p");
- DECLARE_CONST_UNICODE_STRING(SLASH, L"\\");
- DECLARE_CONST_UNICODE_STRING(EMPTY_STRING, L"");
- +DECLARE_CONST_UNICODE_STRING(NetRootIpc, L"\\IPC$");
- DECLARE_CONST_ANSI_STRING(NfsV3Attributes, EA_NFSV3ATTRIBUTES);
- DECLARE_CONST_ANSI_STRING(NfsSymlinkTargetName, EA_NFSSYMLINKTARGETNAME);
- diff --git a/sys/nfs41sys_driver.h b/sys/nfs41sys_driver.h
- index 6c6db57..597d207 100644
- --- a/sys/nfs41sys_driver.h
- +++ b/sys/nfs41sys_driver.h
- @@ -117,6 +117,7 @@ DECLARE_EXTERN_DECLARE_CONST_UNICODE_STRING(AUTHGSS_KRB5I_NAME);
- DECLARE_EXTERN_DECLARE_CONST_UNICODE_STRING(AUTHGSS_KRB5P_NAME);
- DECLARE_EXTERN_DECLARE_CONST_UNICODE_STRING(SLASH);
- DECLARE_EXTERN_DECLARE_CONST_UNICODE_STRING(EMPTY_STRING);
- +DECLARE_EXTERN_DECLARE_CONST_UNICODE_STRING(NetRootIpc);
- DECLARE_EXTERN_CONST_ANSI_STRING(NfsV3Attributes);
- DECLARE_EXTERN_CONST_ANSI_STRING(NfsSymlinkTargetName);
- diff --git a/sys/nfs41sys_mount.c b/sys/nfs41sys_mount.c
- index a1e7f61..069c682 100644
- --- a/sys/nfs41sys_mount.c
- +++ b/sys/nfs41sys_mount.c
- @@ -845,13 +845,43 @@ NTSTATUS nfs41_CreateVNetRoot(
- #endif
- FsRtlEnterFileSystem();
- - if (pNetRoot->Type != NET_ROOT_DISK && pNetRoot->Type != NET_ROOT_WILD) {
- + if ((pNetRoot->Type != NET_ROOT_DISK) &&
- + (pNetRoot->Type != NET_ROOT_WILD) &&
- + (pNetRoot->Type != NET_ROOT_PIPE)) {
- print_error("nfs41_CreateVNetRoot: Unsupported NetRoot Type %u\n",
- pNetRoot->Type);
- status = STATUS_NOT_SUPPORTED;
- goto out;
- }
- + if (pNetRoot->Type == NET_ROOT_PIPE) {
- + PUNICODE_STRING nrn = pNetRoot->pNetRootName;
- +
- + /*
- + * Check whether this is a CreateVNetRoot for a '\IPC$' pipe, and in
- + * that case return |STATUS_MORE_PROCESSING_REQUIRED| so DFS knows
- + * that this is not a DFS path
- + */
- + if (nrn->Length >=
- + (pSrvCall->pSrvCallName->Length + NetRootIpc.Length)) {
- + if (memcmp(&nrn->Buffer[(nrn->Length/sizeof(wchar_t)) -
- + (NetRootIpc.Length/sizeof(wchar_t))],
- + NetRootIpc.Buffer, NetRootIpc.Length) == 0) {
- + DbgP("nfs41_CreateVNetRoot: "
- + "CreateVNetRoot for the \\IPC$ pipe!\n");
- + status = STATUS_MORE_PROCESSING_REQUIRED;
- + goto out;
- + }
- + else {
- + DbgP("nfs41_CreateVNetRoot: "
- + "CreateVNetRoot not for the \\IPC$ pipe\n");
- + }
- + }
- +
- + status = STATUS_NOT_SUPPORTED;
- + goto out;
- + }
- +
- pVNetRootContext->session = INVALID_HANDLE_VALUE;
- /*
- --
- 2.45.1
msnfs41client: Patches for rejecting install if service is running, DFS "\IPC$" pipe+misc, 2025-08-14
Posted by Anonymous on Thu 14th Aug 2025 16:08
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.