- From a981d7af6516c34e684e2a14d611091d478499fc Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 22 May 2024 12:41:44 +0200
- Subject: [PATCH 01/10] build.vc19: Switch CharacterSet in nfsd.vcxproj to
- Unicode
- Switch CharacterSet in nfsd.vcxproj from "Multibyte" to "Unicode"
- Reported-by: Dan Shelton <dan.f.shelton@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- build.vc19/nfsd/nfsd.vcxproj | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
- diff --git a/build.vc19/nfsd/nfsd.vcxproj b/build.vc19/nfsd/nfsd.vcxproj
- index 32ba21d..5dcc8a8 100644
- --- a/build.vc19/nfsd/nfsd.vcxproj
- +++ b/build.vc19/nfsd/nfsd.vcxproj
- @@ -29,27 +29,27 @@
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v142</PlatformToolset>
- - <CharacterSet>MultiByte</CharacterSet>
- + <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v142</PlatformToolset>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- - <CharacterSet>MultiByte</CharacterSet>
- + <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v142</PlatformToolset>
- - <CharacterSet>MultiByte</CharacterSet>
- + <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v142</PlatformToolset>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- - <CharacterSet>MultiByte</CharacterSet>
- + <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- --
- 2.43.0
- From e597af503f04b223e3b9294154199aaf54d7a064 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 22 May 2024 13:11:18 +0200
- Subject: [PATCH 02/10] build.vc19: Explicitly set "RuntimeLibrary" properly
- Explicitly set "RuntimeLibrary" properly, to avoid picking
- a wrong "default".
- Reported-by: Dan Shelton <dan.f.shelton@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- build.vc19/libtirpc/libtirpc.vcxproj | 4 ++++
- build.vc19/nfs41_np/nfs41_np.vcxproj | 4 ++++
- build.vc19/nfs_install/nfs_install.vcxproj | 4 ++++
- build.vc19/nfs_mount/nfs_mount.vcxproj | 4 ++++
- build.vc19/nfsd/nfsd.vcxproj | 4 ++++
- 5 files changed, 20 insertions(+)
- diff --git a/build.vc19/libtirpc/libtirpc.vcxproj b/build.vc19/libtirpc/libtirpc.vcxproj
- index da272de..f817b6f 100644
- --- a/build.vc19/libtirpc/libtirpc.vcxproj
- +++ b/build.vc19/libtirpc/libtirpc.vcxproj
- @@ -93,6 +93,7 @@
- <StringPooling>true</StringPooling>
- <BasicRuntimeChecks>Default</BasicRuntimeChecks>
- <BufferSecurityCheck>false</BufferSecurityCheck>
- + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- @@ -113,6 +114,7 @@
- <StringPooling>true</StringPooling>
- <BasicRuntimeChecks>Default</BasicRuntimeChecks>
- <BufferSecurityCheck>false</BufferSecurityCheck>
- + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- @@ -134,6 +136,7 @@
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <StringPooling>true</StringPooling>
- <BufferSecurityCheck>false</BufferSecurityCheck>
- + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- @@ -157,6 +160,7 @@
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <StringPooling>true</StringPooling>
- <BufferSecurityCheck>false</BufferSecurityCheck>
- + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- diff --git a/build.vc19/nfs41_np/nfs41_np.vcxproj b/build.vc19/nfs41_np/nfs41_np.vcxproj
- index eb515f0..846ce86 100644
- --- a/build.vc19/nfs41_np/nfs41_np.vcxproj
- +++ b/build.vc19/nfs41_np/nfs41_np.vcxproj
- @@ -90,6 +90,7 @@
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- @@ -106,6 +107,7 @@
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- @@ -124,6 +126,7 @@
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- @@ -144,6 +147,7 @@
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- diff --git a/build.vc19/nfs_install/nfs_install.vcxproj b/build.vc19/nfs_install/nfs_install.vcxproj
- index ab244aa..4ceb221 100644
- --- a/build.vc19/nfs_install/nfs_install.vcxproj
- +++ b/build.vc19/nfs_install/nfs_install.vcxproj
- @@ -90,6 +90,7 @@
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -105,6 +106,7 @@
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -122,6 +124,7 @@
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -141,6 +144,7 @@
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- diff --git a/build.vc19/nfs_mount/nfs_mount.vcxproj b/build.vc19/nfs_mount/nfs_mount.vcxproj
- index b3083da..2e76397 100644
- --- a/build.vc19/nfs_mount/nfs_mount.vcxproj
- +++ b/build.vc19/nfs_mount/nfs_mount.vcxproj
- @@ -90,6 +90,7 @@
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -106,6 +107,7 @@
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -124,6 +126,7 @@
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -144,6 +147,7 @@
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- diff --git a/build.vc19/nfsd/nfsd.vcxproj b/build.vc19/nfsd/nfsd.vcxproj
- index 5dcc8a8..47d4092 100644
- --- a/build.vc19/nfsd/nfsd.vcxproj
- +++ b/build.vc19/nfsd/nfsd.vcxproj
- @@ -93,6 +93,7 @@
- <BasicRuntimeChecks>Default</BasicRuntimeChecks>
- <BufferSecurityCheck>false</BufferSecurityCheck>
- <StringPooling>true</StringPooling>
- + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -112,6 +113,7 @@
- <BasicRuntimeChecks>Default</BasicRuntimeChecks>
- <BufferSecurityCheck>false</BufferSecurityCheck>
- <StringPooling>true</StringPooling>
- + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -132,6 +134,7 @@
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <BufferSecurityCheck>false</BufferSecurityCheck>
- <StringPooling>true</StringPooling>
- + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -154,6 +157,7 @@
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <BufferSecurityCheck>false</BufferSecurityCheck>
- <StringPooling>true</StringPooling>
- + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- --
- 2.43.0
- From 0d08e89e4464c04f7b5c2b476696f841f7bd3da3 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 22 May 2024 14:19:38 +0200
- Subject: [PATCH 03/10] cygwin,tests: Provide both 32bit and 64bit versions of
- winfstest
- Provide both 32bit and 64bit versions of winfstest
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/Makefile.install | 8 +++++++-
- cygwin/README.bintarball.txt | 5 +++++
- tests/manual_testing.txt | 2 ++
- tests/winfsinfo1/Makefile | 16 ++++++++++++----
- tests/winfsinfo1/winfsinfo.c | 9 ++++++---
- 5 files changed, 32 insertions(+), 8 deletions(-)
- diff --git a/cygwin/Makefile.install b/cygwin/Makefile.install
- index 2af63b4..57e6290 100644
- --- a/cygwin/Makefile.install
- +++ b/cygwin/Makefile.install
- @@ -63,7 +63,13 @@ installdest:
- chmod a+x $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/nfsurlconv
- /usr/bin/ksh93 $(CYGWIN_MAKEFILE_DIR)/utils/nfsurlconv/nfsurlconv.ksh --nroff 2>"$(DESTDIR)/$(CYGWIN_BASEPATH)/usr/share/man/man1/nfsurlconv.1" || true
- @ printf "# Package tests\n"
- - cp "$(PROJECT_BASEDIR_DIR)/tests/winfsinfo1/winfsinfo.exe" $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/winfsinfo.exe
- + cp "$(PROJECT_BASEDIR_DIR)/tests/winfsinfo1/winfsinfo.x86_64.exe" $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/winfsinfo.x86_64.exe
- + cp "$(PROJECT_BASEDIR_DIR)/tests/winfsinfo1/winfsinfo.i686.exe" $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/winfsinfo.i686.exe
- + if [[ "$(CYGWIN_BASEPATH)" == *64* ]] ; then \
- + (cd $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/ && ln -sf winfsinfo.x86_64.exe winfsinfo.exe) \
- + else \
- + (cd $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/ && ln -sf winfsinfo.i686.exe winfsinfo.exe) \
- + fi
- @ printf "# Package ksh93&co (if available) since Cygwin does not ship with it yet\n"
- [[ -x $(CYGWIN_BASEPATH)/bin/ksh93.exe ]] && cp $(CYGWIN_BASEPATH)/bin/ksh93.exe $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/ksh93.exe || true
- [[ -x $(CYGWIN_BASEPATH)/bin/shcomp.exe ]] && cp $(CYGWIN_BASEPATH)/bin/shcomp.exe $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/shcomp.exe || true
- diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
- index e91340b..8f50fd0 100644
- --- a/cygwin/README.bintarball.txt
- +++ b/cygwin/README.bintarball.txt
- @@ -100,6 +100,11 @@ NFSv4.1 client and filesystem driver for Windows 10/11
- libnfs (for /usr/bin/nfs-ls)
- make
- git
- + gcc-core
- + gcc-g++
- + clang
- + mingw64-i686-clang
- + mingw64-x86_64-clang
- dos2unix
- unzip
- diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
- index cade142..a5ff0c4 100644
- --- a/tests/manual_testing.txt
- +++ b/tests/manual_testing.txt
- @@ -12,6 +12,8 @@
- # gcc-core
- # gcc-g++
- # clang
- +# mingw64-i686-clang
- +# mingw64-x86_64-clang
- # gdb
- # make
- # netpbm
- diff --git a/tests/winfsinfo1/Makefile b/tests/winfsinfo1/Makefile
- index 91ef665..47ee557 100644
- --- a/tests/winfsinfo1/Makefile
- +++ b/tests/winfsinfo1/Makefile
- @@ -4,12 +4,20 @@
- # POSIX Makefile
- -winfsinfo: winfsinfo.c
- - gcc -Wall -DUNICODE=1 -D_UNICODE=1 -g winfsinfo.c -o winfsinfo
- +all: winfsinfo.i686.exe winfsinfo.x86_64.exe winfsinfo.exe
- -all: winfsinfo
- +winfsinfo.i686.exe: winfsinfo.c
- + clang -target i686-pc-windows-gnu -Wall -DUNICODE=1 -D_UNICODE=1 -g winfsinfo.c -o winfsinfo.i686.exe
- +
- +winfsinfo.x86_64.exe: winfsinfo.c
- + clang -target x86_64-pc-windows-gnu -Wall -DUNICODE=1 -D_UNICODE=1 -g winfsinfo.c -o winfsinfo.x86_64.exe
- +
- +winfsinfo.exe: winfsinfo.x86_64.exe
- + ln -s winfsinfo.x86_64.exe winfsinfo.exe
- clean:
- rm -fv \
- - winfsinfo.exe
- + winfsinfo.i686.exe \
- + winfsinfo.x86_64.exe \
- + winfsinfo.exe \
- # EOF.
- diff --git a/tests/winfsinfo1/winfsinfo.c b/tests/winfsinfo1/winfsinfo.c
- index d0cf0c9..9066056 100644
- --- a/tests/winfsinfo1/winfsinfo.c
- +++ b/tests/winfsinfo1/winfsinfo.c
- @@ -137,7 +137,8 @@ bool get_file_basic_info(const char *progname, const char *filename)
- {
- int res = EXIT_FAILURE;
- bool ok;
- - FILE_BASIC_INFO finfo = { 0 };
- + FILE_BASIC_INFO finfo;
- + (void)memset(&finfo, 0, sizeof(finfo));
- HANDLE fileHandle = CreateFileA(filename,
- GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
- @@ -225,7 +226,8 @@ bool get_file_standard_info(const char *progname, const char *filename)
- {
- int res = EXIT_FAILURE;
- bool ok;
- - FILE_STANDARD_INFO finfo = { 0 };
- + FILE_STANDARD_INFO finfo;
- + (void)memset(&finfo, 0, sizeof(finfo));
- HANDLE fileHandle = CreateFileA(filename,
- GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
- @@ -282,7 +284,8 @@ bool get_filenormalizednameinfo(const char *progname, const char *filename)
- {
- int res = EXIT_FAILURE;
- bool ok;
- - FILE_NAME_INFORMATION4096 finfo = { 0 };
- + FILE_NAME_INFORMATION4096 finfo;
- + (void)memset(&finfo, 0, sizeof(finfo));
- HANDLE fileHandle = CreateFileA(filename,
- GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
- --
- 2.43.0
- From c464d81a4e7f71b8b168e32a7f28d308ae990c79 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 22 May 2024 14:22:59 +0200
- Subject: [PATCH 04/10] cygwin: Fix Makefile "installdest" target if
- ksh93/shcomp are not writeable
- Fix Makefile "installdest" target if ksh93/shcomp are not writeable
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/Makefile.install | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
- diff --git a/cygwin/Makefile.install b/cygwin/Makefile.install
- index 57e6290..a9352bc 100644
- --- a/cygwin/Makefile.install
- +++ b/cygwin/Makefile.install
- @@ -71,8 +71,8 @@ installdest:
- (cd $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/ && ln -sf winfsinfo.i686.exe winfsinfo.exe) \
- fi
- @ printf "# Package ksh93&co (if available) since Cygwin does not ship with it yet\n"
- - [[ -x $(CYGWIN_BASEPATH)/bin/ksh93.exe ]] && cp $(CYGWIN_BASEPATH)/bin/ksh93.exe $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/ksh93.exe || true
- - [[ -x $(CYGWIN_BASEPATH)/bin/shcomp.exe ]] && cp $(CYGWIN_BASEPATH)/bin/shcomp.exe $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/shcomp.exe || true
- + [[ -x $(CYGWIN_BASEPATH)/bin/ksh93.exe ]] && cp -f $(CYGWIN_BASEPATH)/bin/ksh93.exe $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/ksh93.exe || true
- + [[ -x $(CYGWIN_BASEPATH)/bin/shcomp.exe ]] && cp -f $(CYGWIN_BASEPATH)/bin/shcomp.exe $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/shcomp.exe || true
- cp $(PROJECT_BASEDIR_DIR)/cygwin/cygwin_ksh93/ksh.kshrc $(DESTDIR)/$(CYGWIN_BASEPATH)/etc/ksh.kshrc
- @ printf '# Packaging libs\n'
- if [[ "$(CYGWIN_BASEPATH)" == *64* ]] ; then \
- --
- 2.43.0
- From 4d6135c5d6aac997e57043c6e038d6024762ecdf Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 22 May 2024 14:35:29 +0200
- Subject: [PATCH 05/10] tests: Wrong package name for "libncurses-devel" in
- manual_testing.txt
- Wrong package name for "libncurses-devel" in manual_testing.txt
- Reported-by: Josh Hurst <joshhurst@gmail.com>
- 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 a5ff0c4..50029e0 100644
- --- a/tests/manual_testing.txt
- +++ b/tests/manual_testing.txt
- @@ -21,7 +21,7 @@
- # subversion
- # cygport
- # dos2unix
- -# ncurses-devel
- +# libncurses-devel
- # libgmp-devel
- # libmpfr-devel
- # libmpc-devel
- --
- 2.43.0
- From a945c69f856e203c32da7a61816b515182540e74 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 22 May 2024 15:14:50 +0200
- Subject: [PATCH 06/10] build.vc19,sys: Compile nfs41_driver.sys with
- WarningLevel=Level4
- Compile nfs41_driver.sys with WarningLevel=Level4
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- build.vc19/nfs41_driver/nfs41_driver.vcxproj | 32 ++++++++++----------
- sys/nfs41_debug.h | 6 ++--
- sys/nfs41_driver.c | 2 --
- 3 files changed, 19 insertions(+), 21 deletions(-)
- diff --git a/build.vc19/nfs41_driver/nfs41_driver.vcxproj b/build.vc19/nfs41_driver/nfs41_driver.vcxproj
- index c7ed877..e71a2a9 100644
- --- a/build.vc19/nfs41_driver/nfs41_driver.vcxproj
- +++ b/build.vc19/nfs41_driver/nfs41_driver.vcxproj
- @@ -136,10 +136,10 @@
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- - <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd5104</AdditionalOptions>
- + <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
- </ClCompile>
- <Link>
- <AdditionalDependencies>$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\bufferoverflowk.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib;$(WindowsSdkDir)lib\win7\km\$(DDKPlatform)\copysup.lib</AdditionalDependencies>
- @@ -148,10 +148,10 @@
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- - <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd5104</AdditionalOptions>
- + <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
- </ClCompile>
- <Link>
- <AdditionalDependencies>$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\bufferoverflowk.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib;$(WindowsSdkDir)lib\win7\km\$(DDKPlatform)\copysup.lib</AdditionalDependencies>
- @@ -160,10 +160,10 @@
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- - <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd5104</AdditionalOptions>
- + <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
- </ClCompile>
- <Link>
- <AdditionalDependencies>$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\bufferoverflowk.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib;$(WindowsSdkDir)lib\win7\km\$(DDKPlatform)\copysup.lib</AdditionalDependencies>
- @@ -172,10 +172,10 @@
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- - <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd5104</AdditionalOptions>
- + <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
- </ClCompile>
- <Link>
- <AdditionalDependencies>$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\bufferoverflowk.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib;$(WindowsSdkDir)lib\win7\km\$(DDKPlatform)\copysup.lib</AdditionalDependencies>
- @@ -184,10 +184,10 @@
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- - <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd5104</AdditionalOptions>
- + <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
- </ClCompile>
- <Link>
- <AdditionalDependencies>$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\bufferoverflowk.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib;$(WindowsSdkDir)lib\win7\km\$(DDKPlatform)\copysup.lib</AdditionalDependencies>
- @@ -196,10 +196,10 @@
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- - <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd5104</AdditionalOptions>
- + <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
- </ClCompile>
- <Link>
- <AdditionalDependencies>$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\bufferoverflowk.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib;$(WindowsSdkDir)lib\win7\km\$(DDKPlatform)\copysup.lib</AdditionalDependencies>
- @@ -208,10 +208,10 @@
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- - <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd5104</AdditionalOptions>
- + <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
- </ClCompile>
- <Link>
- <AdditionalDependencies>$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\bufferoverflowk.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib;$(WindowsSdkDir)lib\win7\km\$(DDKPlatform)\copysup.lib</AdditionalDependencies>
- @@ -220,10 +220,10 @@
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- - <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd5104</AdditionalOptions>
- + <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
- </ClCompile>
- <Link>
- <AdditionalDependencies>$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\bufferoverflowk.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib\10.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib;$(WindowsSdkDir)lib\win7\km\$(DDKPlatform)\copysup.lib</AdditionalDependencies>
- diff --git a/sys/nfs41_debug.h b/sys/nfs41_debug.h
- index a8f9f1c..7cea6bd 100644
- --- a/sys/nfs41_debug.h
- +++ b/sys/nfs41_debug.h
- @@ -75,9 +75,9 @@ const char *fsctl2string(ULONG fsctl);
- #define DbgR() DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL, \
- "<-- [%s] [%04x] %s\n", _DRIVER_NAME_, PsGetCurrentProcessShortDebugId(), __FUNCTION__); \
- } except (EXCEPTION_EXECUTE_HANDLER) { \
- - NTSTATUS status; \
- - status = GetExceptionCode() ; \
- - DbgP("Exception encountered with value = Ox%x\n", status); \
- + NTSTATUS exc_status; \
- + exc_status = GetExceptionCode() ; \
- + DbgP("Exception encountered with value = Ox%x\n", (int)exc_status); \
- }
- /* These are for ToasterDebugPrint */
- diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
- index 8579423..90613a4 100644
- --- a/sys/nfs41_driver.c
- +++ b/sys/nfs41_driver.c
- @@ -3585,8 +3585,6 @@ NTSTATUS nfs41_FinalizeVNetRoot(
- IN PBOOLEAN ForceDisconnect)
- {
- NTSTATUS status = STATUS_SUCCESS;
- - PNFS41_V_NET_ROOT_EXTENSION pVNetRootContext =
- - NFS41GetVNetRootExtension(pVNetRoot);
- #ifdef DEBUG_MOUNT
- DbgEn();
- print_v_net_root(1, pVNetRoot);
- --
- 2.43.0
- From 2900967811542766feaf933bd06777f640d69904 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 22 May 2024 15:23:02 +0200
- Subject: [PATCH 07/10] build.vc19,mount: Compile nfs_mount with
- WarningLevel=Level4
- Compile nfs_mount with WarningLevel=Level4
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- build.vc19/nfs_mount/nfs_mount.vcxproj | 8 ++++----
- mount/urlparser1.c | 8 ++++++++
- 2 files changed, 12 insertions(+), 4 deletions(-)
- diff --git a/build.vc19/nfs_mount/nfs_mount.vcxproj b/build.vc19/nfs_mount/nfs_mount.vcxproj
- index 2e76397..100ba01 100644
- --- a/build.vc19/nfs_mount/nfs_mount.vcxproj
- +++ b/build.vc19/nfs_mount/nfs_mount.vcxproj
- @@ -85,7 +85,7 @@
- <ClCompile>
- <PrecompiledHeader>
- </PrecompiledHeader>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- @@ -102,7 +102,7 @@
- <ClCompile>
- <PrecompiledHeader>
- </PrecompiledHeader>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- @@ -117,7 +117,7 @@
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- @@ -138,7 +138,7 @@
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- diff --git a/mount/urlparser1.c b/mount/urlparser1.c
- index 3de1047..a90d1e2 100644
- --- a/mount/urlparser1.c
- +++ b/mount/urlparser1.c
- @@ -38,6 +38,11 @@
- * making this function safe
- */
- #pragma warning (disable : 4996)
- +/*
- + * Disable "warning C4706: assignment within conditional expression"
- + * because it is safe to use in our code.
- + */
- +#pragma warning (disable : 4706)
- /*
- * Original extended regular expression:
- @@ -124,6 +129,9 @@ url_parser_context *url_parser_create_context(const char *in_url, unsigned int f
- size_t in_url_len;
- size_t context_len;
- + /* |flags| is for future extensions */
- + (void)flags;
- +
- if (!in_url)
- return NULL;
- --
- 2.43.0
- From a9f4703ca16b0436ad334ff3e7d9eb70782dabac Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 22 May 2024 15:31:01 +0200
- Subject: [PATCH 08/10] build.vc19: Compile nfs41_np with WarningLevel=Level4
- Compile nfs41_np with WarningLevel=Level4
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- build.vc19/nfs41_np/nfs41_np.vcxproj | 12 ++++++++----
- 1 file changed, 8 insertions(+), 4 deletions(-)
- diff --git a/build.vc19/nfs41_np/nfs41_np.vcxproj b/build.vc19/nfs41_np/nfs41_np.vcxproj
- index 846ce86..cbe68df 100644
- --- a/build.vc19/nfs41_np/nfs41_np.vcxproj
- +++ b/build.vc19/nfs41_np/nfs41_np.vcxproj
- @@ -85,12 +85,13 @@
- <ClCompile>
- <PrecompiledHeader>
- </PrecompiledHeader>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- + <AdditionalOptions>/wd4100</AdditionalOptions>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- @@ -102,12 +103,13 @@
- <ClCompile>
- <PrecompiledHeader>
- </PrecompiledHeader>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- + <AdditionalOptions>/wd4100</AdditionalOptions>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- @@ -117,7 +119,7 @@
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- @@ -127,6 +129,7 @@
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- + <AdditionalOptions>/wd4100</AdditionalOptions>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- @@ -138,7 +141,7 @@
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- @@ -148,6 +151,7 @@
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- + <AdditionalOptions>/wd4100</AdditionalOptions>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- --
- 2.43.0
- From ef8c30910ce6d8a644255e58b2004eedd0abbc9c Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 22 May 2024 15:44:17 +0200
- Subject: [PATCH 09/10] build.vc19,install: Build nfs_install with
- WarningLevel=Level4
- Build nfs_install with WarningLevel=Level4
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- build.vc19/nfs_install/nfs_install.vcxproj | 8 ++++----
- install/nfs_install.c | 14 ++++++--------
- 2 files changed, 10 insertions(+), 12 deletions(-)
- diff --git a/build.vc19/nfs_install/nfs_install.vcxproj b/build.vc19/nfs_install/nfs_install.vcxproj
- index 4ceb221..6d1d029 100644
- --- a/build.vc19/nfs_install/nfs_install.vcxproj
- +++ b/build.vc19/nfs_install/nfs_install.vcxproj
- @@ -85,7 +85,7 @@
- <ClCompile>
- <PrecompiledHeader>
- </PrecompiledHeader>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- @@ -101,7 +101,7 @@
- <ClCompile>
- <PrecompiledHeader>
- </PrecompiledHeader>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- @@ -115,7 +115,7 @@
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- @@ -135,7 +135,7 @@
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- diff --git a/install/nfs_install.c b/install/nfs_install.c
- index a686318..9d75552 100644
- --- a/install/nfs_install.c
- +++ b/install/nfs_install.c
- @@ -112,7 +112,7 @@ int main(int ac, char *av[])
- if (dataSize > 0) {
- /* Read the existing data */
- result = RegQueryValueExA(hKey, "ProviderOrder", NULL, NULL,
- - originalValue, &dataSize);
- + (BYTE *)originalValue, &dataSize);
- if (result != ERROR_SUCCESS) {
- (void)fprintf(stderr, "%s: Error reading registry value: %d\n",
- av[0], result);
- @@ -165,12 +165,10 @@ int main(int ac, char *av[])
- char *s;
- DPRINTF(1, ("# value before removal '%s'\n", new_buffer));
- - while (s = strstr(new_buffer, PROVIDER_NAME_COMMA)) {
- - if (s) {
- - char *end = s+strlen(PROVIDER_NAME_COMMA);
- - (void)memmove(s, end, strlen(end)+1);
- - DPRINTF(1, ("# value after removal '%s'\n", new_buffer));
- - }
- + while ((s = strstr(new_buffer, PROVIDER_NAME_COMMA)) != NULL) {
- + char *end = s+strlen(PROVIDER_NAME_COMMA);
- + (void)memmove(s, end, strlen(end)+1);
- + DPRINTF(1, ("# value after removal '%s'\n", new_buffer));
- }
- if (!strcmp(new_buffer, PROVIDER_NAME)) {
- @@ -184,7 +182,7 @@ int main(int ac, char *av[])
- * Set the new value of the ProviderOrder key
- */
- result = RegSetValueExA(hKey, "ProviderOrder", 0, REG_SZ,
- - new_buffer, (DWORD)strlen(new_buffer));
- + (BYTE *)new_buffer, (DWORD)strlen(new_buffer));
- if (result != ERROR_SUCCESS) {
- (void)fprintf(stderr, "%s: Error setting registry value: %d\n",
- --
- 2.43.0
- From b55074ba46369ea7474f7395ebeaad96dd7ae66f Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 22 May 2024 17:00:53 +0200
- Subject: [PATCH 10/10] build.vc19,daemon: Compile daemon with
- WarningLevel=Level4
- Compile daemon with WarningLevel=Level4
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- build.vc19/nfsd/nfsd.vcxproj | 12 ++++++---
- daemon/daemon_debug.h | 9 +++++++
- daemon/idmap.c | 10 +++++++-
- daemon/idmap_cygwin.c | 6 ++---
- daemon/mount.c | 5 ++--
- daemon/name_cache.c | 4 +--
- daemon/nfs41.h | 8 ++++++
- daemon/nfs41_ops.c | 8 +++---
- daemon/open.c | 11 +++++----
- daemon/service.c | 2 +-
- daemon/sid.c | 17 +++++++------
- daemon/util.c | 47 +++++++++++++++++++-----------------
- 12 files changed, 87 insertions(+), 52 deletions(-)
- diff --git a/build.vc19/nfsd/nfsd.vcxproj b/build.vc19/nfsd/nfsd.vcxproj
- index 47d4092..c5b93e9 100644
- --- a/build.vc19/nfsd/nfsd.vcxproj
- +++ b/build.vc19/nfsd/nfsd.vcxproj
- @@ -85,7 +85,7 @@
- <ClCompile>
- <PrecompiledHeader>
- </PrecompiledHeader>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;STANDALONE_NFSD;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- @@ -94,6 +94,7 @@
- <BufferSecurityCheck>false</BufferSecurityCheck>
- <StringPooling>true</StringPooling>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- + <AdditionalOptions>/wd4100</AdditionalOptions>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -105,7 +106,7 @@
- <ClCompile>
- <PrecompiledHeader>
- </PrecompiledHeader>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;STANDALONE_NFSD;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- @@ -114,6 +115,7 @@
- <BufferSecurityCheck>false</BufferSecurityCheck>
- <StringPooling>true</StringPooling>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- + <AdditionalOptions>/wd4100</AdditionalOptions>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -123,7 +125,7 @@
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- @@ -135,6 +137,7 @@
- <BufferSecurityCheck>false</BufferSecurityCheck>
- <StringPooling>true</StringPooling>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- + <AdditionalOptions>/wd4100</AdditionalOptions>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -146,7 +149,7 @@
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- - <WarningLevel>Level3</WarningLevel>
- + <WarningLevel>Level4</WarningLevel>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- @@ -158,6 +161,7 @@
- <BufferSecurityCheck>false</BufferSecurityCheck>
- <StringPooling>true</StringPooling>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- + <AdditionalOptions>/wd4100</AdditionalOptions>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- diff --git a/daemon/daemon_debug.h b/daemon/daemon_debug.h
- index 813dc71..8f0c166 100644
- --- a/daemon/daemon_debug.h
- +++ b/daemon/daemon_debug.h
- @@ -37,12 +37,21 @@
- /* 0xdd..dd is the filler by the debug memory allocator */
- +#ifdef _WIN64
- #define DEBUG_IS_VALID_NON_NULL_PTR(ptr) \
- ( \
- (((char *)(ptr)) != ((char *)0xddddddddddddddddLL)) && \
- (((char *)(ptr)) != ((char *)0xffffffffffffffffLL)) && \
- ((ptr) != NULL) \
- )
- +#else
- +#define DEBUG_IS_VALID_NON_NULL_PTR(ptr) \
- + ( \
- + (((char *)(ptr)) != ((char *)0xddddddddL)) && \
- + (((char *)(ptr)) != ((char *)0xffffffffL)) && \
- + ((ptr) != NULL) \
- + )
- +#endif /* _WIN64 */
- #define EASSERT(exp) \
- if (!(exp)) { \
- diff --git a/daemon/idmap.c b/daemon/idmap.c
- index 42c969c..0b44fc1 100644
- --- a/daemon/idmap.c
- +++ b/daemon/idmap.c
- @@ -654,12 +654,14 @@ static int idmap_lookup_user(
- struct idmap_user *user)
- {
- PCHAR* values[NUM_ATTRIBUTES] = { NULL };
- +#ifndef NFS41_DRIVER_FEATURE_IDMAPPER_CYGWIN
- const unsigned attributes = ATTR_FLAG(ATTR_USER_NAME)
- | ATTR_FLAG(ATTR_PRINCIPAL)
- | ATTR_FLAG(ATTR_UID)
- | ATTR_FLAG(ATTR_GID);
- /* principal is optional; we'll cache it if we have it */
- const unsigned optional = ATTR_FLAG(ATTR_PRINCIPAL);
- +#endif /* !NFS41_DRIVER_FEATURE_IDMAPPER_CYGWIN */
- int i, status;
- /* check the user cache for an existing entry */
- @@ -742,7 +744,7 @@ static int idmap_lookup_user(
- * fixme: This does not work with multiple domains
- */
- (void)strcpy_s(search_name, sizeof(search_name), lookup->value);
- - if (s = strchr(search_name, '@'))
- + if ((s = strchr(search_name, '@')) != NULL)
- *s = '\0';
- if (!cygwin_getent_passwd(search_name, NULL, &cy_uid, &cy_gid)) {
- @@ -805,7 +807,9 @@ static int idmap_lookup_user(
- /* insert the entry into the cache */
- cache_insert(&context->users, lookup, &user->entry);
- }
- +#ifndef NFS41_DRIVER_FEATURE_IDMAPPER_CYGWIN
- out_free_values:
- +#endif
- for (i = 0; i < NUM_ATTRIBUTES; i++)
- ldap_value_freeA(values[i]);
- out:
- @@ -818,8 +822,10 @@ static int idmap_lookup_group(
- struct idmap_group *group)
- {
- PCHAR* values[NUM_ATTRIBUTES] = { NULL };
- +#ifndef NFS41_DRIVER_FEATURE_IDMAPPER_CYGWIN
- const unsigned attributes = ATTR_FLAG(ATTR_GROUP_NAME)
- | ATTR_FLAG(ATTR_GID);
- +#endif
- int i, status;
- /* check the group cache for an existing entry */
- @@ -906,7 +912,9 @@ static int idmap_lookup_group(
- /* insert the entry into the cache */
- cache_insert(&context->groups, lookup, &group->entry);
- }
- +#ifndef NFS41_DRIVER_FEATURE_IDMAPPER_CYGWIN
- out_free_values:
- +#endif
- for (i = 0; i < NUM_ATTRIBUTES; i++)
- ldap_value_freeA(values[i]);
- out:
- diff --git a/daemon/idmap_cygwin.c b/daemon/idmap_cygwin.c
- index 5f1b020..3d4a1be 100644
- --- a/daemon/idmap_cygwin.c
- +++ b/daemon/idmap_cygwin.c
- @@ -56,8 +56,8 @@ int cygwin_getent_passwd(const char *name, char *res_loginname, uid_t *res_uid,
- DWORD num_buff_read;
- subcmd_popen_context *script_pipe = NULL;
- int res = 1;
- - unsigned long uid = -1;
- - unsigned long gid = -1;
- + unsigned long uid = ~0UL;
- + unsigned long gid = ~0UL;
- void *cpvp = NULL;
- int numcnv = 0;
- int i = 0;
- @@ -171,7 +171,7 @@ int cygwin_getent_group(const char* name, char* res_group_name, gid_t* res_gid)
- DWORD num_buff_read;
- subcmd_popen_context *script_pipe = NULL;
- int res = 1;
- - unsigned long gid = -1;
- + unsigned long gid = ~0UL;
- void *cpvp = NULL;
- int numcnv = 0;
- int i = 0;
- diff --git a/daemon/mount.c b/daemon/mount.c
- index 20f0485..89bf8d4 100644
- --- a/daemon/mount.c
- +++ b/daemon/mount.c
- @@ -66,7 +66,7 @@ static int handle_mount(void *daemon_context, nfs41_upcall *upcall)
- int port = 0;
- nfs41_abs_path path;
- multi_addr4 addrs = { 0 };
- - nfs41_root *root;
- + nfs41_root *root = NULL;
- nfs41_client *client;
- nfs41_path_fh file;
- @@ -89,7 +89,8 @@ static int handle_mount(void *daemon_context, nfs41_upcall *upcall)
- }
- (void)strcpy_s(hostname, sizeof(hostname), args->hostport);
- - if (s = strchr(hostname, '@')) {
- + s = strchr(hostname, '@');
- + if (s) {
- *s++ = '\0';
- port = atoi(s);
- if ((port < 1) || (port > 65535)) {
- diff --git a/daemon/name_cache.c b/daemon/name_cache.c
- index a556235..9753cb7 100644
- --- a/daemon/name_cache.c
- +++ b/daemon/name_cache.c
- @@ -997,8 +997,8 @@ int nfs41_name_cache_insert(
- if (path == NULL || name == NULL || name->len == 0) {
- /* create the root entry if it doesn't exist */
- if (cache->root == NULL) {
- - const nfs41_component name = { "ROOT", 4 };
- - status = name_cache_entry_create(cache, &name, &cache->root);
- + const nfs41_component nc_name = { "ROOT", 4 };
- + status = name_cache_entry_create(cache, &nc_name, &cache->root);
- if (status)
- goto out_err_deleg;
- }
- diff --git a/daemon/nfs41.h b/daemon/nfs41.h
- index 875a054..f1617a9 100644
- --- a/daemon/nfs41.h
- +++ b/daemon/nfs41.h
- @@ -85,7 +85,11 @@ typedef struct __nfs41_server {
- nfs41_superblock_list superblocks;
- struct nfs41_name_cache *name_cache;
- struct list_entry entry; /* position in global server list */
- +#pragma warning( push )
- +/* Ignore "C4324: structure was padded due to alignment specifier" */
- +#pragma warning (disable : 4324)
- __declspec(align(8)) volatile LONG ref_count;
- +#pragma warning( pop )
- } nfs41_server;
- enum delegation_status {
- @@ -297,7 +301,11 @@ typedef struct __nfs41_root {
- struct list_entry clients;
- uint32_t wsize;
- uint32_t rsize;
- +#pragma warning( push )
- +/* Ignore "C4324: structure was padded due to alignment specifier" */
- +#pragma warning (disable : 4324)
- __declspec(align(8)) volatile LONG ref_count;
- +#pragma warning( pop )
- uint32_t uid;
- uint32_t gid;
- DWORD sec_flavor;
- diff --git a/daemon/nfs41_ops.c b/daemon/nfs41_ops.c
- index edd0b94..6aa2ff7 100644
- --- a/daemon/nfs41_ops.c
- +++ b/daemon/nfs41_ops.c
- @@ -71,10 +71,10 @@ int nfs41_exchange_id(
- compound_add_op(&compound, OP_EXCHANGE_ID, &ex_id, res_out);
- /* gisburn: fixme: We do not have that domain yet */
- - impl_id.nii_domain = "msnfs41client.org";
- - impl_id.nii_domain_len = (uint32_t)strlen(impl_id.nii_domain);
- - impl_id.nii_name = nfs41_dg.nfs41_nii_name;
- - impl_id.nii_name_len = (uint32_t)strlen(impl_id.nii_name);
- + impl_id.nii_domain = (unsigned char *)"msnfs41client.org";
- + impl_id.nii_domain_len = (uint32_t)strlen((const char *)impl_id.nii_domain);
- + impl_id.nii_name = (unsigned char *)nfs41_dg.nfs41_nii_name;
- + impl_id.nii_name_len = (uint32_t)strlen((const char *)impl_id.nii_name);
- /*
- * gisburn: fixme: |impl_id.nii_date| should be the timestamp
- * of the binary
- diff --git a/daemon/open.c b/daemon/open.c
- index 6ac0f2b..5012bbf 100644
- --- a/daemon/open.c
- +++ b/daemon/open.c
- @@ -775,8 +775,8 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
- #ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- char owner[NFS4_OPAQUE_LIMIT], owner_group[NFS4_OPAQUE_LIMIT];
- - uid_t map_uid = -1;
- - gid_t map_gid = -1;
- + uid_t map_uid = ~0UL;
- + gid_t map_gid = ~0UL;
- char *at_ch; /* pointer to '@' */
- #if 1
- @@ -785,7 +785,6 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
- ((info.attrmask.arr[1] & FATTR4_WORD1_OWNER_GROUP) == 0)) {
- bitmap4 og_attr_request = { 0 };
- nfs41_file_info og_info = { 0 };
- - nfsacl41 acl = { 0 };
- og_attr_request.count = 2;
- og_attr_request.arr[1] =
- @@ -831,7 +830,8 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
- * ("gisburn") or username@domain ("gisburn@sun.com")
- */
- /* stomp over '@' */
- - if (at_ch = strchr(owner, '@'))
- + at_ch = strchr(owner, '@');
- + if (at_ch)
- *at_ch = '\0';
- if (nfs41_idmap_name_to_uid(
- @@ -855,7 +855,8 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
- * ("gisgrp") or username@domain ("gisgrp@sun.com")
- */
- /* stomp over '@' */
- - if (at_ch = strchr(owner_group, '@'))
- + at_ch = strchr(owner_group, '@');
- + if (at_ch)
- *at_ch = '\0';
- if (nfs41_idmap_group_to_gid(
- diff --git a/daemon/service.c b/daemon/service.c
- index ba6a100..714f66b 100644
- --- a/daemon/service.c
- +++ b/daemon/service.c
- @@ -495,7 +495,7 @@ void CmdRemoveService()
- //
- void CmdDebugService(int argc, char ** argv)
- {
- - DWORD dwArgc;
- + int dwArgc;
- LPTSTR *lpszArgv;
- #ifdef UNICODE
- diff --git a/daemon/sid.c b/daemon/sid.c
- index 94128d9..bde099a 100644
- --- a/daemon/sid.c
- +++ b/daemon/sid.c
- @@ -406,11 +406,12 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- #ifdef NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID
- /* use our own idmapper script to map nfsv4 owner string to local Windows account */
- if (query & OWNER_SECURITY_INFORMATION) {
- - uid_t udummy = -1;
- - gid_t gdummy = -1;
- + uid_t udummy = ~0UL;
- + gid_t gdummy = ~0UL;
- #ifdef NFS41_DRIVER_SID_CACHE
- - if (*sid = sidcache_getcached_byname(&user_sidcache, nfsname)) {
- + *sid = sidcache_getcached_byname(&user_sidcache, nfsname);
- + if (*sid) {
- *sid_len = GetLengthSid(*sid);
- DPRINTF(1, ("map_nfs4servername_2_sid: returning cached sid for user '%s'\n", nfsname));
- status = 0;
- @@ -437,10 +438,11 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- #ifdef NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID
- /* use our own idmapper script to map nfsv4 owner string to local Windows account */
- if (query & GROUP_SECURITY_INFORMATION) {
- - gid_t gdummy = -1;
- + gid_t gdummy = ~0UL;
- #ifdef NFS41_DRIVER_SID_CACHE
- - if (*sid = sidcache_getcached_byname(&group_sidcache, nfsname)) {
- + *sid = sidcache_getcached_byname(&group_sidcache, nfsname);
- + if (*sid) {
- *sid_len = GetLengthSid(*sid);
- DPRINTF(1, ("map_nfs4servername_2_sid: returning cached sid for group '%s'\n", nfsname));
- status = 0;
- @@ -516,8 +518,7 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- query, nfsname));
- if ((user_uid == -1) && (query & OWNER_SECURITY_INFORMATION)) {
- - uid_t map_uid = -1;
- - gid_t gid_dummy = -1;
- + uid_t map_uid = ~0UL;
- if (nfs41_idmap_name_to_uid(nfs41dg->idmapper,
- nfsname, &map_uid) == 0) {
- @@ -533,7 +534,7 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- }
- if ((group_gid == -1) && (query & GROUP_SECURITY_INFORMATION)) {
- - gid_t map_gid = -1;
- + gid_t map_gid = ~0UL;
- if (nfs41_idmap_group_to_gid(
- nfs41dg->idmapper,
- diff --git a/daemon/util.c b/daemon/util.c
- index 9ea2b77..d38e65b 100644
- --- a/daemon/util.c
- +++ b/daemon/util.c
- @@ -604,15 +604,15 @@ subcmd_popen_context *subcmd_popen(const char *command)
- goto fail;
- }
- - CloseHandle(pinfo->hWritePipe);
- + (void)CloseHandle(pinfo->hWritePipe);
- return pinfo;
- fail:
- if (pinfo) {
- if (pinfo->hReadPipe)
- - CloseHandle(pinfo->hReadPipe);
- + (void)CloseHandle(pinfo->hReadPipe);
- if (pinfo->hWritePipe)
- - CloseHandle(pinfo->hWritePipe);
- + (void)CloseHandle(pinfo->hWritePipe);
- free(pinfo);
- }
- @@ -624,17 +624,18 @@ int subcmd_pclose(subcmd_popen_context *pinfo)
- DWORD status;
- /* Close the read handle to the pipe from the child process */
- - CloseHandle(pinfo->hReadPipe);
- + (void)CloseHandle(pinfo->hReadPipe);
- status = WaitForSingleObjectEx(pinfo->pi.hProcess, INFINITE, FALSE);
- EASSERT(status == WAIT_OBJECT_0);
- if (!GetExitCodeProcess(pinfo->pi.hProcess, &status)) {
- - status = -1;
- + /* fixme: We need a better error code */
- + status = ERROR_INVALID_ACCESS;
- }
- - CloseHandle(pinfo->pi.hProcess);
- - CloseHandle(pinfo->pi.hThread);
- + (void)CloseHandle(pinfo->pi.hProcess);
- + (void)CloseHandle(pinfo->pi.hThread);
- if (status != 0) {
- DPRINTF(0, ("subcmd_pclose(): exit code=%d\n", (int)status));
- @@ -703,27 +704,29 @@ bool_t waitcriticalsection(LPCRITICAL_SECTION cs)
- * is a private API, but it should be safe to use as Cygwin and
- * other software relies on it
- */
- +#ifdef _WIN64
- +/*
- + * Windows private API, so we add prototype here ourselves
- + *
- + * Note that this currently only works with 64bit Windows,
- + * 32bit Windows generates this build error:
- + * ---- snip ----
- + * util.obj : error LNK2019: unresolved external symbol __RtlGetNtVersionNumbers referenced in function _getwinntversionnnumbers
- + * ---- snip ----
- + */
- +/*
- + * Reference:
- + * https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/wincap.cc
- + */
- +NTSTATUS RtlGetNtVersionNumbers(LPDWORD, LPDWORD, LPDWORD);
- +#endif /* _WIN64 */
- +
- bool getwinntversionnnumbers(
- DWORD *MajorVersionPtr,
- DWORD *MinorVersionPtr,
- DWORD *BuildNumberPtr)
- {
- #ifdef _WIN64
- - /*
- - * Windows private API, so we add prototype here ourselves
- - *
- - * Note that this currently only works with 64bit Windows,
- - * 32bit Windows generates this build error:
- - * ---- snip ----
- - * util.obj : error LNK2019: unresolved external symbol __RtlGetNtVersionNumbers referenced in function _getwinntversionnnumbers
- - * ---- snip ----
- - */
- - NTSTATUS RtlGetNtVersionNumbers(LPDWORD, LPDWORD, LPDWORD);
- -
- - /*
- - * Reference:
- - * https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/wincap.cc
- - */
- (void)RtlGetNtVersionNumbers(MajorVersionPtr, MinorVersionPtr, BuildNumberPtr);
- *BuildNumberPtr &= 0xffff;
- --
- 2.43.0
msnfs41client: Patches for WarningLevel=4, 32bit fixes+misc, 2024-05-22
Posted by Anonymous on Wed 22nd May 2024 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.