- From 0a6bddb64c664dc0cbeb30dc2e3c1f41c342b59c Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 19 Feb 2025 13:03:57 +0100
- Subject: [PATCH 1/6] cygwin,mount: nfs_mount.exe should not output UTF-16
- nfs_mount.exe should not output UTF-16 - this breaks shell scripts
- and other applications which want to parse the output.
- Instead we now use |_setmode(_fileno(stdout), _O_U8TEXT);|, which seems
- to work for mount points with Japanse characters.
- Reported-by: Lionel Cons <lionelcons1972@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/utils/mount_sshnfs/mount_sshnfs.ksh | 22 ++++------------------
- mount/mount.c | 15 ++++++++++-----
- 2 files changed, 14 insertions(+), 23 deletions(-)
- diff --git a/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh b/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
- index 2426b5f..227f29f 100644
- --- a/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
- +++ b/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
- @@ -422,7 +422,7 @@ function cmd_mount
- # fixme: Need better text layout for $ mount_sshnfs mount --man #
- typeset -r mount_sshnfs_cmdmount_usage=$'+
- - [-?\n@(#)\$Id: mount_sshnfs mount (Roland Mainz) 2025-02-17 \$\n]
- + [-?\n@(#)\$Id: mount_sshnfs mount (Roland Mainz) 2025-02-19 \$\n]
- [-author?Roland Mainz <roland.mainz@nrubsig.org>]
- [+NAME?mount_sshnfs mount - mount NFSv4 filesystem through ssh
- tunnel]
- @@ -692,21 +692,7 @@ function cmd_mount
- # fixme: we should set LC_ALL=C because below we depend on
- # a l10n message
- - if false ; then
- - stdout="${ "${c.msnfsv41_nfsmountcmd}" "${mount_args[@]}" ; (( retval=$? )) ;}"
- - else
- - #
- - # FIXME: workaround for Cygwin 3.6 issue that
- - # stdout="${ cmd ; }" only reads the first character
- - # Observed with ksh93u+m/1.0.10 2024-08-01+Cygwin
- - # 3.6.0-0.374.g4dd859d01c22.x86_64
- - #
- - typeset tmpfilename="$(mktemp '/tmp/mount_sshnfs_XXXXXXXXXX.tmp')"
- -
- - "${c.msnfsv41_nfsmountcmd}" "${mount_args[@]}" >"${tmpfilename}" ; (( retval=$? ))
- - IFS='' read stdout <"${tmpfilename}"
- - rm -f -- "${tmpfilename}"
- - fi
- + stdout="${ "${c.msnfsv41_nfsmountcmd}" "${mount_args[@]}" ; (( retval=$? )) ;}"
- cat <<<"$stdout"
- @@ -807,7 +793,7 @@ function cmd_umount
- typeset mydebug=false # fixme: should be "bool" for ksh93v
- # fixme: Need better text layout for $ mount_sshnfs mount --man #
- typeset -r mount_sshnfs_cmdumount_usage=$'+
- - [-?\n@(#)\$Id: mount_sshnfs umount (Roland Mainz) 2025-02-17 \$\n]
- + [-?\n@(#)\$Id: mount_sshnfs umount (Roland Mainz) 2025-02-19 \$\n]
- [-author?Roland Mainz <roland.mainz@nrubsig.org>]
- [+NAME?mount_sshnfs umount - unmount NFSv4 filesystem mounted
- via mount_sshnfs mount]
- @@ -911,7 +897,7 @@ function main
- # fixme: Need better text layout for $ mount_sshnfs --man #
- typeset -r mount_sshnfs_usage=$'+
- - [-?\n@(#)\$Id: mount_sshnfs (Roland Mainz) 2025-02-17 \$\n]
- + [-?\n@(#)\$Id: mount_sshnfs (Roland Mainz) 2025-02-19 \$\n]
- [-author?Roland Mainz <roland.mainz@nrubsig.org>]
- [+NAME?mount_sshnfs - mount/umount NFSv4 filesystem via ssh
- tunnel]
- diff --git a/mount/mount.c b/mount/mount.c
- index 2ebf8e5..c3d0487 100644
- --- a/mount/mount.c
- +++ b/mount/mount.c
- @@ -653,14 +653,19 @@ int __cdecl wmain(int argc, wchar_t *argv[])
- (void)setlocale(LC_ALL, "");
- /*
- - * |_O_WTEXT| - set streams to wide-char mode so we print
- + * |_O_U8TEXT| - set streams to UTF-8 mode so we print
- * non-ASCII characters like Japanese or Chinese/GB18030
- * correctly.
- - * Note that in CRT/UCRT any attempt to use single-byte
- - * functions like |printf()| will trigger an exception
- + * Notes:
- + * 1. in CRT/UCRT any attempt to use single-byte
- + * functions like |printf()| with |_O_U8TEXT| or |_O_WTEXT|
- + * will trigger an exception
- + * 2. |_O_WTEXT| cannot be used here, because then
- + * stdout will contain UTF-16LE characters, which will break
- + * bash x=$(nfs_mount.exe)
- */
- - (void)_setmode(_fileno(stdout), _O_WTEXT);
- - (void)_setmode(_fileno(stderr), _O_WTEXT);
- + (void)_setmode(_fileno(stdout), _O_U8TEXT);
- + (void)_setmode(_fileno(stderr), _O_U8TEXT);
- crtsetdbgflags |= _CRTDBG_ALLOC_MEM_DF; /* use debug heap */
- crtsetdbgflags |= _CRTDBG_LEAK_CHECK_DF; /* report leaks on exit */
- --
- 2.45.1
- From f25f7cd5b523b5e86bfaa9ed54d4cca4106a563d Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 19 Feb 2025 14:29:42 +0100
- Subject: [PATCH 2/6] tests: Add ACL copy/cloning via icacls&xcopy /O tests
- dd ACL copy/cloning via icacls&xcopy /O tests
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/manual_testing.txt | 23 +++++++++++++++++++++++
- 1 file changed, 23 insertions(+)
- diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
- index 230da79..ea321e2 100644
- --- a/tests/manual_testing.txt
- +++ b/tests/manual_testing.txt
- @@ -302,6 +302,29 @@ or one-liner:
- ksh93 -c 'rm -f test1.txt ; touch test1.txt ; icacls test1.txt /grant:r "cygwingrp1:(WDAC)" /grant:r "cygwingrp2:(WDAC)" /t /c ; getfacl test1.txt | grep -C 20 --colour -E "cygwingrp[12]"'
- -------- snip --------
- +Same test with xcopy /O (requires SeBackupPrivilege/SeRestorePrivilege):
- +-------- snip --------
- +# cd to a NFS >= v4.1 filesystem
- +# getfact output should contain both "cygwingrp1" and "cygwingrp2"
- +ksh93 -c 'rm -f test1.txt subdir1/test1.txt ; touch test1.txt ; icacls test1.txt /grant:r "cygwingrp1:(WDAC)" /grant:r "cygwingrp2:(WDAC)" /t /c ; xcopy /O /I test1.txt "subdir1\\" ; getfacl subdir1/test1.txt | grep -C 20 --colour -E "cygwingrp[12]"'
- +-------- snip --------
- +
- +Same test with icacls /save+/restore (requires SeBackupPrivilege/SeRestorePrivilege):
- +-------- snip --------
- +# * Test: Copy ACL from "test1.txt" to "test2.txt"
- +# * Expected result: getfacl output should contain both "cygwingrp1" and "cygwingrp2"
- +# * Description:
- +# 1. save ACL data of "test1.txt" to "aclspec.icacls"
- +# 2. replace the filename "test1.txt" with "test2.txt" in
- +# "aclspec.icacls" and save the resulting data as
- +# "aclspec2.icacls"
- +# 3. use $ icacls . /restore aclspec2.icacls # to set
- +# the ACL on "test2.txt"
- +# * Usage:
- +# cd to a NFS >= v4.1 filesystem and execute the one-liner below:
- +ksh93 -c 'rm -f test1.txt test2.txt aclspec.icacls aclspec2.icacls ; touch test1.txt ; touch test2.txt ; icacls test1.txt /grant:r "cygwingrp1:(WDAC)" /grant:r "cygwingrp2:(WDAC)" /t /c ; icacls test1.txt /save aclspec.icacls ; iconv -f UTF16LE -t UTF-8 <aclspec.icacls | { IFS="" read fname ; IFS="" read aclstr ; } ; printf "test2.txt\r\n%s\n" "$aclstr" | iconv -f UTF-8 -t UTF16LE >aclspec2.icacls ; icacls . /restore aclspec2.icacls ; getfacl test2.txt | grep -C 20 --colour -E "cygwingrp[12]"'
- +-------- snip --------
- +
- #
- # Test for "Generic Write" ACL:
- #
- --
- 2.45.1
- From f5faffb2feb6ad389b610370dd91f3222a5d2ec3 Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Wed, 19 Feb 2025 14:55:06 +0100
- Subject: [PATCH 3/6] daemon,include,mount,sys: Cleanup #ifndef HDR/#define HDR
- 1/#endif /* !HDR */ include guards
- Cleanup #ifndef HDR/#define HDR 1/#endif /* !HDR */ include guards
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/daemon_debug.h | 4 ++--
- daemon/delegation.h | 4 ++--
- daemon/idmap.h | 2 +-
- daemon/list.h | 2 +-
- daemon/name_cache.h | 2 +-
- daemon/nfs41.h | 4 ++--
- daemon/nfs41_callback.h | 2 +-
- daemon/nfs41_compound.h | 4 ++--
- daemon/nfs41_const.h | 2 +-
- daemon/nfs41_ops.h | 4 +---
- daemon/nfs41_types.h | 2 +-
- daemon/nfs41_xdr.h | 2 +-
- daemon/pnfs.h | 2 +-
- daemon/recovery.h | 4 ++--
- daemon/service.h | 4 ++--
- daemon/tree.h | 4 ++--
- daemon/upcall.h | 2 +-
- daemon/util.h | 2 +-
- include/from_kernel.h | 8 ++++----
- include/nfs41_driver.h | 3 ++-
- mount/options.h | 2 +-
- mount/urlparser1.h | 2 +-
- sys/nfs41sys_driver.h | 1 +
- sys/wmlkm.h | 2 +-
- 24 files changed, 35 insertions(+), 35 deletions(-)
- diff --git a/daemon/daemon_debug.h b/daemon/daemon_debug.h
- index fd0f7b7..ae609d8 100644
- --- a/daemon/daemon_debug.h
- +++ b/daemon/daemon_debug.h
- @@ -21,7 +21,7 @@
- */
- #ifndef _DAEMON_DEBUG_
- -#define _DAEMON_DEBUG_
- +#define _DAEMON_DEBUG_ 1
- #ifdef _DEBUG
- /* use visual studio's debug heap */
- @@ -180,4 +180,4 @@ void debug_delayed_free(void *in_ptr);
- typedef struct _FILE_FULL_EA_INFORMATION FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
- void debug_print_ea(PFILE_FULL_EA_INFORMATION ea);
- -#endif
- +#endif /* !_DAEMON_DEBUG_ */
- diff --git a/daemon/delegation.h b/daemon/delegation.h
- index 517dc32..25235b4 100644
- --- a/daemon/delegation.h
- +++ b/daemon/delegation.h
- @@ -20,7 +20,7 @@
- */
- #ifndef DELEGATION_H
- -#define DELEGATION_H
- +#define DELEGATION_H 1
- #include "nfs41.h"
- @@ -106,4 +106,4 @@ int nfs41_client_delegation_recovery(
- int nfs41_client_delegation_return_lru(
- IN nfs41_client *client);
- -#endif /* DELEGATION_H */
- +#endif /* !DELEGATION_H */
- diff --git a/daemon/idmap.h b/daemon/idmap.h
- index 4c42496..0e99bed 100644
- --- a/daemon/idmap.h
- +++ b/daemon/idmap.h
- @@ -21,7 +21,7 @@
- */
- #ifndef IDMAP_H
- -#define IDMAP_H
- +#define IDMAP_H 1
- #include "nfs41_types.h"
- diff --git a/daemon/list.h b/daemon/list.h
- index 5159b0d..26a4301 100644
- --- a/daemon/list.h
- +++ b/daemon/list.h
- @@ -20,7 +20,7 @@
- */
- #ifndef NFS41_LIST_H
- -#define NFS41_LIST_H
- +#define NFS41_LIST_H 1
- /* doubly-linked list */
- diff --git a/daemon/name_cache.h b/daemon/name_cache.h
- index fbea8c5..c224bf8 100644
- --- a/daemon/name_cache.h
- +++ b/daemon/name_cache.h
- @@ -20,7 +20,7 @@
- */
- #ifndef __NFS41_DAEMON_NAME_CACHE_H__
- -#define __NFS41_DAEMON_NAME_CACHE_H__
- +#define __NFS41_DAEMON_NAME_CACHE_H__ 1
- #include "nfs41.h"
- diff --git a/daemon/nfs41.h b/daemon/nfs41.h
- index da161b0..65d0e18 100644
- --- a/daemon/nfs41.h
- +++ b/daemon/nfs41.h
- @@ -22,7 +22,7 @@
- */
- #ifndef __NFS41__
- -#define __NFS41__
- +#define __NFS41__ 1
- #include <stdbool.h>
- #include "util.h"
- @@ -570,4 +570,4 @@ int nfs41_ea_set(
- IN nfs41_open_state *state,
- IN struct _FILE_FULL_EA_INFORMATION *ea);
- -#endif /* __NFS41__ */
- +#endif /* !__NFS41__ */
- diff --git a/daemon/nfs41_callback.h b/daemon/nfs41_callback.h
- index 0ccd912..2b04955 100644
- --- a/daemon/nfs41_callback.h
- +++ b/daemon/nfs41_callback.h
- @@ -20,7 +20,7 @@
- */
- #ifndef __NFS41_CALLBACK_H__
- -#define __NFS41_CALLBACK_H__
- +#define __NFS41_CALLBACK_H__ 1
- #include "wintirpc.h"
- #include "rpc/rpc.h"
- diff --git a/daemon/nfs41_compound.h b/daemon/nfs41_compound.h
- index b6af292..a4b5495 100644
- --- a/daemon/nfs41_compound.h
- +++ b/daemon/nfs41_compound.h
- @@ -20,7 +20,7 @@
- */
- #ifndef __NFS41_DAEMON_COMPOUND_H__
- -#define __NFS41_DAEMON_COMPOUND_H__
- +#define __NFS41_DAEMON_COMPOUND_H__ 1
- #include "nfs41.h"
- @@ -78,4 +78,4 @@ int compound_encode_send_decode(
- nfs41_compound *compound,
- bool_t try_recovery);
- -#endif /* __NFS41_DAEMON_COMPOUND_H__ */
- +#endif /* !__NFS41_DAEMON_COMPOUND_H__ */
- diff --git a/daemon/nfs41_const.h b/daemon/nfs41_const.h
- index f36ee6c..0612913 100644
- --- a/daemon/nfs41_const.h
- +++ b/daemon/nfs41_const.h
- @@ -21,7 +21,7 @@
- */
- #ifndef __NFS41_NFS_CONST_H__
- -#define __NFS41_NFS_CONST_H__
- +#define __NFS41_NFS_CONST_H__ 1
- /*
- diff --git a/daemon/nfs41_ops.h b/daemon/nfs41_ops.h
- index bdb07a9..efd162b 100644
- --- a/daemon/nfs41_ops.h
- +++ b/daemon/nfs41_ops.h
- @@ -22,7 +22,7 @@
- */
- #ifndef __NFS41_NFS_OPS_H__
- -#define __NFS41_NFS_OPS_H__
- +#define __NFS41_NFS_OPS_H__ 1
- #include "nfs41.h"
- #include "pnfs.h"
- @@ -810,7 +810,6 @@ typedef struct __nfs42_deallocate_res {
- uint32_t status;
- } nfs42_deallocate_res;
- -#if 1
- /* OP_SEEK */
- typedef struct __nfs42_seek_args {
- stateid_arg *stateid; /* -> nfs41_op_open_res_ok.stateid */
- @@ -828,7 +827,6 @@ typedef struct __nfs42_seek_res {
- /* case NFS4_OK: */
- nfs42_seek_res_ok resok4;
- } nfs42_seek_res;
- -#endif
- /* OP_READDIR */
- typedef struct __nfs41_readdir_args {
- diff --git a/daemon/nfs41_types.h b/daemon/nfs41_types.h
- index c08332c..948beea 100644
- --- a/daemon/nfs41_types.h
- +++ b/daemon/nfs41_types.h
- @@ -21,7 +21,7 @@
- */
- #ifndef __NFS41_DAEMON_TYPES_H__
- -#define __NFS41_DAEMON_TYPES_H__
- +#define __NFS41_DAEMON_TYPES_H__ 1
- #include "wintirpc.h"
- #include "rpc/xdr.h"
- diff --git a/daemon/nfs41_xdr.h b/daemon/nfs41_xdr.h
- index d89548c..09cac97 100644
- --- a/daemon/nfs41_xdr.h
- +++ b/daemon/nfs41_xdr.h
- @@ -22,7 +22,7 @@
- */
- #ifndef __NFS41_NFS_XDR_H__
- -#define __NFS41_NFS_XDR_H__
- +#define __NFS41_NFS_XDR_H__ 1
- #include "nfs41_types.h"
- #include "nfs41_compound.h"
- diff --git a/daemon/pnfs.h b/daemon/pnfs.h
- index a63fac0..30f00ec 100644
- --- a/daemon/pnfs.h
- +++ b/daemon/pnfs.h
- @@ -20,7 +20,7 @@
- */
- #ifndef __PNFS_H__
- -#define __PNFS_H__
- +#define __PNFS_H__ 1
- #include "nfs41_types.h"
- #include "list.h"
- diff --git a/daemon/recovery.h b/daemon/recovery.h
- index b16044e..006a08f 100644
- --- a/daemon/recovery.h
- +++ b/daemon/recovery.h
- @@ -20,7 +20,7 @@
- */
- #ifndef RECOVERY_H
- -#define RECOVERY_H
- +#define RECOVERY_H 1
- #include "nfs41.h"
- @@ -56,4 +56,4 @@ bool_t nfs41_recover_stateid(
- IN nfs41_session *session,
- IN struct __nfs_argop4 *argop);
- -#endif /* RECOVERY_H */
- +#endif /* !RECOVERY_H */
- diff --git a/daemon/service.h b/daemon/service.h
- index 2fa3a7b..dab82df 100644
- --- a/daemon/service.h
- +++ b/daemon/service.h
- @@ -50,7 +50,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
- ------------------------------------------------------------------------------*/
- #ifndef _SERVICE_H
- -#define _SERVICE_H
- +#define _SERVICE_H 1
- #ifdef __cplusplus
- @@ -134,4 +134,4 @@ extern "C" {
- }
- #endif
- -#endif
- +#endif /* !_SERVICE_H */
- diff --git a/daemon/tree.h b/daemon/tree.h
- index 2cd61a2..1083117 100644
- --- a/daemon/tree.h
- +++ b/daemon/tree.h
- @@ -28,7 +28,7 @@
- */
- #ifndef _SYS_TREE_H_
- -#define _SYS_TREE_H_
- +#define _SYS_TREE_H_ 1
- //#include <sys/cdefs.h>
- @@ -762,4 +762,4 @@ name##_RB_MINMAX(struct name *head, int val) \
- ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \
- (x) = (y))
- -#endif /* _SYS_TREE_H_ */
- +#endif /* !_SYS_TREE_H_ */
- diff --git a/daemon/upcall.h b/daemon/upcall.h
- index 94f830c..abf53ad 100644
- --- a/daemon/upcall.h
- +++ b/daemon/upcall.h
- @@ -22,7 +22,7 @@
- */
- #ifndef __NFS41_DAEMON_UPCALL_H__
- -#define __NFS41_DAEMON_UPCALL_H__
- +#define __NFS41_DAEMON_UPCALL_H__ 1
- #include "nfs41_build_features.h"
- #include "nfs41_ops.h"
- diff --git a/daemon/util.h b/daemon/util.h
- index 45e1b68..03f6ca4 100644
- --- a/daemon/util.h
- +++ b/daemon/util.h
- @@ -22,7 +22,7 @@
- */
- #ifndef __NFS41_DAEMON_UTIL_H__
- -#define __NFS41_DAEMON_UTIL_H__
- +#define __NFS41_DAEMON_UTIL_H__ 1
- #include <stdlib.h>
- #include <stdbool.h>
- diff --git a/include/from_kernel.h b/include/from_kernel.h
- index 7a9c47a..962ceef 100644
- --- a/include/from_kernel.h
- +++ b/include/from_kernel.h
- @@ -21,8 +21,8 @@
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- */
- -#ifndef _NFS41_DAEMON_
- -#define _NFS41_DAEMON_
- +#ifndef _NFS41_FROM_KERNEL_
- +#define _NFS41_FROM_KERNEL_ 1
- #define FILE_DIRECTORY_FILE 0x00000001
- #define FILE_WRITE_THROUGH 0x00000002
- @@ -450,7 +450,7 @@ typedef struct _FILE_ALLOCATED_RANGE_BUFFER {
- LARGE_INTEGER FileOffset;
- LARGE_INTEGER Length;
- } FILE_ALLOCATED_RANGE_BUFFER, *PFILE_ALLOCATED_RANGE_BUFFER;
- -#endif /* _WINIOCTL_ */
- +#endif /* !_WINIOCTL_ */
- /*
- * |FILE_ZERO_DATA_INFORMATION| - test for
- @@ -464,4 +464,4 @@ typedef struct _FILE_ZERO_DATA_INFORMATION {
- } FILE_ZERO_DATA_INFORMATION, *PFILE_ZERO_DATA_INFORMATION;
- #endif /* !_WINIOCTL_ */
- -#endif
- +#endif /* !_NFS41_FROM_KERNEL_ */
- diff --git a/include/nfs41_driver.h b/include/nfs41_driver.h
- index 37b3141..6dce9d9 100644
- --- a/include/nfs41_driver.h
- +++ b/include/nfs41_driver.h
- @@ -137,4 +137,5 @@ typedef enum _nfs41_start_driver_state {
- */
- #define ERROR_NFS_VERSION_MISMATCH ERROR_REMOTE_FILE_VERSION_MISMATCH
- #define STATUS_NFS_VERSION_MISMATCH STATUS_REMOTE_FILE_VERSION_MISMATCH
- -#endif
- +
- +#endif /* !_NFS41_DRIVER_ */
- diff --git a/mount/options.h b/mount/options.h
- index 0f2cc5f..88b117d 100644
- --- a/mount/options.h
- +++ b/mount/options.h
- @@ -21,7 +21,7 @@
- */
- #ifndef __NFS41_MOUNT_OPTIONS_H__
- -#define __NFS41_MOUNT_OPTIONS_H__
- +#define __NFS41_MOUNT_OPTIONS_H__ 1
- #define MOUNT_OPTION_BUFFER_SECRET ('n4')
- diff --git a/mount/urlparser1.h b/mount/urlparser1.h
- index 451f28c..c6f7cc9 100644
- --- a/mount/urlparser1.h
- +++ b/mount/urlparser1.h
- @@ -25,7 +25,7 @@
- /* urlparser1.h - header for simple URL parser */
- #ifndef __URLPARSER1_H__
- -#define __URLPARSER1_H__
- +#define __URLPARSER1_H__ 1
- #include <stdlib.h>
- diff --git a/sys/nfs41sys_driver.h b/sys/nfs41sys_driver.h
- index f14d33d..65884ca 100644
- --- a/sys/nfs41sys_driver.h
- +++ b/sys/nfs41sys_driver.h
- @@ -28,6 +28,7 @@
- #if ((__STDC_VERSION__-0) < 201710L)
- #error Code requires ISO C17
- #endif
- +
- #ifndef _NFS41SYS_DRIVER_H_
- #define _NFS41SYS_DRIVER_H_ 1
- diff --git a/sys/wmlkm.h b/sys/wmlkm.h
- index cb42710..d279414 100644
- --- a/sys/wmlkm.h
- +++ b/sys/wmlkm.h
- @@ -45,5 +45,5 @@ WmlTrace(
- };
- #endif
- -#endif // NFS41_WMLKM_H
- +#endif /* !NFS41_WMLKM_H */
- --
- 2.45.1
- From bc3c6ef7c85c7cfb3fcdfbb2832f8953857e9e05 Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Wed, 19 Feb 2025 14:59:39 +0100
- Subject: [PATCH 4/6] libtirpc: Fix typo in "cb: possible deadlock" warning
- Fix typo in "cb: possible deadlock" warning
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- libtirpc/src/clnt_vc.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- diff --git a/libtirpc/src/clnt_vc.c b/libtirpc/src/clnt_vc.c
- index 70f3c15..ce431ce 100644
- --- a/libtirpc/src/clnt_vc.c
- +++ b/libtirpc/src/clnt_vc.c
- @@ -259,7 +259,7 @@ loop_restart:
- if (cond_wait_timed_fails++ > 2) {
- mutex_unlock(&clnt_fd_lock);
- (void)fprintf(stdout,
- - "%04lx: cb: possible deadlockm, lasterr=%d\n",
- + "%04lx: cb: possible deadlock, lasterr=%d\n",
- (long)GetCurrentThreadId(), (int)lasterr);
- goto loop_restart;
- }
- --
- 2.45.1
- From c57463d38c2ce1e81e62494e90723e3d32ac3f47 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 19 Feb 2025 16:32:40 +0100
- Subject: [PATCH 5/6] tests: testsparsefile1.ksh should work on C: drive too
- testsparsefile1.ksh should work on C: drive too
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/sparsefiles/testsparsefile1.ksh | 11 ++++++++---
- 1 file changed, 8 insertions(+), 3 deletions(-)
- diff --git a/tests/sparsefiles/testsparsefile1.ksh b/tests/sparsefiles/testsparsefile1.ksh
- index fa0eef5..0d9d015 100644
- --- a/tests/sparsefiles/testsparsefile1.ksh
- +++ b/tests/sparsefiles/testsparsefile1.ksh
- @@ -38,7 +38,8 @@ function test_sparse_holeonly
- #set -o xtrace
- rm -f 'sparse_file_hole_only'
- - dd if='/dev/null' of='sparse_file_hole_only' bs=1 count=1 seek=$((65536*1024))
- + dd if='/dev/null' of='sparse_file_hole_only' bs=1 count=0 seek=$((65536*1024))
- + chattr -V +S 'sparse_file_hole_only'
- ls -l 'sparse_file_hole_only'
- /cygdrive/c/Windows/system32/fsutil sparse queryrange 'sparse_file_hole_only'
- @@ -70,6 +71,7 @@ function test_normal_file
- rm -f 'test_normal_file'
- dd if='/dev/zero' of='test_normal_file' bs=1024 count=1024
- + chattr -V +S 'test_normal_file'
- ls -l 'test_normal_file'
- /cygdrive/c/Windows/system32/fsutil sparse queryrange 'test_normal_file'
- @@ -124,6 +126,7 @@ function test_multihole_sparsefile1
- #
- rm -f 'mysparsefile'
- printf '' >'mysparsefile' # trunc
- + chattr -V +S 'mysparsefile'
- for i in ${!c.filecontent[@]} ; do
- dd of='mysparsefile' bs=1 conv=notrunc seek=${c.filecontent[$i].pos} status=none <<<"${c.filecontent[$i].data}"
- @@ -180,13 +183,15 @@ function test_sparse_punchhole1
- #set -o xtrace
- rm -f 'sparse_file_punchhole'
- - dd if='/dev/zero' of='sparse_file_punchhole' count=8 bs=$((1024*1024)) status=none
- + touch 'sparse_file_punchhole'
- chattr -V +S 'sparse_file_punchhole'
- + dd if='/dev/zero' of='sparse_file_punchhole' conv=notrunc count=32 bs=$((1024*1024)) status=none
- +
- printf '# expected: one data section before fallocate\n'
- /cygdrive/c/Windows/system32/fsutil sparse queryrange 'sparse_file_punchhole'
- - fallocate -n -p -o $((0x16000)) -l $((0x8000)) 'sparse_file_punchhole'
- + fallocate -n -p -o $((8*1024*1024)) -l $((4*1024*1024)) 'sparse_file_punchhole'
- printf '# expected: two data section after fallocate\n'
- /cygdrive/c/Windows/system32/fsutil sparse queryrange 'sparse_file_punchhole'
- --
- 2.45.1
- From c4c604a02a2729f88c8f4bd315ea72f49ea3a6f1 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 19 Feb 2025 16:39:09 +0100
- Subject: [PATCH 6/6] tests: testsparsefile1.ksh: Add test for
- /usr/bin/truncate
- testsparsefile1.ksh: Add test for /usr/bin/truncate
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/sparsefiles/testsparsefile1.ksh | 41 +++++++++++++++++++++++++--
- 1 file changed, 38 insertions(+), 3 deletions(-)
- diff --git a/tests/sparsefiles/testsparsefile1.ksh b/tests/sparsefiles/testsparsefile1.ksh
- index 0d9d015..293ade9 100644
- --- a/tests/sparsefiles/testsparsefile1.ksh
- +++ b/tests/sparsefiles/testsparsefile1.ksh
- @@ -31,14 +31,14 @@
- #
- -function test_sparse_holeonly
- +function test_sparse_holeonly_dd
- {
- set -o errexit
- set -o nounset
- #set -o xtrace
- rm -f 'sparse_file_hole_only'
- - dd if='/dev/null' of='sparse_file_hole_only' bs=1 count=0 seek=$((65536*1024))
- + dd if='/dev/null' of='sparse_file_hole_only' bs=1 count=0 seek=$((256*1024*1024))
- chattr -V +S 'sparse_file_hole_only'
- ls -l 'sparse_file_hole_only'
- @@ -63,6 +63,40 @@ function test_sparse_holeonly
- return 0
- }
- +function test_sparse_holeonly_truncate
- +{
- + set -o errexit
- + set -o nounset
- + #set -o xtrace
- +
- + rm -f 'sparse_file_hole_only'
- + touch 'sparse_file_hole_only'
- + chattr -V +S 'sparse_file_hole_only'
- +
- + truncate -s $((256*1024*1024)) 'sparse_file_hole_only'
- +
- + ls -l 'sparse_file_hole_only'
- + /cygdrive/c/Windows/system32/fsutil sparse queryrange 'sparse_file_hole_only'
- +
- + integer fsutil_num_data_sections="$(/cygdrive/c/Windows/system32/fsutil sparse queryrange 'sparse_file_hole_only' | wc -l)"
- +
- + #
- + # test whether the file is OK
- + #
- + if (( fsutil_num_data_sections != 0 )) ; then
- + printf "# TEST failed, found %d data sections, expceted %d\n" \
- + fsutil_num_data_sections \
- + 0
- + return 1
- + fi
- +
- + printf "\n#\n# TEST %q OK, found %d data sections\n#\n" \
- + "$0" \
- + fsutil_num_data_sections
- +
- + return 0
- +}
- +
- function test_normal_file
- {
- set -o errexit
- @@ -228,7 +262,8 @@ builtin basename
- builtin rm
- builtin wc
- -test_sparse_holeonly
- +test_sparse_holeonly_dd
- +test_sparse_holeonly_truncate
- test_normal_file
- test_multihole_sparsefile1 1024 0 4 false
- --
- 2.45.1
msnfs41client: Patches for nfs_mount.exe UTF-16LE issue, more tests+cleanup+misc, 2025-02-19
Posted by Anonymous on Wed 19th Feb 2025 15:48
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.