pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for VC static runtime, 2024-01-01
Posted by Anonymous on Tue 2nd Jan 2024 00:54
raw | new post

  1. From 164c91ce0e659bb434916e9dffb9b43ab8b43af7 Mon Sep 17 00:00:00 2001
  2. From: Dan Shelton <dan.f.shelton@gmail.com>
  3. Date: Mon, 1 Jan 2024 20:18:23 +0100
  4. Subject: [PATCH 1/3] Link VC19 runtime libraries statically
  5.  
  6. Remove dependency to VCRUNTIME140D.dll and ucrtbased.dll
  7. by statically linking the Visual Studio 19 runtime libraries.
  8.  
  9. Fixes nfs_install, nfs_mount and nfsd_debug not working on stock
  10. Windows 11 without Visual Studio 19.
  11.  
  12. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  13. ---
  14. build.vc19/libtirpc/libtirpc.vcxproj       | 4 ++++
  15.  build.vc19/nfs41_np/nfs41_np.vcxproj       | 4 ++++
  16.  build.vc19/nfs_install/nfs_install.vcxproj | 4 ++++
  17.  build.vc19/nfs_mount/nfs_mount.vcxproj     | 4 ++++
  18.  build.vc19/nfsd/nfsd.vcxproj               | 4 ++++
  19.  5 files changed, 20 insertions(+)
  20.  
  21. diff --git a/build.vc19/libtirpc/libtirpc.vcxproj b/build.vc19/libtirpc/libtirpc.vcxproj
  22. index 9b93508..e4cb86b 100644
  23. --- a/build.vc19/libtirpc/libtirpc.vcxproj
  24. +++ b/build.vc19/libtirpc/libtirpc.vcxproj
  25. @@ -90,6 +90,7 @@
  26.        <PreprocessorDefinitions>FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;PORTMAP;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;LIBTIRPC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  27.        <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  28.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  29. +      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
  30.      </ClCompile>
  31.      <Link>
  32.        <SubSystem>Windows</SubSystem>
  33. @@ -107,6 +108,7 @@
  34.        <PreprocessorDefinitions>FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;PORTMAP;_WINSOCK_DEPRECATED_NO_WARNINGS;_DEBUG;_WINDOWS;_USRDLL;LIBTIRPC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  35.        <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  36.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  37. +      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
  38.      </ClCompile>
  39.      <Link>
  40.        <SubSystem>Windows</SubSystem>
  41. @@ -126,6 +128,7 @@
  42.        <PreprocessorDefinitions>FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;PORTMAP;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;LIBTIRPC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  43.        <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  44.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  45. +      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
  46.      </ClCompile>
  47.      <Link>
  48.        <SubSystem>Windows</SubSystem>
  49. @@ -147,6 +150,7 @@
  50.        <PreprocessorDefinitions>FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;PORTMAP;_WINSOCK_DEPRECATED_NO_WARNINGS;NDEBUG;_WINDOWS;_USRDLL;LIBTIRPC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  51.        <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  52.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  53. +      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
  54.      </ClCompile>
  55.      <Link>
  56.        <SubSystem>Windows</SubSystem>
  57. diff --git a/build.vc19/nfs41_np/nfs41_np.vcxproj b/build.vc19/nfs41_np/nfs41_np.vcxproj
  58. index abe6578..3efe8f6 100644
  59. --- a/build.vc19/nfs41_np/nfs41_np.vcxproj
  60. +++ b/build.vc19/nfs41_np/nfs41_np.vcxproj
  61. @@ -90,6 +90,7 @@
  62.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  63.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  64.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  65. +      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
  66.      </ClCompile>
  67.      <Link>
  68.        <SubSystem>Windows</SubSystem>
  69. @@ -106,6 +107,7 @@
  70.        <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  71.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  72.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  73. +      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
  74.      </ClCompile>
  75.      <Link>
  76.        <SubSystem>Windows</SubSystem>
  77. @@ -124,6 +126,7 @@
  78.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  79.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  80.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  81. +      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
  82.      </ClCompile>
  83.      <Link>
  84.        <SubSystem>Windows</SubSystem>
  85. @@ -144,6 +147,7 @@
  86.        <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;NFS41_NP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  87.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  88.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  89. +      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
  90.      </ClCompile>
  91.      <Link>
  92.        <SubSystem>Windows</SubSystem>
  93. diff --git a/build.vc19/nfs_install/nfs_install.vcxproj b/build.vc19/nfs_install/nfs_install.vcxproj
  94. index d3cadf9..898ba94 100644
  95. --- a/build.vc19/nfs_install/nfs_install.vcxproj
  96. +++ b/build.vc19/nfs_install/nfs_install.vcxproj
  97. @@ -90,6 +90,7 @@
  98.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  99.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  100.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  101. +      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
  102.      </ClCompile>
  103.      <Link>
  104.        <SubSystem>Console</SubSystem>
  105. @@ -105,6 +106,7 @@
  106.        <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  107.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  108.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  109. +      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
  110.      </ClCompile>
  111.      <Link>
  112.        <SubSystem>Console</SubSystem>
  113. @@ -122,6 +124,7 @@
  114.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  115.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  116.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  117. +      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
  118.      </ClCompile>
  119.      <Link>
  120.        <SubSystem>Console</SubSystem>
  121. @@ -141,6 +144,7 @@
  122.        <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  123.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  124.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  125. +      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
  126.      </ClCompile>
  127.      <Link>
  128.        <SubSystem>Console</SubSystem>
  129. diff --git a/build.vc19/nfs_mount/nfs_mount.vcxproj b/build.vc19/nfs_mount/nfs_mount.vcxproj
  130. index b759d3e..7ab83e0 100644
  131. --- a/build.vc19/nfs_mount/nfs_mount.vcxproj
  132. +++ b/build.vc19/nfs_mount/nfs_mount.vcxproj
  133. @@ -90,6 +90,7 @@
  134.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  135.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  136.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  137. +      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
  138.      </ClCompile>
  139.      <Link>
  140.        <SubSystem>Console</SubSystem>
  141. @@ -106,6 +107,7 @@
  142.        <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  143.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  144.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  145. +      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
  146.      </ClCompile>
  147.      <Link>
  148.        <SubSystem>Console</SubSystem>
  149. @@ -124,6 +126,7 @@
  150.        <PreprocessorDefinitions>WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  151.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  152.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  153. +      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
  154.      </ClCompile>
  155.      <Link>
  156.        <SubSystem>Console</SubSystem>
  157. @@ -144,6 +147,7 @@
  158.        <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  159.        <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  160.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  161. +      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
  162.      </ClCompile>
  163.      <Link>
  164.        <SubSystem>Console</SubSystem>
  165. diff --git a/build.vc19/nfsd/nfsd.vcxproj b/build.vc19/nfsd/nfsd.vcxproj
  166. index 877c83b..5e97236 100644
  167. --- a/build.vc19/nfsd/nfsd.vcxproj
  168. +++ b/build.vc19/nfsd/nfsd.vcxproj
  169. @@ -90,6 +90,7 @@
  170.        <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>
  171.        <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;..\..\sys;..\..\dll;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  172.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  173. +      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
  174.      </ClCompile>
  175.      <Link>
  176.        <SubSystem>Console</SubSystem>
  177. @@ -106,6 +107,7 @@
  178.        <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;STANDALONE_NFSD;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  179.        <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;..\..\sys;..\..\dll;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  180.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  181. +      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
  182.      </ClCompile>
  183.      <Link>
  184.        <SubSystem>Console</SubSystem>
  185. @@ -124,6 +126,7 @@
  186.        <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;UNICODE;_UNICODE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  187.        <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;..\..\sys;..\..\dll;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  188.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  189. +      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
  190.      </ClCompile>
  191.      <Link>
  192.        <SubSystem>Console</SubSystem>
  193. @@ -144,6 +147,7 @@
  194.        <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;FD_SETSIZE=1024;INET6;NO_CB_4_KRB5P;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  195.        <AdditionalIncludeDirectories>..\..\libtirpc\tirpc;..\..\sys;..\..\dll;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  196.        <LanguageStandard_C>stdc17</LanguageStandard_C>
  197. +      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
  198.      </ClCompile>
  199.      <Link>
  200.        <SubSystem>Console</SubSystem>
  201. --
  202. 2.42.1
  203.  
  204. From 038620c4383b7cf1318674fe3d0662907aed458c Mon Sep 17 00:00:00 2001
  205. From: Dan Shelton <dan.f.shelton@gmail.com>
  206. Date: Mon, 1 Jan 2024 20:24:42 +0100
  207. Subject: [PATCH 2/3] msnfs41client: Do not test for cdb.exe in run_daemon
  208.  subcmd when it is not used
  209.  
  210. /sbin/msnfs14client run_daemon should not refuse to run when cdb.exe is not
  211. installed - it is not used by default.
  212.  
  213. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  214. ---
  215. cygwin/devel/msnfs41client.bash | 4 ++--
  216.  1 file changed, 2 insertions(+), 2 deletions(-)
  217.  
  218. diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
  219. index 5fa4ecd..acfc80f 100644
  220. --- a/cygwin/devel/msnfs41client.bash
  221. +++ b/cygwin/devel/msnfs41client.bash
  222. @@ -419,7 +419,7 @@ function main
  223.                         return $?
  224.                         ;;
  225.                 'run_deamon' | 'run_daemon')
  226. -                       require_cmd 'cdb.exe' || return 1
  227. +                       #require_cmd 'cdb.exe' || return 1
  228.                         require_cmd 'nfsd.exe' || return 1
  229.                         require_cmd 'nfsd_debug.exe' || return 1
  230.                         require_cmd 'nfs_mount.exe' || return 1
  231. @@ -427,7 +427,7 @@ function main
  232.                         return $?
  233.                         ;;
  234.                 'sys_run_deamon' | 'sys_run_daemon')
  235. -                       require_cmd 'cdb.exe' || return 1
  236. +                       #require_cmd 'cdb.exe' || return 1
  237.                         require_cmd 'PsExec.exe' || return 1
  238.                         require_cmd 'nfsd.exe' || return 1
  239.                         require_cmd 'nfsd_debug.exe' || return 1
  240. --
  241. 2.42.1
  242.  
  243. From 683af488251132a32cde05ba946acfdcff46eec4 Mon Sep 17 00:00:00 2001
  244. From: Roland Mainz <roland.mainz@nrubsig.org>
  245. Date: Mon, 1 Jan 2024 21:28:04 +0100
  246. Subject: [PATCH 3/3] cygwin/README.bintarball.txt: Document requirement for
  247.  "insecure"/"resvport" export option
  248.  
  249. Document that the Windows NFSv4 client currently needs the
  250. "insecure" (Linux) or "resvport" (Solaris/Illumos) export option.
  251.  
  252. Also minor cosmetic changes.
  253.  
  254. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  255. ---
  256. cygwin/README.bintarball.txt | 20 ++++++++++++++++++--
  257.  1 file changed, 18 insertions(+), 2 deletions(-)
  258.  
  259. diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
  260. index ccd5537..f9d206b 100644
  261. --- a/cygwin/README.bintarball.txt
  262. +++ b/cygwin/README.bintarball.txt
  263. @@ -59,6 +59,10 @@ $ (set -x ; cd / && tar -tf ~/download/msnfs41client_cygwin_binaries_git148e927_
  264.  $ /sbin/msnfs41client run_daemon
  265.  
  266.  # Mount a filesystem and use it
  267. +# - requires that NFSv4 server accepts connections from a TCP port
  268. +# number > 1024, which can be archived on Linux with the "insecure"
  269. +# export option in /etc/exports, or "resvport" on Solaris/Illumos
  270. +# (see nfs(5))
  271.  $ /sbin/nfs_mount -o rw N 10.49.20.110:/net_tmpfs2
  272.  Successfully mounted '10.49.20.110@2049' to drive 'N:'
  273.  $ cd /cygdrive/n/
  274. @@ -71,9 +75,12 @@ drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  60 Dec 13 17:58 directory_t
  275.  drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  60 Dec  7 11:01 test2
  276.  
  277.  # Unmount filesystem:
  278. +$ cd ~ && /sbin/nfs_mount -d N:
  279. +# OR
  280.  $ cd ~
  281.  $ net use N: /delete
  282.  
  283. +
  284.  #
  285.  # Notes:
  286.  #
  287. @@ -110,8 +117,8 @@ $ net use N: /delete
  288.    # (requires Admin shell)
  289.    powershell -Command 'Set-MpPreference -DisableRealtimeMonitoring 1'
  290.    Option 2:
  291. -  Add "nfsd.exe", "nfsd_debug.exe", ksh93.exe, bash.exe, git.exe and
  292. -  other offending commands to process name whitelist.
  293. +  Add "nfsd.exe", "nfsd_debug.exe", "ksh93.exe", "bash.exe", "git.exe"
  294. +  and other offending commands to process name whitelist.
  295.  
  296.  - performance: Use vmxnet3 in VMware to improve performance
  297.  
  298. @@ -131,6 +138,15 @@ $ net use N: /delete
  299.    A::EVERYONE@:rtcy
  300.    ---- snip ----
  301.  
  302. +- nfs_mount only works when the NFSv4 server allows connections from
  303. +  ports >= 1024, as Windows does not allow the Windows NFSv4 client
  304. +  to use a "priviledged port" (i.e. TCP port number < 1024)).
  305. +  By default the NFSv4 server on Solaris, Illumos, Linux
  306. +  etc. only accepts connections if the NFSv4 client uses a "privileged
  307. +  (TCP) port", i.e. a port number < 1024.
  308. +  This can be worked around by using the "insecure" export option in
  309. +  Linux /etc/exports, which allows connections from ports >= 1024,
  310. +  and for Solaris/Illumos see nfs(5), option "resvport".
  311.  
  312.  #
  313.  # Known issues:
  314. --
  315. 2.42.1

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