pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for WarningLevel=4, 32bit fixes+misc, 2024-05-22
Posted by Anonymous on Wed 22nd May 2024 16:08
raw | new post

  1. From a981d7af6516c34e684e2a14d611091d478499fc Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Wed, 22 May 2024 12:41:44 +0200
  4. Subject: [PATCH 01/10] build.vc19: Switch CharacterSet in nfsd.vcxproj to
  5.  Unicode
  6.  
  7. Switch CharacterSet in nfsd.vcxproj from "Multibyte" to "Unicode"
  8.  
  9. Reported-by: Dan Shelton <dan.f.shelton@gmail.com>
  10. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  11. ---
  12. build.vc19/nfsd/nfsd.vcxproj | 8 ++++----
  13.  1 file changed, 4 insertions(+), 4 deletions(-)
  14.  
  15. diff --git a/build.vc19/nfsd/nfsd.vcxproj b/build.vc19/nfsd/nfsd.vcxproj
  16. index 32ba21d..5dcc8a8 100644
  17. --- a/build.vc19/nfsd/nfsd.vcxproj
  18. +++ b/build.vc19/nfsd/nfsd.vcxproj
  19. @@ -29,27 +29,27 @@
  20.      <ConfigurationType>Application</ConfigurationType>
  21.      <UseDebugLibraries>true</UseDebugLibraries>
  22.      <PlatformToolset>v142</PlatformToolset>
  23. -    <CharacterSet>MultiByte</CharacterSet>
  24. +    <CharacterSet>Unicode</CharacterSet>
  25.    </PropertyGroup>
  26.    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
  27.      <ConfigurationType>Application</ConfigurationType>
  28.      <UseDebugLibraries>false</UseDebugLibraries>
  29.      <PlatformToolset>v142</PlatformToolset>
  30.      <WholeProgramOptimization>true</WholeProgramOptimization>
  31. -    <CharacterSet>MultiByte</CharacterSet>
  32. +    <CharacterSet>Unicode</CharacterSet>
  33.    </PropertyGroup>
  34.    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
  35.      <ConfigurationType>Application</ConfigurationType>
  36.      <UseDebugLibraries>true</UseDebugLibraries>
  37.      <PlatformToolset>v142</PlatformToolset>
  38. -    <CharacterSet>MultiByte</CharacterSet>
  39. +    <CharacterSet>Unicode</CharacterSet>
  40.    </PropertyGroup>
  41.    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
  42.      <ConfigurationType>Application</ConfigurationType>
  43.      <UseDebugLibraries>false</UseDebugLibraries>
  44.      <PlatformToolset>v142</PlatformToolset>
  45.      <WholeProgramOptimization>true</WholeProgramOptimization>
  46. -    <CharacterSet>MultiByte</CharacterSet>
  47. +    <CharacterSet>Unicode</CharacterSet>
  48.    </PropertyGroup>
  49.    <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  50.    <ImportGroup Label="ExtensionSettings">
  51. --
  52. 2.43.0
  53.  
  54. From e597af503f04b223e3b9294154199aaf54d7a064 Mon Sep 17 00:00:00 2001
  55. From: Roland Mainz <roland.mainz@nrubsig.org>
  56. Date: Wed, 22 May 2024 13:11:18 +0200
  57. Subject: [PATCH 02/10] build.vc19: Explicitly set "RuntimeLibrary" properly
  58.  
  59. Explicitly set "RuntimeLibrary" properly, to avoid picking
  60. a wrong "default".
  61.  
  62. Reported-by: Dan Shelton <dan.f.shelton@gmail.com>
  63. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  64. ---
  65. build.vc19/libtirpc/libtirpc.vcxproj       | 4 ++++
  66.  build.vc19/nfs41_np/nfs41_np.vcxproj       | 4 ++++
  67.  build.vc19/nfs_install/nfs_install.vcxproj | 4 ++++
  68.  build.vc19/nfs_mount/nfs_mount.vcxproj     | 4 ++++
  69.  build.vc19/nfsd/nfsd.vcxproj               | 4 ++++
  70.  5 files changed, 20 insertions(+)
  71.  
  72. diff --git a/build.vc19/libtirpc/libtirpc.vcxproj b/build.vc19/libtirpc/libtirpc.vcxproj
  73. index da272de..f817b6f 100644
  74. --- a/build.vc19/libtirpc/libtirpc.vcxproj
  75. +++ b/build.vc19/libtirpc/libtirpc.vcxproj
  76. @@ -93,6 +93,7 @@
  77.        <StringPooling>true</StringPooling>
  78.        <BasicRuntimeChecks>Default</BasicRuntimeChecks>
  79.        <BufferSecurityCheck>false</BufferSecurityCheck>
  80. +      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  81.      </ClCompile>
  82.      <Link>
  83.        <SubSystem>Windows</SubSystem>
  84. @@ -113,6 +114,7 @@
  85.        <StringPooling>true</StringPooling>
  86.        <BasicRuntimeChecks>Default</BasicRuntimeChecks>
  87.        <BufferSecurityCheck>false</BufferSecurityCheck>
  88. +      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  89.      </ClCompile>
  90.      <Link>
  91.        <SubSystem>Windows</SubSystem>
  92. @@ -134,6 +136,7 @@
  93.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  94.        <StringPooling>true</StringPooling>
  95.        <BufferSecurityCheck>false</BufferSecurityCheck>
  96. +      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  97.      </ClCompile>
  98.      <Link>
  99.        <SubSystem>Windows</SubSystem>
  100. @@ -157,6 +160,7 @@
  101.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  102.        <StringPooling>true</StringPooling>
  103.        <BufferSecurityCheck>false</BufferSecurityCheck>
  104. +      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  105.      </ClCompile>
  106.      <Link>
  107.        <SubSystem>Windows</SubSystem>
  108. diff --git a/build.vc19/nfs41_np/nfs41_np.vcxproj b/build.vc19/nfs41_np/nfs41_np.vcxproj
  109. index eb515f0..846ce86 100644
  110. --- a/build.vc19/nfs41_np/nfs41_np.vcxproj
  111. +++ b/build.vc19/nfs41_np/nfs41_np.vcxproj
  112. @@ -90,6 +90,7 @@
  113.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  114.        <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  115.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  116. +      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  117.      </ClCompile>
  118.      <Link>
  119.        <SubSystem>Windows</SubSystem>
  120. @@ -106,6 +107,7 @@
  121.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  122.        <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  123.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  124. +      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  125.      </ClCompile>
  126.      <Link>
  127.        <SubSystem>Windows</SubSystem>
  128. @@ -124,6 +126,7 @@
  129.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  130.        <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  131.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  132. +      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  133.      </ClCompile>
  134.      <Link>
  135.        <SubSystem>Windows</SubSystem>
  136. @@ -144,6 +147,7 @@
  137.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  138.        <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  139.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  140. +      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  141.      </ClCompile>
  142.      <Link>
  143.        <SubSystem>Windows</SubSystem>
  144. diff --git a/build.vc19/nfs_install/nfs_install.vcxproj b/build.vc19/nfs_install/nfs_install.vcxproj
  145. index ab244aa..4ceb221 100644
  146. --- a/build.vc19/nfs_install/nfs_install.vcxproj
  147. +++ b/build.vc19/nfs_install/nfs_install.vcxproj
  148. @@ -90,6 +90,7 @@
  149.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  150.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  151.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  152. +      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  153.      </ClCompile>
  154.      <Link>
  155.        <SubSystem>Console</SubSystem>
  156. @@ -105,6 +106,7 @@
  157.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  158.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  159.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  160. +      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  161.      </ClCompile>
  162.      <Link>
  163.        <SubSystem>Console</SubSystem>
  164. @@ -122,6 +124,7 @@
  165.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  166.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  167.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  168. +      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  169.      </ClCompile>
  170.      <Link>
  171.        <SubSystem>Console</SubSystem>
  172. @@ -141,6 +144,7 @@
  173.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  174.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  175.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  176. +      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  177.      </ClCompile>
  178.      <Link>
  179.        <SubSystem>Console</SubSystem>
  180. diff --git a/build.vc19/nfs_mount/nfs_mount.vcxproj b/build.vc19/nfs_mount/nfs_mount.vcxproj
  181. index b3083da..2e76397 100644
  182. --- a/build.vc19/nfs_mount/nfs_mount.vcxproj
  183. +++ b/build.vc19/nfs_mount/nfs_mount.vcxproj
  184. @@ -90,6 +90,7 @@
  185.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  186.        <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  187.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  188. +      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  189.      </ClCompile>
  190.      <Link>
  191.        <SubSystem>Console</SubSystem>
  192. @@ -106,6 +107,7 @@
  193.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  194.        <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  195.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  196. +      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  197.      </ClCompile>
  198.      <Link>
  199.        <SubSystem>Console</SubSystem>
  200. @@ -124,6 +126,7 @@
  201.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  202.        <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  203.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  204. +      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  205.      </ClCompile>
  206.      <Link>
  207.        <SubSystem>Console</SubSystem>
  208. @@ -144,6 +147,7 @@
  209.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  210.        <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  211.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  212. +      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  213.      </ClCompile>
  214.      <Link>
  215.        <SubSystem>Console</SubSystem>
  216. diff --git a/build.vc19/nfsd/nfsd.vcxproj b/build.vc19/nfsd/nfsd.vcxproj
  217. index 5dcc8a8..47d4092 100644
  218. --- a/build.vc19/nfsd/nfsd.vcxproj
  219. +++ b/build.vc19/nfsd/nfsd.vcxproj
  220. @@ -93,6 +93,7 @@
  221.        <BasicRuntimeChecks>Default</BasicRuntimeChecks>
  222.        <BufferSecurityCheck>false</BufferSecurityCheck>
  223.        <StringPooling>true</StringPooling>
  224. +      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  225.      </ClCompile>
  226.      <Link>
  227.        <SubSystem>Console</SubSystem>
  228. @@ -112,6 +113,7 @@
  229.        <BasicRuntimeChecks>Default</BasicRuntimeChecks>
  230.        <BufferSecurityCheck>false</BufferSecurityCheck>
  231.        <StringPooling>true</StringPooling>
  232. +      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  233.      </ClCompile>
  234.      <Link>
  235.        <SubSystem>Console</SubSystem>
  236. @@ -132,6 +134,7 @@
  237.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  238.        <BufferSecurityCheck>false</BufferSecurityCheck>
  239.        <StringPooling>true</StringPooling>
  240. +      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  241.      </ClCompile>
  242.      <Link>
  243.        <SubSystem>Console</SubSystem>
  244. @@ -154,6 +157,7 @@
  245.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  246.        <BufferSecurityCheck>false</BufferSecurityCheck>
  247.        <StringPooling>true</StringPooling>
  248. +      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  249.      </ClCompile>
  250.      <Link>
  251.        <SubSystem>Console</SubSystem>
  252. --
  253. 2.43.0
  254.  
  255. From 0d08e89e4464c04f7b5c2b476696f841f7bd3da3 Mon Sep 17 00:00:00 2001
  256. From: Roland Mainz <roland.mainz@nrubsig.org>
  257. Date: Wed, 22 May 2024 14:19:38 +0200
  258. Subject: [PATCH 03/10] cygwin,tests: Provide both 32bit and 64bit versions of
  259.  winfstest
  260.  
  261. Provide both 32bit and 64bit versions of winfstest
  262.  
  263. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  264. ---
  265. cygwin/Makefile.install      |  8 +++++++-
  266.  cygwin/README.bintarball.txt |  5 +++++
  267.  tests/manual_testing.txt     |  2 ++
  268.  tests/winfsinfo1/Makefile    | 16 ++++++++++++----
  269.  tests/winfsinfo1/winfsinfo.c |  9 ++++++---
  270.  5 files changed, 32 insertions(+), 8 deletions(-)
  271.  
  272. diff --git a/cygwin/Makefile.install b/cygwin/Makefile.install
  273. index 2af63b4..57e6290 100644
  274. --- a/cygwin/Makefile.install
  275. +++ b/cygwin/Makefile.install
  276. @@ -63,7 +63,13 @@ installdest:
  277.         chmod a+x $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/nfsurlconv
  278.         /usr/bin/ksh93 $(CYGWIN_MAKEFILE_DIR)/utils/nfsurlconv/nfsurlconv.ksh --nroff 2>"$(DESTDIR)/$(CYGWIN_BASEPATH)/usr/share/man/man1/nfsurlconv.1" || true
  279.         @ printf "# Package tests\n"
  280. -       cp "$(PROJECT_BASEDIR_DIR)/tests/winfsinfo1/winfsinfo.exe" $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/winfsinfo.exe
  281. +       cp "$(PROJECT_BASEDIR_DIR)/tests/winfsinfo1/winfsinfo.x86_64.exe" $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/winfsinfo.x86_64.exe
  282. +       cp "$(PROJECT_BASEDIR_DIR)/tests/winfsinfo1/winfsinfo.i686.exe" $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/winfsinfo.i686.exe
  283. +       if [[ "$(CYGWIN_BASEPATH)" == *64* ]] ; then \
  284. +               (cd $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/ && ln -sf winfsinfo.x86_64.exe winfsinfo.exe) \
  285. +       else \
  286. +               (cd $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/ && ln -sf winfsinfo.i686.exe winfsinfo.exe) \
  287. +       fi
  288.         @ printf "# Package ksh93&co (if available) since Cygwin does not ship with it yet\n"
  289.         [[ -x $(CYGWIN_BASEPATH)/bin/ksh93.exe ]] && cp $(CYGWIN_BASEPATH)/bin/ksh93.exe $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/ksh93.exe || true
  290.         [[ -x $(CYGWIN_BASEPATH)/bin/shcomp.exe ]] && cp $(CYGWIN_BASEPATH)/bin/shcomp.exe $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/shcomp.exe || true
  291. diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
  292. index e91340b..8f50fd0 100644
  293. --- a/cygwin/README.bintarball.txt
  294. +++ b/cygwin/README.bintarball.txt
  295. @@ -100,6 +100,11 @@ NFSv4.1 client and filesystem driver for Windows 10/11
  296.          libnfs (for /usr/bin/nfs-ls)
  297.          make
  298.          git
  299. +        gcc-core
  300. +        gcc-g++
  301. +        clang
  302. +        mingw64-i686-clang
  303. +        mingw64-x86_64-clang
  304.          dos2unix
  305.          unzip
  306.  
  307. diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
  308. index cade142..a5ff0c4 100644
  309. --- a/tests/manual_testing.txt
  310. +++ b/tests/manual_testing.txt
  311. @@ -12,6 +12,8 @@
  312.  #   gcc-core
  313.  #   gcc-g++
  314.  #   clang
  315. +#   mingw64-i686-clang
  316. +#   mingw64-x86_64-clang
  317.  #   gdb
  318.  #   make
  319.  #   netpbm
  320. diff --git a/tests/winfsinfo1/Makefile b/tests/winfsinfo1/Makefile
  321. index 91ef665..47ee557 100644
  322. --- a/tests/winfsinfo1/Makefile
  323. +++ b/tests/winfsinfo1/Makefile
  324. @@ -4,12 +4,20 @@
  325.  
  326.  # POSIX Makefile
  327.  
  328. -winfsinfo: winfsinfo.c
  329. -       gcc -Wall -DUNICODE=1 -D_UNICODE=1 -g winfsinfo.c -o winfsinfo
  330. +all: winfsinfo.i686.exe winfsinfo.x86_64.exe winfsinfo.exe
  331.  
  332. -all: winfsinfo
  333. +winfsinfo.i686.exe: winfsinfo.c
  334. +       clang -target i686-pc-windows-gnu -Wall -DUNICODE=1 -D_UNICODE=1 -g winfsinfo.c -o winfsinfo.i686.exe
  335. +
  336. +winfsinfo.x86_64.exe: winfsinfo.c
  337. +       clang -target x86_64-pc-windows-gnu -Wall -DUNICODE=1 -D_UNICODE=1 -g winfsinfo.c -o winfsinfo.x86_64.exe
  338. +
  339. +winfsinfo.exe: winfsinfo.x86_64.exe
  340. +       ln -s winfsinfo.x86_64.exe winfsinfo.exe
  341.  
  342.  clean:
  343.         rm -fv \
  344. -               winfsinfo.exe
  345. +               winfsinfo.i686.exe \
  346. +               winfsinfo.x86_64.exe \
  347. +               winfsinfo.exe \
  348.  # EOF.
  349. diff --git a/tests/winfsinfo1/winfsinfo.c b/tests/winfsinfo1/winfsinfo.c
  350. index d0cf0c9..9066056 100644
  351. --- a/tests/winfsinfo1/winfsinfo.c
  352. +++ b/tests/winfsinfo1/winfsinfo.c
  353. @@ -137,7 +137,8 @@ bool get_file_basic_info(const char *progname, const char *filename)
  354.  {
  355.      int res = EXIT_FAILURE;
  356.      bool ok;
  357. -    FILE_BASIC_INFO finfo = { 0 };
  358. +    FILE_BASIC_INFO finfo;
  359. +    (void)memset(&finfo, 0, sizeof(finfo));
  360.  
  361.      HANDLE fileHandle = CreateFileA(filename,
  362.          GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
  363. @@ -225,7 +226,8 @@ bool get_file_standard_info(const char *progname, const char *filename)
  364.  {
  365.      int res = EXIT_FAILURE;
  366.      bool ok;
  367. -    FILE_STANDARD_INFO finfo = { 0 };
  368. +    FILE_STANDARD_INFO finfo;
  369. +    (void)memset(&finfo, 0, sizeof(finfo));
  370.  
  371.      HANDLE fileHandle = CreateFileA(filename,
  372.          GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
  373. @@ -282,7 +284,8 @@ bool get_filenormalizednameinfo(const char *progname, const char *filename)
  374.  {
  375.      int res = EXIT_FAILURE;
  376.      bool ok;
  377. -    FILE_NAME_INFORMATION4096 finfo = { 0 };
  378. +    FILE_NAME_INFORMATION4096 finfo;
  379. +    (void)memset(&finfo, 0, sizeof(finfo));
  380.  
  381.      HANDLE fileHandle = CreateFileA(filename,
  382.          GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
  383. --
  384. 2.43.0
  385.  
  386. From c464d81a4e7f71b8b168e32a7f28d308ae990c79 Mon Sep 17 00:00:00 2001
  387. From: Roland Mainz <roland.mainz@nrubsig.org>
  388. Date: Wed, 22 May 2024 14:22:59 +0200
  389. Subject: [PATCH 04/10] cygwin: Fix Makefile "installdest" target if
  390.  ksh93/shcomp are not writeable
  391.  
  392. Fix Makefile "installdest" target if ksh93/shcomp are not writeable
  393.  
  394. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  395. ---
  396. cygwin/Makefile.install | 4 ++--
  397.  1 file changed, 2 insertions(+), 2 deletions(-)
  398.  
  399. diff --git a/cygwin/Makefile.install b/cygwin/Makefile.install
  400. index 57e6290..a9352bc 100644
  401. --- a/cygwin/Makefile.install
  402. +++ b/cygwin/Makefile.install
  403. @@ -71,8 +71,8 @@ installdest:
  404.                 (cd $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/ && ln -sf winfsinfo.i686.exe winfsinfo.exe) \
  405.         fi
  406.         @ printf "# Package ksh93&co (if available) since Cygwin does not ship with it yet\n"
  407. -       [[ -x $(CYGWIN_BASEPATH)/bin/ksh93.exe ]] && cp $(CYGWIN_BASEPATH)/bin/ksh93.exe $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/ksh93.exe || true
  408. -       [[ -x $(CYGWIN_BASEPATH)/bin/shcomp.exe ]] && cp $(CYGWIN_BASEPATH)/bin/shcomp.exe $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/shcomp.exe || true
  409. +       [[ -x $(CYGWIN_BASEPATH)/bin/ksh93.exe ]] && cp -f $(CYGWIN_BASEPATH)/bin/ksh93.exe $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/ksh93.exe || true
  410. +       [[ -x $(CYGWIN_BASEPATH)/bin/shcomp.exe ]] && cp -f $(CYGWIN_BASEPATH)/bin/shcomp.exe $(DESTDIR)/$(CYGWIN_BASEPATH)/bin/shcomp.exe || true
  411.         cp $(PROJECT_BASEDIR_DIR)/cygwin/cygwin_ksh93/ksh.kshrc $(DESTDIR)/$(CYGWIN_BASEPATH)/etc/ksh.kshrc
  412.         @ printf '# Packaging libs\n'
  413.         if [[ "$(CYGWIN_BASEPATH)" == *64* ]] ; then \
  414. --
  415. 2.43.0
  416.  
  417. From 4d6135c5d6aac997e57043c6e038d6024762ecdf Mon Sep 17 00:00:00 2001
  418. From: Roland Mainz <roland.mainz@nrubsig.org>
  419. Date: Wed, 22 May 2024 14:35:29 +0200
  420. Subject: [PATCH 05/10] tests: Wrong package name for "libncurses-devel" in
  421.  manual_testing.txt
  422.  
  423. Wrong package name for "libncurses-devel" in manual_testing.txt
  424.  
  425. Reported-by: Josh Hurst <joshhurst@gmail.com>
  426. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  427. ---
  428. tests/manual_testing.txt | 2 +-
  429.  1 file changed, 1 insertion(+), 1 deletion(-)
  430.  
  431. diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
  432. index a5ff0c4..50029e0 100644
  433. --- a/tests/manual_testing.txt
  434. +++ b/tests/manual_testing.txt
  435. @@ -21,7 +21,7 @@
  436.  #   subversion
  437.  #   cygport
  438.  #   dos2unix
  439. -#   ncurses-devel
  440. +#   libncurses-devel
  441.  #   libgmp-devel
  442.  #   libmpfr-devel
  443.  #   libmpc-devel
  444. --
  445. 2.43.0
  446.  
  447. From a945c69f856e203c32da7a61816b515182540e74 Mon Sep 17 00:00:00 2001
  448. From: Roland Mainz <roland.mainz@nrubsig.org>
  449. Date: Wed, 22 May 2024 15:14:50 +0200
  450. Subject: [PATCH 06/10] build.vc19,sys: Compile nfs41_driver.sys with
  451.  WarningLevel=Level4
  452.  
  453. Compile nfs41_driver.sys with WarningLevel=Level4
  454.  
  455. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  456. ---
  457. build.vc19/nfs41_driver/nfs41_driver.vcxproj | 32 ++++++++++----------
  458.  sys/nfs41_debug.h                            |  6 ++--
  459.  sys/nfs41_driver.c                           |  2 --
  460.  3 files changed, 19 insertions(+), 21 deletions(-)
  461.  
  462. diff --git a/build.vc19/nfs41_driver/nfs41_driver.vcxproj b/build.vc19/nfs41_driver/nfs41_driver.vcxproj
  463. index c7ed877..e71a2a9 100644
  464. --- a/build.vc19/nfs41_driver/nfs41_driver.vcxproj
  465. +++ b/build.vc19/nfs41_driver/nfs41_driver.vcxproj
  466. @@ -136,10 +136,10 @@
  467.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
  468.      <ClCompile>
  469.        <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  470. -      <WarningLevel>Level3</WarningLevel>
  471. +      <WarningLevel>Level4</WarningLevel>
  472.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  473.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  474. -      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd5104</AdditionalOptions>
  475. +      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  476.      </ClCompile>
  477.      <Link>
  478.        <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>
  479. @@ -148,10 +148,10 @@
  480.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
  481.      <ClCompile>
  482.        <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  483. -      <WarningLevel>Level3</WarningLevel>
  484. +      <WarningLevel>Level4</WarningLevel>
  485.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  486.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  487. -      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd5104</AdditionalOptions>
  488. +      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  489.      </ClCompile>
  490.      <Link>
  491.        <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>
  492. @@ -160,10 +160,10 @@
  493.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
  494.      <ClCompile>
  495.        <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  496. -      <WarningLevel>Level3</WarningLevel>
  497. +      <WarningLevel>Level4</WarningLevel>
  498.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  499.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  500. -      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd5104</AdditionalOptions>
  501. +      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  502.      </ClCompile>
  503.      <Link>
  504.        <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>
  505. @@ -172,10 +172,10 @@
  506.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  507.      <ClCompile>
  508.        <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  509. -      <WarningLevel>Level3</WarningLevel>
  510. +      <WarningLevel>Level4</WarningLevel>
  511.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  512.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  513. -      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd5104</AdditionalOptions>
  514. +      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  515.      </ClCompile>
  516.      <Link>
  517.        <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>
  518. @@ -184,10 +184,10 @@
  519.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
  520.      <ClCompile>
  521.        <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  522. -      <WarningLevel>Level3</WarningLevel>
  523. +      <WarningLevel>Level4</WarningLevel>
  524.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  525.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  526. -      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd5104</AdditionalOptions>
  527. +      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  528.      </ClCompile>
  529.      <Link>
  530.        <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>
  531. @@ -196,10 +196,10 @@
  532.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
  533.      <ClCompile>
  534.        <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  535. -      <WarningLevel>Level3</WarningLevel>
  536. +      <WarningLevel>Level4</WarningLevel>
  537.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  538.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  539. -      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd5104</AdditionalOptions>
  540. +      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  541.      </ClCompile>
  542.      <Link>
  543.        <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>
  544. @@ -208,10 +208,10 @@
  545.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
  546.      <ClCompile>
  547.        <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  548. -      <WarningLevel>Level3</WarningLevel>
  549. +      <WarningLevel>Level4</WarningLevel>
  550.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  551.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  552. -      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd5104</AdditionalOptions>
  553. +      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  554.      </ClCompile>
  555.      <Link>
  556.        <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>
  557. @@ -220,10 +220,10 @@
  558.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
  559.      <ClCompile>
  560.        <AdditionalIncludeDirectories>..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  561. -      <WarningLevel>Level3</WarningLevel>
  562. +      <WarningLevel>Level4</WarningLevel>
  563.        <PreprocessorDefinitions>EXPLODE_POOLTAGS;MONOLITHIC_MINIRDR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  564.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  565. -      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd5104</AdditionalOptions>
  566. +      <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
  567.      </ClCompile>
  568.      <Link>
  569.        <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>
  570. diff --git a/sys/nfs41_debug.h b/sys/nfs41_debug.h
  571. index a8f9f1c..7cea6bd 100644
  572. --- a/sys/nfs41_debug.h
  573. +++ b/sys/nfs41_debug.h
  574. @@ -75,9 +75,9 @@ const char *fsctl2string(ULONG fsctl);
  575.  #define DbgR() DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL, \
  576.          "<-- [%s] [%04x] %s\n", _DRIVER_NAME_, PsGetCurrentProcessShortDebugId(), __FUNCTION__); \
  577.          } except (EXCEPTION_EXECUTE_HANDLER) { \
  578. -            NTSTATUS status; \
  579. -            status = GetExceptionCode() ; \
  580. -            DbgP("Exception encountered with value = Ox%x\n", status); \
  581. +            NTSTATUS exc_status; \
  582. +            exc_status = GetExceptionCode() ; \
  583. +            DbgP("Exception encountered with value = Ox%x\n", (int)exc_status); \
  584.          }
  585.  
  586.  /* These are for ToasterDebugPrint */
  587. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  588. index 8579423..90613a4 100644
  589. --- a/sys/nfs41_driver.c
  590. +++ b/sys/nfs41_driver.c
  591. @@ -3585,8 +3585,6 @@ NTSTATUS nfs41_FinalizeVNetRoot(
  592.      IN PBOOLEAN ForceDisconnect)
  593.  {
  594.      NTSTATUS status = STATUS_SUCCESS;
  595. -    PNFS41_V_NET_ROOT_EXTENSION pVNetRootContext =
  596. -        NFS41GetVNetRootExtension(pVNetRoot);
  597.  #ifdef DEBUG_MOUNT
  598.      DbgEn();
  599.      print_v_net_root(1, pVNetRoot);
  600. --
  601. 2.43.0
  602.  
  603. From 2900967811542766feaf933bd06777f640d69904 Mon Sep 17 00:00:00 2001
  604. From: Roland Mainz <roland.mainz@nrubsig.org>
  605. Date: Wed, 22 May 2024 15:23:02 +0200
  606. Subject: [PATCH 07/10] build.vc19,mount: Compile nfs_mount with
  607.  WarningLevel=Level4
  608.  
  609. Compile nfs_mount with WarningLevel=Level4
  610.  
  611. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  612. ---
  613. build.vc19/nfs_mount/nfs_mount.vcxproj | 8 ++++----
  614.  mount/urlparser1.c                     | 8 ++++++++
  615.  2 files changed, 12 insertions(+), 4 deletions(-)
  616.  
  617. diff --git a/build.vc19/nfs_mount/nfs_mount.vcxproj b/build.vc19/nfs_mount/nfs_mount.vcxproj
  618. index 2e76397..100ba01 100644
  619. --- a/build.vc19/nfs_mount/nfs_mount.vcxproj
  620. +++ b/build.vc19/nfs_mount/nfs_mount.vcxproj
  621. @@ -85,7 +85,7 @@
  622.      <ClCompile>
  623.        <PrecompiledHeader>
  624.        </PrecompiledHeader>
  625. -      <WarningLevel>Level3</WarningLevel>
  626. +      <WarningLevel>Level4</WarningLevel>
  627.        <Optimization>Disabled</Optimization>
  628.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  629.        <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  630. @@ -102,7 +102,7 @@
  631.      <ClCompile>
  632.        <PrecompiledHeader>
  633.        </PrecompiledHeader>
  634. -      <WarningLevel>Level3</WarningLevel>
  635. +      <WarningLevel>Level4</WarningLevel>
  636.        <Optimization>Disabled</Optimization>
  637.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  638.        <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  639. @@ -117,7 +117,7 @@
  640.    </ItemDefinitionGroup>
  641.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  642.      <ClCompile>
  643. -      <WarningLevel>Level3</WarningLevel>
  644. +      <WarningLevel>Level4</WarningLevel>
  645.        <PrecompiledHeader>
  646.        </PrecompiledHeader>
  647.        <Optimization>MaxSpeed</Optimization>
  648. @@ -138,7 +138,7 @@
  649.    </ItemDefinitionGroup>
  650.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
  651.      <ClCompile>
  652. -      <WarningLevel>Level3</WarningLevel>
  653. +      <WarningLevel>Level4</WarningLevel>
  654.        <PrecompiledHeader>
  655.        </PrecompiledHeader>
  656.        <Optimization>MaxSpeed</Optimization>
  657. diff --git a/mount/urlparser1.c b/mount/urlparser1.c
  658. index 3de1047..a90d1e2 100644
  659. --- a/mount/urlparser1.c
  660. +++ b/mount/urlparser1.c
  661. @@ -38,6 +38,11 @@
  662.   * making this function safe
  663.   */
  664.  #pragma warning (disable : 4996)
  665. +/*
  666. + * Disable "warning C4706: assignment within conditional expression"
  667. + * because it is safe to use in our code.
  668. + */
  669. +#pragma warning (disable : 4706)
  670.  
  671.  /*
  672.   * Original extended regular expression:
  673. @@ -124,6 +129,9 @@ url_parser_context *url_parser_create_context(const char *in_url, unsigned int f
  674.         size_t in_url_len;
  675.         size_t context_len;
  676.  
  677. +       /* |flags| is for future extensions */
  678. +       (void)flags;
  679. +
  680.         if (!in_url)
  681.                 return NULL;
  682.  
  683. --
  684. 2.43.0
  685.  
  686. From a9f4703ca16b0436ad334ff3e7d9eb70782dabac Mon Sep 17 00:00:00 2001
  687. From: Roland Mainz <roland.mainz@nrubsig.org>
  688. Date: Wed, 22 May 2024 15:31:01 +0200
  689. Subject: [PATCH 08/10] build.vc19: Compile nfs41_np with WarningLevel=Level4
  690.  
  691. Compile nfs41_np with WarningLevel=Level4
  692.  
  693. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  694. ---
  695. build.vc19/nfs41_np/nfs41_np.vcxproj | 12 ++++++++----
  696.  1 file changed, 8 insertions(+), 4 deletions(-)
  697.  
  698. diff --git a/build.vc19/nfs41_np/nfs41_np.vcxproj b/build.vc19/nfs41_np/nfs41_np.vcxproj
  699. index 846ce86..cbe68df 100644
  700. --- a/build.vc19/nfs41_np/nfs41_np.vcxproj
  701. +++ b/build.vc19/nfs41_np/nfs41_np.vcxproj
  702. @@ -85,12 +85,13 @@
  703.      <ClCompile>
  704.        <PrecompiledHeader>
  705.        </PrecompiledHeader>
  706. -      <WarningLevel>Level3</WarningLevel>
  707. +      <WarningLevel>Level4</WarningLevel>
  708.        <Optimization>Disabled</Optimization>
  709.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  710.        <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  711.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  712.        <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  713. +      <AdditionalOptions>/wd4100</AdditionalOptions>
  714.      </ClCompile>
  715.      <Link>
  716.        <SubSystem>Windows</SubSystem>
  717. @@ -102,12 +103,13 @@
  718.      <ClCompile>
  719.        <PrecompiledHeader>
  720.        </PrecompiledHeader>
  721. -      <WarningLevel>Level3</WarningLevel>
  722. +      <WarningLevel>Level4</WarningLevel>
  723.        <Optimization>Disabled</Optimization>
  724.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  725.        <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  726.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  727.        <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  728. +      <AdditionalOptions>/wd4100</AdditionalOptions>
  729.      </ClCompile>
  730.      <Link>
  731.        <SubSystem>Windows</SubSystem>
  732. @@ -117,7 +119,7 @@
  733.    </ItemDefinitionGroup>
  734.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  735.      <ClCompile>
  736. -      <WarningLevel>Level3</WarningLevel>
  737. +      <WarningLevel>Level4</WarningLevel>
  738.        <PrecompiledHeader>
  739.        </PrecompiledHeader>
  740.        <Optimization>MaxSpeed</Optimization>
  741. @@ -127,6 +129,7 @@
  742.        <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  743.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  744.        <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  745. +      <AdditionalOptions>/wd4100</AdditionalOptions>
  746.      </ClCompile>
  747.      <Link>
  748.        <SubSystem>Windows</SubSystem>
  749. @@ -138,7 +141,7 @@
  750.    </ItemDefinitionGroup>
  751.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
  752.      <ClCompile>
  753. -      <WarningLevel>Level3</WarningLevel>
  754. +      <WarningLevel>Level4</WarningLevel>
  755.        <PrecompiledHeader>
  756.        </PrecompiledHeader>
  757.        <Optimization>MaxSpeed</Optimization>
  758. @@ -148,6 +151,7 @@
  759.        <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  760.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  761.        <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  762. +      <AdditionalOptions>/wd4100</AdditionalOptions>
  763.      </ClCompile>
  764.      <Link>
  765.        <SubSystem>Windows</SubSystem>
  766. --
  767. 2.43.0
  768.  
  769. From ef8c30910ce6d8a644255e58b2004eedd0abbc9c Mon Sep 17 00:00:00 2001
  770. From: Roland Mainz <roland.mainz@nrubsig.org>
  771. Date: Wed, 22 May 2024 15:44:17 +0200
  772. Subject: [PATCH 09/10] build.vc19,install: Build nfs_install with
  773.  WarningLevel=Level4
  774.  
  775. Build nfs_install with WarningLevel=Level4
  776.  
  777. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  778. ---
  779. build.vc19/nfs_install/nfs_install.vcxproj |  8 ++++----
  780.  install/nfs_install.c                      | 14 ++++++--------
  781.  2 files changed, 10 insertions(+), 12 deletions(-)
  782.  
  783. diff --git a/build.vc19/nfs_install/nfs_install.vcxproj b/build.vc19/nfs_install/nfs_install.vcxproj
  784. index 4ceb221..6d1d029 100644
  785. --- a/build.vc19/nfs_install/nfs_install.vcxproj
  786. +++ b/build.vc19/nfs_install/nfs_install.vcxproj
  787. @@ -85,7 +85,7 @@
  788.      <ClCompile>
  789.        <PrecompiledHeader>
  790.        </PrecompiledHeader>
  791. -      <WarningLevel>Level3</WarningLevel>
  792. +      <WarningLevel>Level4</WarningLevel>
  793.        <Optimization>Disabled</Optimization>
  794.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  795.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  796. @@ -101,7 +101,7 @@
  797.      <ClCompile>
  798.        <PrecompiledHeader>
  799.        </PrecompiledHeader>
  800. -      <WarningLevel>Level3</WarningLevel>
  801. +      <WarningLevel>Level4</WarningLevel>
  802.        <Optimization>Disabled</Optimization>
  803.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  804.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  805. @@ -115,7 +115,7 @@
  806.    </ItemDefinitionGroup>
  807.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  808.      <ClCompile>
  809. -      <WarningLevel>Level3</WarningLevel>
  810. +      <WarningLevel>Level4</WarningLevel>
  811.        <PrecompiledHeader>
  812.        </PrecompiledHeader>
  813.        <Optimization>MaxSpeed</Optimization>
  814. @@ -135,7 +135,7 @@
  815.    </ItemDefinitionGroup>
  816.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
  817.      <ClCompile>
  818. -      <WarningLevel>Level3</WarningLevel>
  819. +      <WarningLevel>Level4</WarningLevel>
  820.        <PrecompiledHeader>
  821.        </PrecompiledHeader>
  822.        <Optimization>MaxSpeed</Optimization>
  823. diff --git a/install/nfs_install.c b/install/nfs_install.c
  824. index a686318..9d75552 100644
  825. --- a/install/nfs_install.c
  826. +++ b/install/nfs_install.c
  827. @@ -112,7 +112,7 @@ int main(int ac, char *av[])
  828.      if (dataSize > 0) {
  829.          /* Read the existing data */
  830.          result = RegQueryValueExA(hKey, "ProviderOrder", NULL, NULL,
  831. -            originalValue, &dataSize);
  832. +            (BYTE *)originalValue, &dataSize);
  833.          if (result != ERROR_SUCCESS) {
  834.              (void)fprintf(stderr, "%s: Error reading registry value: %d\n",
  835.                  av[0], result);
  836. @@ -165,12 +165,10 @@ int main(int ac, char *av[])
  837.          char *s;
  838.  
  839.          DPRINTF(1, ("# value before removal '%s'\n", new_buffer));
  840. -        while (s = strstr(new_buffer, PROVIDER_NAME_COMMA)) {
  841. -            if (s) {
  842. -                char *end = s+strlen(PROVIDER_NAME_COMMA);
  843. -                (void)memmove(s, end, strlen(end)+1);
  844. -                DPRINTF(1, ("# value after removal '%s'\n", new_buffer));
  845. -            }
  846. +        while ((s = strstr(new_buffer, PROVIDER_NAME_COMMA)) != NULL) {
  847. +            char *end = s+strlen(PROVIDER_NAME_COMMA);
  848. +            (void)memmove(s, end, strlen(end)+1);
  849. +            DPRINTF(1, ("# value after removal '%s'\n", new_buffer));
  850.          }
  851.  
  852.          if (!strcmp(new_buffer, PROVIDER_NAME)) {
  853. @@ -184,7 +182,7 @@ int main(int ac, char *av[])
  854.       * Set the new value of the ProviderOrder key
  855.       */
  856.      result = RegSetValueExA(hKey, "ProviderOrder", 0, REG_SZ,
  857. -        new_buffer, (DWORD)strlen(new_buffer));
  858. +        (BYTE *)new_buffer, (DWORD)strlen(new_buffer));
  859.  
  860.      if (result != ERROR_SUCCESS) {
  861.          (void)fprintf(stderr, "%s: Error setting registry value: %d\n",
  862. --
  863. 2.43.0
  864.  
  865. From b55074ba46369ea7474f7395ebeaad96dd7ae66f Mon Sep 17 00:00:00 2001
  866. From: Roland Mainz <roland.mainz@nrubsig.org>
  867. Date: Wed, 22 May 2024 17:00:53 +0200
  868. Subject: [PATCH 10/10] build.vc19,daemon: Compile daemon with
  869.  WarningLevel=Level4
  870.  
  871. Compile daemon with WarningLevel=Level4
  872.  
  873. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  874. ---
  875. build.vc19/nfsd/nfsd.vcxproj | 12 ++++++---
  876.  daemon/daemon_debug.h        |  9 +++++++
  877.  daemon/idmap.c               | 10 +++++++-
  878.  daemon/idmap_cygwin.c        |  6 ++---
  879.  daemon/mount.c               |  5 ++--
  880.  daemon/name_cache.c          |  4 +--
  881.  daemon/nfs41.h               |  8 ++++++
  882.  daemon/nfs41_ops.c           |  8 +++---
  883.  daemon/open.c                | 11 +++++----
  884.  daemon/service.c             |  2 +-
  885.  daemon/sid.c                 | 17 +++++++------
  886.  daemon/util.c                | 47 +++++++++++++++++++-----------------
  887.  12 files changed, 87 insertions(+), 52 deletions(-)
  888.  
  889. diff --git a/build.vc19/nfsd/nfsd.vcxproj b/build.vc19/nfsd/nfsd.vcxproj
  890. index 47d4092..c5b93e9 100644
  891. --- a/build.vc19/nfsd/nfsd.vcxproj
  892. +++ b/build.vc19/nfsd/nfsd.vcxproj
  893. @@ -85,7 +85,7 @@
  894.      <ClCompile>
  895.        <PrecompiledHeader>
  896.        </PrecompiledHeader>
  897. -      <WarningLevel>Level3</WarningLevel>
  898. +      <WarningLevel>Level4</WarningLevel>
  899.        <Optimization>Disabled</Optimization>
  900.        <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>
  901.        <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  902. @@ -94,6 +94,7 @@
  903.        <BufferSecurityCheck>false</BufferSecurityCheck>
  904.        <StringPooling>true</StringPooling>
  905.        <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  906. +      <AdditionalOptions>/wd4100</AdditionalOptions>
  907.      </ClCompile>
  908.      <Link>
  909.        <SubSystem>Console</SubSystem>
  910. @@ -105,7 +106,7 @@
  911.      <ClCompile>
  912.        <PrecompiledHeader>
  913.        </PrecompiledHeader>
  914. -      <WarningLevel>Level3</WarningLevel>
  915. +      <WarningLevel>Level4</WarningLevel>
  916.        <Optimization>Disabled</Optimization>
  917.        <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>
  918.        <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;..\..\sys;..\..\dll;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  919. @@ -114,6 +115,7 @@
  920.        <BufferSecurityCheck>false</BufferSecurityCheck>
  921.        <StringPooling>true</StringPooling>
  922.        <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  923. +      <AdditionalOptions>/wd4100</AdditionalOptions>
  924.      </ClCompile>
  925.      <Link>
  926.        <SubSystem>Console</SubSystem>
  927. @@ -123,7 +125,7 @@
  928.    </ItemDefinitionGroup>
  929.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  930.      <ClCompile>
  931. -      <WarningLevel>Level3</WarningLevel>
  932. +      <WarningLevel>Level4</WarningLevel>
  933.        <PrecompiledHeader>
  934.        </PrecompiledHeader>
  935.        <Optimization>MaxSpeed</Optimization>
  936. @@ -135,6 +137,7 @@
  937.        <BufferSecurityCheck>false</BufferSecurityCheck>
  938.        <StringPooling>true</StringPooling>
  939.        <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  940. +      <AdditionalOptions>/wd4100</AdditionalOptions>
  941.      </ClCompile>
  942.      <Link>
  943.        <SubSystem>Console</SubSystem>
  944. @@ -146,7 +149,7 @@
  945.    </ItemDefinitionGroup>
  946.    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
  947.      <ClCompile>
  948. -      <WarningLevel>Level3</WarningLevel>
  949. +      <WarningLevel>Level4</WarningLevel>
  950.        <PrecompiledHeader>
  951.        </PrecompiledHeader>
  952.        <Optimization>MaxSpeed</Optimization>
  953. @@ -158,6 +161,7 @@
  954.        <BufferSecurityCheck>false</BufferSecurityCheck>
  955.        <StringPooling>true</StringPooling>
  956.        <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  957. +      <AdditionalOptions>/wd4100</AdditionalOptions>
  958.      </ClCompile>
  959.      <Link>
  960.        <SubSystem>Console</SubSystem>
  961. diff --git a/daemon/daemon_debug.h b/daemon/daemon_debug.h
  962. index 813dc71..8f0c166 100644
  963. --- a/daemon/daemon_debug.h
  964. +++ b/daemon/daemon_debug.h
  965. @@ -37,12 +37,21 @@
  966.  
  967.  
  968.  /* 0xdd..dd is the filler by the debug memory allocator */
  969. +#ifdef _WIN64
  970.  #define DEBUG_IS_VALID_NON_NULL_PTR(ptr) \
  971.      ( \
  972.          (((char *)(ptr)) != ((char *)0xddddddddddddddddLL)) && \
  973.          (((char *)(ptr)) != ((char *)0xffffffffffffffffLL)) && \
  974.          ((ptr) != NULL) \
  975.      )
  976. +#else
  977. +#define DEBUG_IS_VALID_NON_NULL_PTR(ptr) \
  978. +    ( \
  979. +        (((char *)(ptr)) != ((char *)0xddddddddL)) && \
  980. +        (((char *)(ptr)) != ((char *)0xffffffffL)) && \
  981. +        ((ptr) != NULL) \
  982. +    )
  983. +#endif /* _WIN64 */
  984.  
  985.  #define EASSERT(exp) \
  986.      if (!(exp)) { \
  987. diff --git a/daemon/idmap.c b/daemon/idmap.c
  988. index 42c969c..0b44fc1 100644
  989. --- a/daemon/idmap.c
  990. +++ b/daemon/idmap.c
  991. @@ -654,12 +654,14 @@ static int idmap_lookup_user(
  992.      struct idmap_user *user)
  993.  {
  994.      PCHAR* values[NUM_ATTRIBUTES] = { NULL };
  995. +#ifndef NFS41_DRIVER_FEATURE_IDMAPPER_CYGWIN
  996.      const unsigned attributes = ATTR_FLAG(ATTR_USER_NAME)
  997.          | ATTR_FLAG(ATTR_PRINCIPAL)
  998.          | ATTR_FLAG(ATTR_UID)
  999.          | ATTR_FLAG(ATTR_GID);
  1000.      /* principal is optional; we'll cache it if we have it */
  1001.      const unsigned optional = ATTR_FLAG(ATTR_PRINCIPAL);
  1002. +#endif /* !NFS41_DRIVER_FEATURE_IDMAPPER_CYGWIN */
  1003.      int i, status;
  1004.  
  1005.      /* check the user cache for an existing entry */
  1006. @@ -742,7 +744,7 @@ static int idmap_lookup_user(
  1007.           * fixme: This does not work with multiple domains
  1008.           */
  1009.          (void)strcpy_s(search_name, sizeof(search_name), lookup->value);
  1010. -        if (s = strchr(search_name, '@'))
  1011. +        if ((s = strchr(search_name, '@')) != NULL)
  1012.              *s = '\0';
  1013.  
  1014.          if (!cygwin_getent_passwd(search_name, NULL, &cy_uid, &cy_gid)) {
  1015. @@ -805,7 +807,9 @@ static int idmap_lookup_user(
  1016.          /* insert the entry into the cache */
  1017.          cache_insert(&context->users, lookup, &user->entry);
  1018.      }
  1019. +#ifndef NFS41_DRIVER_FEATURE_IDMAPPER_CYGWIN
  1020.  out_free_values:
  1021. +#endif
  1022.      for (i = 0; i < NUM_ATTRIBUTES; i++)
  1023.          ldap_value_freeA(values[i]);
  1024.  out:
  1025. @@ -818,8 +822,10 @@ static int idmap_lookup_group(
  1026.      struct idmap_group *group)
  1027.  {
  1028.      PCHAR* values[NUM_ATTRIBUTES] = { NULL };
  1029. +#ifndef NFS41_DRIVER_FEATURE_IDMAPPER_CYGWIN
  1030.      const unsigned attributes = ATTR_FLAG(ATTR_GROUP_NAME)
  1031.          | ATTR_FLAG(ATTR_GID);
  1032. +#endif
  1033.      int i, status;
  1034.  
  1035.      /* check the group cache for an existing entry */
  1036. @@ -906,7 +912,9 @@ static int idmap_lookup_group(
  1037.          /* insert the entry into the cache */
  1038.          cache_insert(&context->groups, lookup, &group->entry);
  1039.      }
  1040. +#ifndef NFS41_DRIVER_FEATURE_IDMAPPER_CYGWIN
  1041.  out_free_values:
  1042. +#endif
  1043.      for (i = 0; i < NUM_ATTRIBUTES; i++)
  1044.          ldap_value_freeA(values[i]);
  1045.  out:
  1046. diff --git a/daemon/idmap_cygwin.c b/daemon/idmap_cygwin.c
  1047. index 5f1b020..3d4a1be 100644
  1048. --- a/daemon/idmap_cygwin.c
  1049. +++ b/daemon/idmap_cygwin.c
  1050. @@ -56,8 +56,8 @@ int cygwin_getent_passwd(const char *name, char *res_loginname, uid_t *res_uid,
  1051.      DWORD num_buff_read;
  1052.      subcmd_popen_context *script_pipe = NULL;
  1053.      int res = 1;
  1054. -    unsigned long uid = -1;
  1055. -    unsigned long gid = -1;
  1056. +    unsigned long uid = ~0UL;
  1057. +    unsigned long gid = ~0UL;
  1058.      void *cpvp = NULL;
  1059.      int numcnv = 0;
  1060.      int i = 0;
  1061. @@ -171,7 +171,7 @@ int cygwin_getent_group(const char* name, char* res_group_name, gid_t* res_gid)
  1062.      DWORD num_buff_read;
  1063.      subcmd_popen_context *script_pipe = NULL;
  1064.      int res = 1;
  1065. -    unsigned long gid = -1;
  1066. +    unsigned long gid = ~0UL;
  1067.      void *cpvp = NULL;
  1068.      int numcnv = 0;
  1069.      int i = 0;
  1070. diff --git a/daemon/mount.c b/daemon/mount.c
  1071. index 20f0485..89bf8d4 100644
  1072. --- a/daemon/mount.c
  1073. +++ b/daemon/mount.c
  1074. @@ -66,7 +66,7 @@ static int handle_mount(void *daemon_context, nfs41_upcall *upcall)
  1075.      int port = 0;
  1076.      nfs41_abs_path path;
  1077.      multi_addr4 addrs = { 0 };
  1078. -    nfs41_root *root;
  1079. +    nfs41_root *root = NULL;
  1080.      nfs41_client *client;
  1081.      nfs41_path_fh file;
  1082.  
  1083. @@ -89,7 +89,8 @@ static int handle_mount(void *daemon_context, nfs41_upcall *upcall)
  1084.      }
  1085.  
  1086.      (void)strcpy_s(hostname, sizeof(hostname), args->hostport);
  1087. -    if (s = strchr(hostname, '@')) {
  1088. +    s = strchr(hostname, '@');
  1089. +    if (s) {
  1090.          *s++ = '\0';
  1091.         port = atoi(s);
  1092.         if ((port < 1) || (port > 65535)) {
  1093. diff --git a/daemon/name_cache.c b/daemon/name_cache.c
  1094. index a556235..9753cb7 100644
  1095. --- a/daemon/name_cache.c
  1096. +++ b/daemon/name_cache.c
  1097. @@ -997,8 +997,8 @@ int nfs41_name_cache_insert(
  1098.      if (path == NULL || name == NULL || name->len == 0) {
  1099.          /* create the root entry if it doesn't exist */
  1100.          if (cache->root == NULL) {
  1101. -            const nfs41_component name = { "ROOT", 4 };
  1102. -            status = name_cache_entry_create(cache, &name, &cache->root);
  1103. +            const nfs41_component nc_name = { "ROOT", 4 };
  1104. +            status = name_cache_entry_create(cache, &nc_name, &cache->root);
  1105.              if (status)
  1106.                  goto out_err_deleg;
  1107.          }
  1108. diff --git a/daemon/nfs41.h b/daemon/nfs41.h
  1109. index 875a054..f1617a9 100644
  1110. --- a/daemon/nfs41.h
  1111. +++ b/daemon/nfs41.h
  1112. @@ -85,7 +85,11 @@ typedef struct __nfs41_server {
  1113.      nfs41_superblock_list superblocks;
  1114.      struct nfs41_name_cache *name_cache;
  1115.      struct list_entry entry; /* position in global server list */
  1116. +#pragma warning( push )
  1117. +/* Ignore "C4324: structure was padded due to alignment specifier" */
  1118. +#pragma warning (disable : 4324)
  1119.      __declspec(align(8)) volatile LONG ref_count;
  1120. +#pragma warning( pop )
  1121.  } nfs41_server;
  1122.  
  1123.  enum delegation_status {
  1124. @@ -297,7 +301,11 @@ typedef struct __nfs41_root {
  1125.      struct list_entry clients;
  1126.      uint32_t wsize;
  1127.      uint32_t rsize;
  1128. +#pragma warning( push )
  1129. +/* Ignore "C4324: structure was padded due to alignment specifier" */
  1130. +#pragma warning (disable : 4324)
  1131.      __declspec(align(8)) volatile LONG ref_count;
  1132. +#pragma warning( pop )
  1133.      uint32_t uid;
  1134.      uint32_t gid;
  1135.      DWORD sec_flavor;
  1136. diff --git a/daemon/nfs41_ops.c b/daemon/nfs41_ops.c
  1137. index edd0b94..6aa2ff7 100644
  1138. --- a/daemon/nfs41_ops.c
  1139. +++ b/daemon/nfs41_ops.c
  1140. @@ -71,10 +71,10 @@ int nfs41_exchange_id(
  1141.      compound_add_op(&compound, OP_EXCHANGE_ID, &ex_id, res_out);
  1142.  
  1143.      /* gisburn: fixme: We do not have that domain yet */
  1144. -    impl_id.nii_domain      = "msnfs41client.org";
  1145. -    impl_id.nii_domain_len  = (uint32_t)strlen(impl_id.nii_domain);
  1146. -    impl_id.nii_name        = nfs41_dg.nfs41_nii_name;
  1147. -    impl_id.nii_name_len    = (uint32_t)strlen(impl_id.nii_name);
  1148. +    impl_id.nii_domain      = (unsigned char *)"msnfs41client.org";
  1149. +    impl_id.nii_domain_len  = (uint32_t)strlen((const char *)impl_id.nii_domain);
  1150. +    impl_id.nii_name        = (unsigned char *)nfs41_dg.nfs41_nii_name;
  1151. +    impl_id.nii_name_len    = (uint32_t)strlen((const char *)impl_id.nii_name);
  1152.      /*
  1153.       * gisburn: fixme: |impl_id.nii_date| should be the timestamp
  1154.       * of the binary
  1155. diff --git a/daemon/open.c b/daemon/open.c
  1156. index 6ac0f2b..5012bbf 100644
  1157. --- a/daemon/open.c
  1158. +++ b/daemon/open.c
  1159. @@ -775,8 +775,8 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
  1160.  
  1161.  #ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
  1162.          char owner[NFS4_OPAQUE_LIMIT], owner_group[NFS4_OPAQUE_LIMIT];
  1163. -        uid_t map_uid = -1;
  1164. -        gid_t map_gid = -1;
  1165. +        uid_t map_uid = ~0UL;
  1166. +        gid_t map_gid = ~0UL;
  1167.          char *at_ch; /* pointer to '@' */
  1168.  
  1169.  #if 1
  1170. @@ -785,7 +785,6 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
  1171.              ((info.attrmask.arr[1] & FATTR4_WORD1_OWNER_GROUP) == 0)) {
  1172.              bitmap4 og_attr_request = { 0 };
  1173.              nfs41_file_info og_info = { 0 };
  1174. -            nfsacl41 acl = { 0 };
  1175.  
  1176.              og_attr_request.count = 2;
  1177.              og_attr_request.arr[1] =
  1178. @@ -831,7 +830,8 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
  1179.           *  ("gisburn") or username@domain ("gisburn@sun.com")
  1180.           */
  1181.          /* stomp over '@' */
  1182. -        if (at_ch = strchr(owner, '@'))
  1183. +        at_ch = strchr(owner, '@');
  1184. +        if (at_ch)
  1185.              *at_ch = '\0';
  1186.  
  1187.          if (nfs41_idmap_name_to_uid(
  1188. @@ -855,7 +855,8 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
  1189.           * ("gisgrp") or username@domain ("gisgrp@sun.com")
  1190.           */
  1191.          /* stomp over '@' */
  1192. -        if (at_ch = strchr(owner_group, '@'))
  1193. +        at_ch = strchr(owner_group, '@');
  1194. +        if (at_ch)
  1195.              *at_ch = '\0';
  1196.  
  1197.          if (nfs41_idmap_group_to_gid(
  1198. diff --git a/daemon/service.c b/daemon/service.c
  1199. index ba6a100..714f66b 100644
  1200. --- a/daemon/service.c
  1201. +++ b/daemon/service.c
  1202. @@ -495,7 +495,7 @@ void CmdRemoveService()
  1203.  //
  1204.  void CmdDebugService(int argc, char ** argv)
  1205.  {
  1206. -   DWORD dwArgc;
  1207. +   int dwArgc;
  1208.     LPTSTR *lpszArgv;
  1209.  
  1210.  #ifdef UNICODE
  1211. diff --git a/daemon/sid.c b/daemon/sid.c
  1212. index 94128d9..bde099a 100644
  1213. --- a/daemon/sid.c
  1214. +++ b/daemon/sid.c
  1215. @@ -406,11 +406,12 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
  1216.  #ifdef NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID
  1217.      /* use our own idmapper script to map nfsv4 owner string to local Windows account */
  1218.      if (query & OWNER_SECURITY_INFORMATION) {
  1219. -        uid_t udummy = -1;
  1220. -        gid_t gdummy = -1;
  1221. +        uid_t udummy = ~0UL;
  1222. +        gid_t gdummy = ~0UL;
  1223.  
  1224.  #ifdef NFS41_DRIVER_SID_CACHE
  1225. -        if (*sid = sidcache_getcached_byname(&user_sidcache, nfsname)) {
  1226. +        *sid = sidcache_getcached_byname(&user_sidcache, nfsname);
  1227. +        if (*sid) {
  1228.              *sid_len = GetLengthSid(*sid);
  1229.              DPRINTF(1, ("map_nfs4servername_2_sid: returning cached sid for user '%s'\n", nfsname));
  1230.              status = 0;
  1231. @@ -437,10 +438,11 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
  1232.  #ifdef NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID
  1233.      /* use our own idmapper script to map nfsv4 owner string to local Windows account */
  1234.      if (query & GROUP_SECURITY_INFORMATION) {
  1235. -        gid_t gdummy = -1;
  1236. +        gid_t gdummy = ~0UL;
  1237.  
  1238.  #ifdef NFS41_DRIVER_SID_CACHE
  1239. -        if (*sid = sidcache_getcached_byname(&group_sidcache, nfsname)) {
  1240. +        *sid = sidcache_getcached_byname(&group_sidcache, nfsname);
  1241. +        if (*sid) {
  1242.              *sid_len = GetLengthSid(*sid);
  1243.              DPRINTF(1, ("map_nfs4servername_2_sid: returning cached sid for group '%s'\n", nfsname));
  1244.              status = 0;
  1245. @@ -516,8 +518,7 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
  1246.              query, nfsname));
  1247.  
  1248.          if ((user_uid == -1) && (query & OWNER_SECURITY_INFORMATION)) {
  1249. -            uid_t map_uid = -1;
  1250. -            gid_t gid_dummy = -1;
  1251. +            uid_t map_uid = ~0UL;
  1252.  
  1253.              if (nfs41_idmap_name_to_uid(nfs41dg->idmapper,
  1254.                  nfsname, &map_uid) == 0) {
  1255. @@ -533,7 +534,7 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
  1256.          }
  1257.  
  1258.          if ((group_gid == -1) && (query & GROUP_SECURITY_INFORMATION)) {
  1259. -            gid_t map_gid = -1;
  1260. +            gid_t map_gid = ~0UL;
  1261.  
  1262.              if (nfs41_idmap_group_to_gid(
  1263.                  nfs41dg->idmapper,
  1264. diff --git a/daemon/util.c b/daemon/util.c
  1265. index 9ea2b77..d38e65b 100644
  1266. --- a/daemon/util.c
  1267. +++ b/daemon/util.c
  1268. @@ -604,15 +604,15 @@ subcmd_popen_context *subcmd_popen(const char *command)
  1269.          goto fail;
  1270.      }
  1271.  
  1272. -    CloseHandle(pinfo->hWritePipe);
  1273. +    (void)CloseHandle(pinfo->hWritePipe);
  1274.  
  1275.      return pinfo;
  1276.  fail:
  1277.      if (pinfo) {
  1278.          if (pinfo->hReadPipe)
  1279. -            CloseHandle(pinfo->hReadPipe);
  1280. +            (void)CloseHandle(pinfo->hReadPipe);
  1281.          if (pinfo->hWritePipe)
  1282. -            CloseHandle(pinfo->hWritePipe);
  1283. +            (void)CloseHandle(pinfo->hWritePipe);
  1284.  
  1285.          free(pinfo);
  1286.      }
  1287. @@ -624,17 +624,18 @@ int subcmd_pclose(subcmd_popen_context *pinfo)
  1288.      DWORD status;
  1289.  
  1290.      /* Close the read handle to the pipe from the child process */
  1291. -    CloseHandle(pinfo->hReadPipe);
  1292. +    (void)CloseHandle(pinfo->hReadPipe);
  1293.  
  1294.      status = WaitForSingleObjectEx(pinfo->pi.hProcess, INFINITE, FALSE);
  1295.      EASSERT(status == WAIT_OBJECT_0);
  1296.  
  1297.      if (!GetExitCodeProcess(pinfo->pi.hProcess, &status)) {
  1298. -        status = -1;
  1299. +        /* fixme: We need a better error code */
  1300. +        status = ERROR_INVALID_ACCESS;
  1301.      }
  1302.  
  1303. -    CloseHandle(pinfo->pi.hProcess);
  1304. -    CloseHandle(pinfo->pi.hThread);
  1305. +    (void)CloseHandle(pinfo->pi.hProcess);
  1306. +    (void)CloseHandle(pinfo->pi.hThread);
  1307.  
  1308.      if (status != 0) {
  1309.          DPRINTF(0, ("subcmd_pclose(): exit code=%d\n", (int)status));
  1310. @@ -703,27 +704,29 @@ bool_t waitcriticalsection(LPCRITICAL_SECTION cs)
  1311.   * is a private API, but it should be safe to use as Cygwin and
  1312.   * other software relies on it
  1313.   */
  1314. +#ifdef _WIN64
  1315. +/*
  1316. + * Windows private API, so we add prototype here ourselves
  1317. + *
  1318. + * Note that this currently only works with 64bit Windows,
  1319. + * 32bit Windows generates this build error:
  1320. + * ---- snip ----
  1321. + * util.obj : error LNK2019: unresolved external symbol __RtlGetNtVersionNumbers referenced in function _getwinntversionnnumbers
  1322. + * ---- snip ----
  1323. + */
  1324. +/*
  1325. + * Reference:
  1326. + * https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/wincap.cc
  1327. + */
  1328. +NTSTATUS RtlGetNtVersionNumbers(LPDWORD, LPDWORD, LPDWORD);
  1329. +#endif /* _WIN64 */
  1330. +
  1331.  bool getwinntversionnnumbers(
  1332.      DWORD *MajorVersionPtr,
  1333.      DWORD *MinorVersionPtr,
  1334.      DWORD *BuildNumberPtr)
  1335.  {
  1336.  #ifdef _WIN64
  1337. -    /*
  1338. -     * Windows private API, so we add prototype here ourselves
  1339. -     *
  1340. -     * Note that this currently only works with 64bit Windows,
  1341. -     * 32bit Windows generates this build error:
  1342. -     * ---- snip ----
  1343. -     * util.obj : error LNK2019: unresolved external symbol __RtlGetNtVersionNumbers referenced in function _getwinntversionnnumbers
  1344. -     * ---- snip ----
  1345. -     */
  1346. -    NTSTATUS RtlGetNtVersionNumbers(LPDWORD, LPDWORD, LPDWORD);
  1347. -
  1348. -    /*
  1349. -     * Reference:
  1350. -     * https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/wincap.cc
  1351. -     */
  1352.      (void)RtlGetNtVersionNumbers(MajorVersionPtr, MinorVersionPtr, BuildNumberPtr);
  1353.      *BuildNumberPtr &= 0xffff;
  1354.  
  1355. --
  1356. 2.43.0

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.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at