- From 8385dafd78068c5eebe1ab9224557d6af7a1813e Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 19 Jan 2024 16:29:00 +0100
- Subject: [PATCH 1/7] testing: Fix typo in tests/manual_testing.txt
- Fix typo in tests/manual_testing.txt
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/manual_testing.txt | 1 -
- 1 file changed, 1 deletion(-)
- diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
- index 761ea98..6de2508 100644
- --- a/tests/manual_testing.txt
- +++ b/tests/manual_testing.txt
- @@ -53,7 +53,6 @@ cd bash/
- # (this is an automake/autoconf issue, they should trust Cygwin and not use
- # ancient workarounds for issues which no longer exists)
- (set -o xtrace ; sed -i "s/as_ln_s='cp -pR'/as_ln_s='ln -s'/g" $(find . -name configure) )
- -./configure
- # workaround for $ cp -p # failing with "Function not implemented"
- (set -o xtrace ; sed -i -r 's/(cp.*)([[:space:]]+-p[[:space:]]+)/\1\2--no-preserve=ownership /g' $(find . -name Makefile -o -name Makefile.in) )
- # run configure
- --
- 2.43.0
- From e9a3deb749cefa2873e07a1260c46f2d08c76d5a Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 19 Jan 2024 16:50:36 +0100
- Subject: [PATCH 2/7] cygwin: Fix Cygwin build for $ cd cygwin; make build #
- Fix Cygwin build for $ cd cygwin; make build # (instead of
- $ make -f cygwin/Makefile build #
- Reported-by: Josh Hurst <joshhurst@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- diff --git a/cygwin/Makefile b/cygwin/Makefile
- index 4f62e85..73f8a37 100644
- --- a/cygwin/Makefile
- +++ b/cygwin/Makefile
- @@ -31,7 +31,7 @@ build:
- which MSBuild.exe
- MSBuild.exe '$(shell cygpath -w "$(PROJECT_BASEDIR_DIR)/build.vc19/nfs41-client.sln")' -t:Build -p:Configuration=Release -p:Platform=x64
- MSBuild.exe '$(shell cygpath -w "$(PROJECT_BASEDIR_DIR)/build.vc19/nfs41-client.sln")' -t:Build -p:Configuration=Debug -p:Platform=x64
- - (cd tests/winfsinfo1 && make all)
- + (cd "$(PROJECT_BASEDIR_DIR)/tests/winfsinfo1" && make all)
- #
- # clean target
- --
- 2.43.0
- From 7c87336e7bb58cc8cdd493573d2aa98b21c4831d Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 19 Jan 2024 17:06:29 +0100
- Subject: [PATCH 3/7] cygwin: Fix bintarball build for $ cd cygwin ; make
- bintarball #
- Fix bintarball build for $ cd cygwin ; make bintarball # (instead
- of $ make -f cygwin/Makefile bintarball #).
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/Makefile | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
- diff --git a/cygwin/Makefile b/cygwin/Makefile
- index 73f8a37..0374429 100644
- --- a/cygwin/Makefile
- +++ b/cygwin/Makefile
- @@ -38,7 +38,7 @@ build:
- #
- clean:
- rm -vRf $$(find "$(PROJECT_BASEDIR_DIR)/build.vc19" -name Debug -o -name Release)
- - (cd tests/winfsinfo1 && make clean)
- + (cd "$(PROJECT_BASEDIR_DIR)/tests/winfsinfo1" && make clean)
- # install in DESTDIR
- installdest: $(VS_BUILD_DIR)/nfsd.exe \
- @@ -88,7 +88,7 @@ installdest: $(VS_BUILD_DIR)/nfsd.exe \
- cp $(CYGWIN_MAKEFILE_DIR)/utils/sshnfs/sshnfs.ksh $(DESTDIR)/cygdrive/c/cygwin64/sbin/sshnfs
- chmod a+x $(DESTDIR)/cygdrive/c/cygwin64/sbin/sshnfs
- @ printf "# Package tests\n"
- - cp tests/winfsinfo1/winfsinfo.exe $(DESTDIR)/cygdrive/c/cygwin64/bin/winfsinfo.exe
- + cp "$(PROJECT_BASEDIR_DIR)/tests/winfsinfo1/winfsinfo.exe" $(DESTDIR)/cygdrive/c/cygwin64/bin/winfsinfo.exe
- @ printf "# Package ksh93&co (if available) since Cygwin does not ship with it yet\n"
- [[ -x /usr/bin/ksh93.exe ]] && cp /usr/bin/ksh93.exe $(DESTDIR)/cygdrive/c/cygwin64/bin/ksh93.exe
- [[ -x /usr/bin/shcomp.exe ]] && cp /usr/bin/shcomp.exe $(DESTDIR)/cygdrive/c/cygwin64/bin/shcomp.exe
- --
- 2.43.0
- From d35782e20a683a30a778aaf1b549b2f5f6d9571e Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 19 Jan 2024 18:01:53 +0100
- Subject: [PATCH 4/7] cygwin: Fix typos in cygwin tarball readme
- Fix typos in cygwin tarball readme
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/README.bintarball.txt | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
- diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
- index f9d206b..a71cb05 100644
- --- a/cygwin/README.bintarball.txt
- +++ b/cygwin/README.bintarball.txt
- @@ -3,7 +3,7 @@
- ###
- ##
- -## WARNING: ALPHA VERSION, ONLY SUITEABLE FOR BUG HUNTING!!
- +## WARNING: ALPHA VERSION, ONLY SUITABLE FOR BUG HUNTING!!
- ##
- ##
- @@ -54,8 +54,8 @@ $ (set -x ; cd / && tar -tf ~/download/msnfs41client_cygwin_binaries_git148e927_
- ##
- # Run the NFSv4 client daemon:
- -# - run this preferably as "Adminstrator", but this is not a requirement
- -# - requires seperate terminal
- +# - run this preferably as "Administrator", but this is not a requirement
- +# - requires separate terminal
- $ /sbin/msnfs41client run_daemon
- # Mount a filesystem and use it
- @@ -108,7 +108,7 @@ $ net use N: /delete
- $ 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
- +- performance: All binaries are build without any optimisation, so
- the filesystem is much slower than it could be.
- - bad performance due to Windows Defender AntiVirus:
- @@ -118,12 +118,12 @@ $ net use N: /delete
- 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.
- + and other offending commands to the 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
- + Linux require the nfs4_getfacl/nfs4_setfacl utilities to see the
- data.
- Example (assuming that Windows, Linux NFSv4 client and NFSv4
- server have a user "siegfried_wulsch"):
- @@ -140,7 +140,7 @@ $ net use N: /delete
- - nfs_mount only works when the NFSv4 server allows connections from
- ports >= 1024, as Windows does not allow the Windows NFSv4 client
- - to use a "priviledged port" (i.e. TCP port number < 1024)).
- + to use a "privileged port" (i.e. TCP port number < 1024)).
- By default the NFSv4 server on Solaris, Illumos, Linux
- etc. only accepts connections if the NFSv4 client uses a "privileged
- (TCP) port", i.e. a port number < 1024.
- @@ -157,7 +157,7 @@ $ net use N: /delete
- - 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
- +- Attribute caching is too aggressive, 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,
- --
- 2.43.0
- From aca985b01a6a6a0c805f1513af4d422f7d84785f Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 19 Jan 2024 18:34:55 +0100
- Subject: [PATCH 5/7] daemon, libtirpc: Use |WaitForSingleObjectEx()| for
- threads+check return code
- Use |WaitForSingleObjectEx(..., ..., FALSE)| innstead of
- |WaitForSingleObject()| to wait for threads and check the status
- return code.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/nfs41_rpc.c | 4 ++--
- daemon/nfs41_session.c | 5 ++++-
- daemon/util.c | 3 ++-
- libtirpc/src/clnt_vc.c | 3 ++-
- 4 files changed, 10 insertions(+), 5 deletions(-)
- diff --git a/daemon/nfs41_rpc.c b/daemon/nfs41_rpc.c
- index adbb9f1..3c11e9b 100644
- --- a/daemon/nfs41_rpc.c
- +++ b/daemon/nfs41_rpc.c
- @@ -368,9 +368,9 @@ int nfs41_send_compound(
- if (rpc_should_retry(rpc, version))
- goto try_again;
- while (rpc_renew_in_progress(rpc, NULL)) {
- - status = WaitForSingleObject(rpc->cond, INFINITE);
- + status = WaitForSingleObjectEx(rpc->cond, INFINITE, FALSE);
- if (status != WAIT_OBJECT_0) {
- - dprintf(1, "rpc_renew_in_progress: WaitForSingleObject failed\n");
- + dprintf(0, "rpc_renew_in_progress: WaitForSingleObjectEx() failed\n");
- print_condwait_status(1, status);
- status = ERROR_LOCK_VIOLATION;
- goto out;
- diff --git a/daemon/nfs41_session.c b/daemon/nfs41_session.c
- index 698b29f..6411de2 100644
- --- a/daemon/nfs41_session.c
- +++ b/daemon/nfs41_session.c
- @@ -370,14 +370,17 @@ static
- void cancel_renew_thread(
- IN nfs41_session *session)
- {
- + DWORD status;
- +
- dprintf(1, "cancel_renew_thread(session=%p): "
- "signal thread to exit\n", session);
- (void)SetEvent(session->renew.cancel_event);
- dprintf(1, "cancel_renew_thread(session=%p): "
- "waiting for thread to exit\n", session);
- - (void)WaitForSingleObjectEx(session->renew.thread_handle,
- + status = WaitForSingleObjectEx(session->renew.thread_handle,
- INFINITE, FALSE);
- + EASSERT(status == WAIT_OBJECT_0);
- dprintf(1, "cancel_renew_thread(session=%p): thread done\n",
- session);
- diff --git a/daemon/util.c b/daemon/util.c
- index 4094889..95e0d7f 100644
- --- a/daemon/util.c
- +++ b/daemon/util.c
- @@ -556,7 +556,8 @@ int subcmd_pclose(subcmd_popen_context *pinfo)
- /* Close the read handle to the pipe from the child process */
- CloseHandle(pinfo->hReadPipe);
- - WaitForSingleObject(pinfo->pi.hProcess, INFINITE);
- + status = WaitForSingleObjectEx(pinfo->pi.hProcess, INFINITE, FALSE);
- + EASSERT(status == WAIT_OBJECT_0);
- if (!GetExitCodeProcess(pinfo->pi.hProcess, &status)) {
- status = -1;
- diff --git a/libtirpc/src/clnt_vc.c b/libtirpc/src/clnt_vc.c
- index 3fdc1ef..843fd93 100644
- --- a/libtirpc/src/clnt_vc.c
- +++ b/libtirpc/src/clnt_vc.c
- @@ -927,7 +927,8 @@ clnt_vc_destroy(cl)
- cl->shutdown = 1;
- cond_signal(&vc_cv[ct_fd]);
- mutex_unlock(&clnt_fd_lock);
- - status = WaitForSingleObject(cl->cb_thread, INFINITE);
- + status = WaitForSingleObjectEx(cl->cb_thread, INFINITE, FALSE);
- + assert(status == WAIT_OBJECT_0);
- fprintf(stdout, "%04lx: terminated callback thread\n", (long)GetCurrentThreadId());
- mutex_lock(&clnt_fd_lock);
- while (vc_fd_locks[ct_fd])
- --
- 2.43.0
- From 6e417a1f7d520deac82121d1b5ef45fbdba37936 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 20 Jan 2024 10:23:26 +0100
- Subject: [PATCH 6/7] testing: Update ksh93 to 1.0.8
- Update ksh93/shcomp from 1.0.7 to 1.0.8
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/manual_testing.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
- index 6de2508..9d33d90 100644
- --- a/tests/manual_testing.txt
- +++ b/tests/manual_testing.txt
- @@ -24,7 +24,7 @@
- #
- # ksh93 (ast-ksh)
- #
- -git clone -b 'v1.0.7' https://github.com/ksh93/ksh.git
- +git clone -b 'v1.0.8' https://github.com/ksh93/ksh.git
- cd ksh
- git config --global --add safe.directory "$PWD"
- sed -i -r 's/mkfifo.+?(-m [[:digit:]]+)/mkfifo /g' ./src/cmd/INIT/package.sh ./bin/package
- --
- 2.43.0
- From ca7d67b64bfc3a9c70ddcd05e5c5803af9f49643 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 20 Jan 2024 13:41:47 +0100
- Subject: [PATCH 7/7] cygwin: Update cygwin tarball readme with bugs and
- troubleshooting info
- Update Cygwin binary tarball readme with info about known bugs
- and add troubleshooting section.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/README.bintarball.txt | 58 ++++++++++++++++++++++++++++++++++--
- 1 file changed, 56 insertions(+), 2 deletions(-)
- diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
- index a71cb05..532fc48 100644
- --- a/cygwin/README.bintarball.txt
- +++ b/cygwin/README.bintarball.txt
- @@ -148,31 +148,85 @@ $ net use N: /delete
- Linux /etc/exports, which allows connections from ports >= 1024,
- and for Solaris/Illumos see nfs(5), option "resvport".
- +
- #
- # 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 too aggressive, making $ tail -f ... # not seeing
- - new data.
- +
- +- Attribute caching is too aggressive
- +
- +- Caching in the kernel does not always work. For example
- + $ tail -f ... # does not not see new data.
- Workaround: Use GNU tail'S $ tail --follow=name ... #
- + Working theory is that this is related to FCB caching, see
- + |FCB_STATE_FILESIZECACHEING_ENABLED|, as the nfs41_driver.sys
- + kernel module does not see the |stat()| syscalls. But $ tail -f ... #
- + always works for a momemnt if something else opens the same file.
- +
- +- Unmounting and then mounting the same filesystem causes issues
- + as the name cache in nfsd*.exe is not flushed on umount, including
- + leftover delegations.
- +
- - 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.
- +
- +#
- +# Notes for troubleshooting && finding bugs/debugging:
- +#
- +- nfsd_debug.exe has the -d option to set a level for debug
- + output.
- + Edit /sbin/msnfs41client to set the "-d" option.
- +
- +- The "msnfs41client" script has the option "watch_kernel_debuglog"
- + to get the debug output of the kernel module.
- +
- + Run as Admin: $ /sbin/msnfs41client watch_kernel_debuglog #
- +
- + Currently requires DebugView
- + (https://learn.microsoft.com/en-gb/sysinternals/downloads/debugview)
- + to be installed.
- +
- +- Watching network traffic:
- + WireShark has a command line tool called "tshark", which can be used
- + to see NFSv4 traffic. As NFSv4 uses RPC you have to filter for RPC,
- + and the RPC filter automatically identifies NFSv4 traffic on it's RPC
- + id.
- + Example for Windows:
- + (for NFSv4 default TCP port "2049", replace "2049" with the
- + desired port if you use a custom port ; use "ipconfig" to find the
- + correct interface name, in this case "Ethernet0"):
- + ---- snip ----
- + $ nfsv4port=2049 ; /cygdrive/c/Program\ Files/Wireshark/tshark \
- + -f "port $nfsv4port" -d "tcp.port==${nfsv4port},rpc" -i Ethernet0
- + ---- snip ----
- +
- + If you are running inside a VMware VM on a Linux host it
- + might require $ chmod a+rw /dev/vmnet0 # on VMware host, so that
- + the VM can use "Promiscuous Mode".
- +
- # EOF.
- --
- 2.43.0
backup patches 2024-01-20
Posted by Anonymous on Sat 20th Jan 2024 13:01
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.