pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for DocBook documentation, use stdint.h for XDR+misc, 2025-05-30
Posted by Anonymous on Fri 30th May 2025 16:46
raw | new post

  1. From 7185a9a957a2908872e2bcc9328f241f74edeae5 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Fri, 30 May 2025 14:18:55 +0200
  4. Subject: [PATCH 1/5] README.md,README.html,cygwin,docs: Convert and merge
  5.  various READMEs into one DocBook document
  6.  
  7. Convert and merge various READMEs into one DocBook/XML document,
  8. which is then used to generate the MD and HTML output
  9.  
  10. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  11. ---
  12. README.html                  |  174 ------
  13.  README.md                    | 1046 ++++++++++++++++++++++++++++++----
  14.  cygwin/Makefile              |   40 +-
  15.  cygwin/README.bintarball.txt |  685 ----------------------
  16.  cygwin/README.txt            |  150 -----
  17.  docs/README.xml              |  963 +++++++++++++++++++++++++++++++
  18.  6 files changed, 1936 insertions(+), 1122 deletions(-)
  19.  delete mode 100644 README.html
  20.  delete mode 100644 cygwin/README.bintarball.txt
  21.  delete mode 100644 cygwin/README.txt
  22.  create mode 100644 docs/README.xml
  23.  
  24. diff --git a/README.html b/README.html
  25. deleted file mode 100644
  26. index b62af39..0000000
  27. --- a/README.html
  28. +++ /dev/null
  29. @@ -1,174 +0,0 @@
  30. -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  31. -    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  32. -<html xmlns="http://www.w3.org/1999/xhtml">
  33. -<head>
  34. -    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  35. -    <title>Windows NFS 4.2 Client Instructions</title>
  36. -    <link rel="stylesheet" title="CITI Default" href="http://www.citi.umich.edu/format/citi.css" type="text/css"/>
  37. -    <link rel="icon" href="http://www.citi.umich.edu/images/citilogo-16x16.png" type="image/png"/>
  38. -    <link rel="shortcut icon" href="http://www.citi.umich.edu/images/citilogo-16x16.png" type="image/png"/>
  39. -    <style type="text/css">
  40. -    /*<![CDATA[*/
  41. -    body { min-width: 600px; background-color: #DDDDFF; font-family: serif; }
  42. -    #page { padding: 0 12px 0 12px; }
  43. -    #content { margin: 12px 0 12px 0; padding: 8px; background-color: #FFFFFF; border: 1px solid #88A; }
  44. -    #index { padding-right: 12px; float: right; background-color: #FFFFFF; border: 1px solid #88A; }
  45. -    a { color: #0282b4; }
  46. -    a:hover { color: #0244b4; }
  47. -    h1 { font-size: 2em; text-align: center; background: none; }
  48. -    h2 { margin: 24px 0 8px 0; font-variant: small-caps; border-bottom: 1px dashed #88A; }
  49. -    h3 { margin-left: 8px; }
  50. -    /*]]>*/
  51. -    </style>
  52. -</head>
  53. -<body>
  54. -<div id="page">
  55. -<h1>Windows NFS 4.2 Client Instructions</h1>
  56. -<div id="content">
  57. -<div id="index">
  58. -<ol>
  59. -    <li><a href="#build">Building from Source</a></li>
  60. -    <li><a href="#install">Installing Binaries</a></li>
  61. -    <li><a href="#dfs">Disable the DFS Client</a></li>
  62. -    <li><a href="#ldap">Ldap Configuration</a></li>
  63. -    <li><a href="#startup">Starting the Client</a></li>
  64. -    <li><a href="#mount">Mounting</a></li>
  65. -    <li><a href="#cthon">Connectation</a></li>
  66. -    <li><a href="#issues">Known Issues</a></li>
  67. -</ol>
  68. -</div>
  69. -<h2>1. <a name="build">Building from Source</a></h2>
  70. -<h3>Requirements</h3>
  71. -<ul>
  72. -    <li>Windows Vista, Windows Server 2008 R2, or Windows 7 (Windows XP and previous versions are not supported)</li>
  73. -    <li>Microsoft Visual Studio 2010</li>
  74. -    <li>Windows Driver Development Kit (WinDDK 6000 or later)</li>
  75. -    <li>ms-nfs41-client source code:
  76. -    <br/><code>&gt; git clone git://citi.umich.edu/projects/ms-nfs41-client.git</code></li>
  77. -</ul>
  78. -<h3>Building the rpc library and nfs client daemon</h3>
  79. -<ul><li>WinDDK does not include the ldap library, so we build the rpc library and nfs client daemon with Visual Studio 2010.</li></ul>
  80. -<ol>
  81. -    <li>Open Windows Explorer and navigate to <strong>ms-nfs41-client\build.vc10</strong>.</li>
  82. -    <li>Make a copy of <strong>env.props.example</strong>, and rename it to <strong>env.props</strong>.</li>
  83. -    <li>Open <strong>env.props</strong> in a text editor, and verify that the value in <code>&lt;WDKPATH&gt;C:\WinDDK\7600.16385.0&lt;/WDKPATH&gt;</code> points to your WinDDK installation.</li>
  84. -    <li>Open the solution file <strong>ms-nfs41-client.sln</strong> in Visual Studio 2010.</li>
  85. -    <li>Select the desired configuration and platform (accessible via Build->Configuration Manager).</li>
  86. -    <li>Right-click on the <strong>daemon</strong> project and select Build. The project and its dependencies should build without errors. The resulting binaries, <strong>nfsd.exe</strong> and <strong>libtirpc.dll</strong>, can be found under <strong>ms-nfs41-client\build.vc10\x64\Debug\</strong>.</li>
  87. -</ol>
  88. -<h3>Building the driver and utilities</h3>
  89. -<ol>
  90. -    <li>From the Start menu, open the WinDDK 'Checked Build Environment' for the target platform.</li>
  91. -    <li>Change directory to <strong>ms-nfs41-client</strong> and type <code>build</code>. All projects should build without errors.</li>
  92. -</ol>
  93. -<h3>Signing the driver</h3>
  94. -<ol>
  95. -    <li>Open a WinDDK 'Checked Build Environment' as Administrator in this directory (right click and 'Run as administrator').</li>
  96. -    <li>Create a certificate for test-signing the driver (<a href="http://msdn.microsoft.com/en-us/library/ff540213%28VS.85%29.aspx" title="msdn.microsoft.com">Creating Test Certificates</a>):
  97. -    <br/><code>&gt; makecert /pe /ss PrivateCertStore /n CN=nfs41_driver nfs41_driver.cer</code></li>
  98. -    <li>Use the certificate to sign <strong>nfs41_driver.sys</strong> (<a href="http://msdn.microsoft.com/en-us/library/ff553467%28VS.85%29.aspx" title="msdn.microsoft.com">Test-Signing a Driver File</a>):
  99. -    <br/><code>&gt; signtool sign /v /s PrivateCertStore /n nfs41_driver /t http://timestamp.verisign.com/scripts/timestamp.dll path\to\nfs41_driver.sys</code></li>
  100. -</ol>
  101. -<h2>2. <a name="install">Installing Binaries</a></h2>
  102. -<h3>Requirements</h3>
  103. -<ul>
  104. -    <li>ms-nfs41-client binaries: <strong>nfs41_driver.sys</strong>, <strong>nfs41_np.dll</strong>, <strong>libtirpc.dll</strong>, <strong>nfs_install.exe</strong>, <strong>nfsd.exe</strong>, <strong>nfs_mount.exe</strong></li>
  105. -    <li>ms-nfs41-client configuration files: <strong>nfs41_driver.cer</strong>, <strong>nfs41rdr.inf</strong>, <strong>install.bat</strong>, <strong>uninstall.bat</strong>, <strong>etc_netconfig</strong>, <strong>ms-nfs41-idmap.conf</strong></li>
  106. -    <li>Microsoft Visual Studio 2010, or Microsoft Visual C++ 2010 Redistributable Libraries (<a href="https://www.microsoft.com/download/en/details.aspx?id=8328">x86</a> or <a href="https://www.microsoft.com/download/en/details.aspx?id=13523">x64</a>). An installer for the redistributable libraries are included with binary releases.</li>
  107. -</ul>
  108. -<h3>Instructions</h3>
  109. -<ol>
  110. -    <li>Copy or extract all ms-nfs41-client binaries and configuration files into a directory that's convenient for testing.</li>
  111. -    <li>Run <strong>vcredist_x*.exe</strong> to install the Visual C++ Redistributable Libraries.</li>
  112. -    <li>Double-click on <strong>nfs41_driver.cer</strong> and select 'Install Certificate', then place it in the 'Trusted Root Certificate Authorities' store.</li>
  113. -    <li>Open a command prompt as Administrator in this directory.</li>
  114. -    <li>Install the driver and update the registry:
  115. -    <br/><code>&gt; install.bat</code></li>
  116. -    <li>Copy configuration files:
  117. -    <br/><code>&gt; mkdir C:\etc</code>
  118. -    <br/><code>&gt; copy etc_netconfig C:\etc\netconfig</code>
  119. -    <br/><code>&gt; copy ms-nfs41-idmap.conf C:\etc\</code></li>
  120. -    <li>Allow windows to load test-signed drivers:
  121. -    <br/><code>&gt; bcdedit /set testsigning on</code></li>
  122. -    <li>Reboot.</li>
  123. -</ol>
  124. -<h2>3. <a name="dfs">Disable the DFS Client</a></h2>
  125. -<ul>
  126. -  <li>The Windows DFS client interferes with some requests, indicated by long delays during operation. See <a href="http://support.microsoft.com/kb/171386">http://support.microsoft.com/kb/171386</a> for more information.</li>
  127. -</ul>
  128. -<h3>Instructions</h3>
  129. -<ol>
  130. -    <li>Open <strong>regedit.exe</strong> and navigate to <code>HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Mup</code>.</li>
  131. -    <li>Add a DWORD value named <code>DisableDfs</code> with a value of 1.</li>
  132. -</ol>
  133. -<h2>4. <a name="ldap">Ldap Configuration</a></h2>
  134. -<h3>Requirements:</h3>
  135. -<ul>
  136. -    <li><strong>C:\etc\ms-nfs41-idmap.conf</strong> from <a href="#install">Installation</a> step 7.</li>
  137. -</ul>
  138. -<h3>Instructions</h3>
  139. -<ol>
  140. -    <li>Open <strong>C:\etc\ms-nfs41-idmap.conf</strong> in a text editor.</li>
  141. -    <li>Uncomment the <code>ldap_hostname</code> and <code>ldap_base</code> lines, and configure as appropriate to match your ldap server configuration (we'll add suggestions later).</li>
  142. -</ol>
  143. -<h2>5. <a name="startup">Starting the Client</a></h2>
  144. -<ul>
  145. -    <li>If you've installed the binary distribution, you'll find two versions of the nfs client daemon: <strong>nfsd.exe</strong> and <strong>nfsd_debug.exe</strong>. <strong>nfsd.exe</strong> is built to run as a service, and does not provide easy access to debug output. We strongly recommend trying <strong>nfsd_debug.exe</strong> first (using the Instructions below) to verify that you can start the daemon and mount/unmount an nfs share. You can then close <strong>nfsd_debug.exe</strong> and start running <strong>nfsd.exe</strong> as a service with:<br /><code>&gt nfsd.exe -install</code>.</li>
  146. -</ul>
  147. -<h3>Instructions</h3>
  148. -<ol>
  149. -    <li>From a Windows command prompt, run <strong>nfsd.exe</strong> to start the nfs client daemon. Leave this running in the background until all mapped drives are unmounted.
  150. -    <br/>Usage:
  151. -    <br/><code>&gt; nfsd.exe -d &lt;debug level&gt; [--noldap]</code>
  152. -    <ul>
  153. -        <li><code>&lt;debug level&gt;</code> determines the log verbosity (1, 2, 3 or 0 to disable)</li>
  154. -        <li><code>--noldap</code> disables id mapping and uses a default uid=666 and gid=777</li>
  155. -        <li><code>--uid, --gid</code> changes the default uid/gid when no mapping is available (must be nonzero)</li>
  156. -    </ul></li>
  157. -</ol>
  158. -<h2>6. <a name="mount">Mounting</a></h2>
  159. -<h3>Instructions</h3>
  160. -<ol>
  161. -    <li>From a Windows command prompt run <strong>nfs_mount.exe</strong> to mount a share:
  162. -    <br/><code>&gt; nfs_mount.exe Z: &lt;server_name&gt;:\</code></li>
  163. -    <li>To specify the security flavor, add the 'sec=' mount option with sys, krb5, krb5i, or krb5p:
  164. -    <br/><code>&gt; nfs_mount.exe -o sec=&lt;flavor&gt; Z: &lt;server_name&gt;:\</code></li>
  165. -    <li>You can later unmount with:
  166. -    <br/><code>&gt; nfs_mount.exe -d Z</code></li>
  167. -</ol>
  168. -<h2>7. <a name="cthon">Connectathon</a></h2>
  169. -<h3>Requirements</h3>
  170. -<ul>
  171. -    <li><a href="http://www.cygwin.com" title="www.cygwin.com">Cygwin</a>, including packages gcc-core, make, time, tirpc, git</li>
  172. -    <li><a href="http://www.connectathon.org/nfstests.html" title="www.connectathon.org">Connectathon Test Suite</a></li>
  173. -    <li>ms-nfs41-client source code (patches for connectathon are located in <strong>ms-nfs41-client\tests</strong>)</li>
  174. -</ul>
  175. -<h3>Instructions</h3>
  176. -<ol>
  177. -    <li>Extract <strong>nfstests.zip</strong> into a directory that's convenient for testing (i.e. <strong>cthon04</strong>).</li>
  178. -    <li>Open a Cygwin shell, and change directory to <strong>cthon04</strong>.</li>
  179. -    <li>Create a git repository to track changes:
  180. -    <br/><code>&gt; git init</code>
  181. -    <br/><code>&gt; git add *</code>
  182. -    <br/><code>&gt; git commit -m "files from nfstests.zip"</code></li>
  183. -    <li>Apply all cthon patches:
  184. -    <br/><code>&gt; git am /path/to/ms-nfs41-client/tests/*.patch</code></li>
  185. -    <li>Build the tests:
  186. -    <br/><code>&gt; make</code></li>
  187. -    <li>Run the test suite on a mounted directory:
  188. -    <br/><code>&gt; ./runtests -a -t z:/testdir</code></li>
  189. -</ol>
  190. -<h2>8. <a name="issues">Known Issues</a></h2>
  191. -<ul>
  192. -    <li>krb5p security with AES keys do not work against the linux server, as it does not support gss krb5 v2 tokens with rotated data.</li>
  193. -    <li>When recovering opens and locks outside of the server's grace period, client does not check whether the file has been modified by another client.</li>
  194. -    <li>If nfsd.exe is restarted while a drive is mapped, that drive needs to be remounted before further use.</li>
  195. -    <li>Symbolic links are not supported in Cygwin. Connectathon's basic test8 and special test nfsidem have been commented out.</li>
  196. -    <li>Does not allow renaming a file on top of an existing open file. Connectathon's special test op_ren has been commented out.</li>
  197. -    <li>Extended attributes are supported with some limitations: a) the server must support <a href="https://tools.ietf.org/html/rfc5661#section-5.3" title="RFC 5661: 5.3. Named Attributes">NFS Named Attributes</a>, b) the order of listings cannot be guaranteed by NFS, and c) the EaSize field cannot be reported for directory queries of FileBothDirInformation, FileFullDirInfo, or FileIdFullDirInfo.</li>
  198. -</ul>
  199. -<p>Please direct any questions to <a href="mailto:ms-nfs41-client-devel@lists.sourceforge.net">ms-nfs41-client-devel@lists.sourceforge.net</a>.</p>
  200. -</div>
  201. -</div>
  202. -</body>
  203. -</html>
  204. \ No newline at end of file
  205. diff --git a/README.md b/README.md
  206. index 71b0448..72144eb 100644
  207. --- a/README.md
  208. +++ b/README.md
  209. @@ -1,149 +1,981 @@
  210. +---
  211. +title: Windows NFS 4.2 FileSystem Client Instructions
  212. +---
  213.  
  214. -# Windows NFS 4.2 Client Instructions
  215. +- [What is this ?](#what-is-this)
  216. +- [Features](#features)
  217. +- [Requirements](#requirements)
  218. +- [Installation](#installation)
  219. +  - [Download and install Cygwin (if not installed
  220. +    yet)](#download-install-cygwin)
  221. +  - [Download and install MSYS2/64bit
  222. +    \[OPTIONAL\]](#download-install-msys2)
  223. +  - [Download "ms-nfs41-client" installation
  224. +    tarball](#download-msnfs41client-tarball)
  225. +  - [Installation (as "Administrator")](#installation-via-cygwin)
  226. +  - [Deinstallation](#deinstallation)
  227. +- [Usage](#usage)
  228. +  - [Preparing the NFS server](#prep_nfs_server)
  229. +    - [NFS server config](#nfs_server_config)
  230. +    - [User/group accounts on the NFS server](#nfs_server_accounts)
  231. +  - [Starting the NFS client daemon](#starting_nfs_daemon)
  232. +    - [Run as Windows Service](#run_as_windows_service)
  233. +    - [Manual starting the daemon](#manual_start)
  234. +  - [Mounting and using NFS filesystems](#mounting_and_using)
  235. +    - [Basic usage](#basic_usage)
  236. +    - [Global/System-wide mounts](#global-system-wide-mounts)
  237. +    - [WSL usage](#wsl-usage)
  238. +- [Notes](#notes)
  239. +- [Known issues](#known-issues)
  240. +- [Troubleshooting && finding
  241. +  bugs/debugging](#troubleshooting-debugging)
  242. +- [Development](#development)
  243. +  - [Source code](#source-code)
  244. +  - [Building ms-nfs41-client](#building_msnfs41client)
  245. +    - [Building ms-nfs41-client using
  246. +      Cygwin+Makefile](#building-cygwin-makefile)
  247. +    - [Testing](#testing)
  248. +- [Mailing list](#mailinglist)
  249.  
  250. -1.  [Building from Source](#build)
  251. -2.  [Installing Binaries](#install)
  252. -3.  [Disable the DFS Client](#dfs)
  253. -4.  [Ldap Configuration](#ldap)
  254. -5.  [Starting the Client](#startup)
  255. -6.  [Mounting](#mount)
  256. -7.  [Connectation](#cthon)
  257. -8.  [Known Issues](#issues)
  258. +# What is this ?
  259.  
  260. +NFSv4.2/NFSv4.1 filesystem driver for Windows 10/11 & Windows Server
  261. +2019+2022
  262.  
  263. -## 1\. <a name="build">Building from Source</a>
  264. +# Features
  265.  
  266. -### Requirements
  267. +- Full NFSv4.2/NFSv4.1 protocol support
  268.  
  269. -*   Windows Vista, Windows Server 2008 R2, or Windows 7 (Windows XP and previous versions are not supported)
  270. -*   Microsoft Visual Studio 2010
  271. -*   Windows Driver Development Kit (WinDDK 6000 or later)
  272. -*   ms-nfs41-client source code:  
  273. -    `> https://github.com/kofemann/ms-nfs41-client.git`
  274. +- idmapper (mapping usernames and uid/gid values between server and
  275. +  client)
  276.  
  277. -### Building the rpc library and nfs client daemon
  278. +- Support for custom ports (NFSv4 defaults to TCP port 2049, this client
  279. +  can use different ports per mount)
  280.  
  281. -*   WinDDK does not include the ldap library, so we build the rpc library and nfs client daemon with Visual Studio 2010.
  282. +- Support for `nfs://`-URLs
  283.  
  284. -1.  Open Windows Explorer and navigate to **ms-nfs41-client\build.vc10**.
  285. -2.  Make a copy of **env.props.example**, and rename it to **env.props**.
  286. -3.  Open **env.props** in a text editor, and verify that the value in `<WDKPATH>C:\WinDDK\7600.16385.0</WDKPATH>` points to your WinDDK installation.
  287. -4.  Open the solution file **ms-nfs41-client.sln** in Visual Studio 2010.
  288. -5.  Select the desired configuration and platform (accessible via Build->Configuration Manager).
  289. -6.  Right-click on the **daemon** project and select Build. The project and its dependencies should build without errors. The resulting binaries, **nfsd.exe** and **libtirpc.dll**, can be found under **ms-nfs41-client\build.vc10\x64\Debug\**.
  290. +  - Why? `nfs://`-URLs are cross-platform, portable and
  291. +    Character-Encoding independent descriptions of NFSv4 server
  292. +    resources (exports).
  293.  
  294. -### Building the driver and utilities
  295. +  - including custom ports and raw IPv6 addresses
  296.  
  297. -1.  From the Start menu, open the WinDDK 'Checked Build Environment' for the target platform.
  298. -2.  Change directory to **ms-nfs41-client** and type `build`. All projects should build without errors.
  299. +  - `nfs://`-URL conversion utility (`/usr/bin/nfsurlconv`) to convert
  300. +    URLs, including non-ASCII/Unicode characters in mount path
  301.  
  302. -### Signing the driver
  303. +- Support ssh forwarding, e.g., mounting NFSv4 filesystems via ssh
  304. +  tunnel
  305.  
  306. -1.  Open a WinDDK 'Checked Build Environment' as Administrator in this directory (right click and 'Run as administrator').
  307. -2.  Create a certificate for test-signing the driver ([Creating Test Certificates](http://msdn.microsoft.com/en-us/library/ff540213%28VS.85%29.aspx "msdn.microsoft.com")):  
  308. -    `> makecert /pe /ss PrivateCertStore /n CN=nfs41_driver nfs41_driver.cer`
  309. -3.  Use the certificate to sign **nfs41_driver.sys** ([Test-Signing a Driver File](http://msdn.microsoft.com/en-us/library/ff553467%28VS.85%29.aspx "msdn.microsoft.com")):  
  310. -    `> signtool sign /v /s PrivateCertStore /n nfs41_driver /t http://timestamp.verisign.com/scripts/timestamp.dll path\to\nfs41_driver.sys`
  311. +- Support for long paths (up to 4096 bytes), no Windows MAXPATH limit
  312.  
  313. -## 2\. <a name="install">Installing Binaries</a>
  314. +- Unicode support
  315.  
  316. -### Requirements
  317. +  - File names can use any Unicode character supported by the NFS
  318. +    server's filesystem.
  319.  
  320. -*   ms-nfs41-client binaries: **nfs41_driver.sys**, **nfs41_np.dll**, **libtirpc.dll**, **nfs_install.exe**, **nfsd.exe**, **nfs_mount.exe**
  321. -*   ms-nfs41-client configuration files: **nfs41_driver.cer**, **nfs41rdr.inf**, **install.bat**, **uninstall.bat**, **etc_netconfig**, **ms-nfs41-idmap.conf**
  322. -*   Microsoft Visual Studio 2010, or Microsoft Visual C++ 2010 Redistributable Libraries ([x86](https://www.microsoft.com/download/en/details.aspx?id=8328) or [x64](https://www.microsoft.com/download/en/details.aspx?id=13523)). An installer for the redistributable libraries are included with binary releases.
  323. +  - `nfs://`-URLs can be used to mount filesystems with non-ASCII
  324. +    characters in the mount path, independent of current locale.
  325.  
  326. -### Instructions
  327. +- UNC paths
  328.  
  329. -1.  Copy or extract all ms-nfs41-client binaries and configuration files into a directory that's convenient for testing.
  330. -2.  Run **vcredist_x*.exe** to install the Visual C++ Redistributable Libraries.
  331. -3.  Double-click on **nfs41_driver.cer** and select 'Install Certificate', then place it in the 'Trusted Root Certificate Authorities' store.
  332. -4.  Open a command prompt as Administrator in this directory.
  333. -5.  Install the driver and update the registry:  
  334. -    `> install.bat`
  335. -6.  Copy configuration files:  
  336. -    `> mkdir C:\etc`  
  337. -    `> copy etc_netconfig C:\etc\netconfig`  
  338. -    `> copy ms-nfs41-idmap.conf C:\etc\`
  339. -7.  Allow windows to load test-signed drivers:  
  340. -    `> bcdedit /set testsigning on`
  341. -8.  Reboot.
  342. +  - Mounting UNC paths without DOS drive letter
  343.  
  344. -## 3\. <a name="dfs">Disable the DFS Client</a>
  345. +  - IPv6 support in UNC paths
  346.  
  347. -*   The Windows DFS client interferes with some requests, indicated by long delays during operation. See [http://support.microsoft.com/kb/171386](http://support.microsoft.com/kb/171386) for more information.
  348. +  - `/sbin/nfs_mount` prints UNC paths in Win32+Cygwin/MSYS2 formats
  349.  
  350. -### Instructions
  351. +  - Cygwin/MSYS2 bash+ksh93 support UNC paths, e.g.,
  352. +    `cd //derfwnb4966@2049/nfs4/bigdisk/mysqldb4/`
  353.  
  354. -1.  Open **regedit.exe** and navigate to `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Mup`.
  355. -2.  Add a DWORD value named `DisableDfs` with a value of 1.
  356. +  - Symlinks on NFS can redirect to other filesystems via UNC syntax and
  357. +    work with Cygwin, MSYS2, cmd.exe, powershell etc., e.g.:
  358.  
  359. -## 4\. <a name="ldap">Ldap Configuration</a>
  360. +        mklink /D symlnk1_to_h_tmp \\lab17@2049\nfs4\export\home\rsm\tmp
  361.  
  362. -### Requirements:
  363. +- WSL support
  364.  
  365. -*   **C:\etc\ms-nfs41-idmap.conf** from [Installation](#install) step 7.
  366. +  - Mount Windows NFSv4.2 shares via drive letter or UNC path in WSL via
  367. +    `mount -t drvfs`
  368.  
  369. -### Instructions
  370. +  - Supports NFS owner/group to WSL uid/gid mapping
  371.  
  372. -1.  Open **C:\etc\ms-nfs41-idmap.conf** in a text editor.
  373. -2.  Uncomment the `ldap_hostname` and `ldap_base` lines, and configure as appropriate to match your ldap server configuration (we'll add suggestions later).
  374. +- IPv6 support
  375.  
  376. -## 5\. <a name="startup">Starting the Client</a>
  377. +  - IPv6 address within '\[', '\]' (will be converted to
  378. +    \*.ipv6-literal.net)
  379.  
  380. -*   If you've installed the binary distribution, you'll find two versions of the nfs client daemon: **nfsd.exe** and **nfsd_debug.exe**. **nfsd.exe** is built to run as a service, and does not provide easy access to debug output. We strongly recommend trying **nfsd_debug.exe** first (using the Instructions below) to verify that you can start the daemon and mount/unmount an nfs share. You can then close **nfsd_debug.exe** and start running **nfsd.exe** as a service with:  
  381. -    `> nfsd.exe -install`.
  382. +- Windows ACLs \<---\> NFSv4 ACL translation
  383.  
  384. -### Instructions
  385. +  - Win32 `C:\Windows\system32\icacls.exe`
  386.  
  387. -1.  From a Windows command prompt, run **nfsd.exe** to start the nfs client daemon. Leave this running in the background until all mapped drives are unmounted.  
  388. -    Usage:  
  389. -    `> nfsd.exe -d <debug level> [--noldap]`
  390. -    *   `<debug level>` determines the log verbosity (1, 2, 3 or 0 to disable)
  391. -    *   `--noldap` disables id mapping and uses a default uid=666 and gid=777
  392. -    *   `--uid, --gid` changes the default uid/gid when no mapping is available (must be nonzero)
  393. +  - Cygwin `/usr/bin/setfacl`+`/usr/bin/getfacl`
  394.  
  395. -## 6\. <a name="mount">Mounting</a>
  396. +  - Windows Explorer ACL dialog
  397.  
  398. -### Instructions
  399. +- Sparse file support
  400.  
  401. -1.  From a Windows command prompt run **nfs_mount.exe** to mount a share:  
  402. -    `> nfs_mount.exe Z: <server_name>:\`
  403. -2.  To specify the security flavor, add the 'sec=' mount option with sys, krb5, krb5i, or krb5p:  
  404. -    `> nfs_mount.exe -o sec=<flavor> Z: <server_name>:\`
  405. -3.  You can later unmount with:  
  406. -    `> nfs_mount.exe -d Z`
  407. +  - Requires NFSv4.2 server which supports the NFSv4.2 operations
  408. +    "ALLOCATE", "DEALLOCATE", "SEEK", and the
  409. +    `|FATTR4_WORD1_SPACE_USED|` attribute.
  410.  
  411. -## 7\. <a name="cthon">Connectathon</a>
  412. +  - Full Win32 sparse file API support, including creation, punching
  413. +    holes, enumeration of hole&data ranges etc.
  414.  
  415. -### Requirements
  416. +  - Supports Win32 APIs `|FSCTL_QUERY_ALLOCATED_RANGES|`,
  417. +    `|FSCTL_SET_SPARSE|`, `|FSCTL_SET_ZERO_DATA|`; and
  418. +    `|NfsV3Attributes.used|` EA
  419.  
  420. -*   [Cygwin](http://www.cygwin.com "www.cygwin.com"), including packages gcc-core, make, time, tirpc, git
  421. -*   [Connectathon Test Suite](https://git.linux-nfs.org/?p=steved/cthon04.git;a=summary "git.linux-nfs.org")
  422. -*   ms-nfs41-client source code (patches for connectathon are located in **ms-nfs41-client\tests**)
  423. +  - Cygwin sparse file support requires \>= Cygwin 3.6 to support
  424. +    POSIX-1.2024 `|lseek(...,SEEK_HOLE/SEEK_DATA,...)|`, which is needed
  425. +    for coreutils `/usr/bin/fallocate` and
  426. +    `$ /usr/bin/cp --sparse=auto src dest #`
  427.  
  428. -### Instructions
  429. +  - `/cygdrive/c/Windows/system32/fsutil sparse queryrange myfile.dat`
  430. +    can be used to enumerate ranges where data are allocated (BUG:
  431. +    Win10+Win11 fsutil only support 64 data ranges, the filesystem
  432. +    itself supports an unlimited number of data ranges)
  433.  
  434. -1.  Extract **nfstests.zip** into a directory that's convenient for testing (i.e. **cthon04**).
  435. -2.  Open a Cygwin shell, and change directory to **cthon04**.
  436. -3.  Create a git repository to track changes:  
  437. -    `> git init`  
  438. -    `> git add *`  
  439. -    `> git commit -m "files from nfstests.zip"`
  440. -4.  Apply all cthon patches:  
  441. -    `> git am /path/to/ms-nfs41-client/tests/*.patch`
  442. -5.  Build the tests:  
  443. -    `> make`
  444. -6.  Run the test suite on a mounted directory:  
  445. -    `> ./runtests -a -t z:/testdir`
  446. +  - `/cygdrive/c/Windows/system32/xcopy /sparse` can be used to copy
  447. +    sparse files. Requires on Win11 \>= 22H2 because it relies on
  448. +    `|CopyFile2()|` flag `|COPY_FILE_ENABLE_SPARSE_COPY|`.
  449.  
  450. -## 8\. <a name="issues">Known Issues</a>
  451. +- Block cloning support
  452.  
  453. -*   krb5p security with AES keys do not work against the linux server, as it does not support gss krb5 v2 tokens with rotated data.
  454. -*   When recovering opens and locks outside of the server's grace period, client does not check whether the file has been modified by another client.
  455. -*   If nfsd.exe is restarted while a drive is mapped, that drive needs to be remounted before further use.
  456. -*   Symbolic links are not supported in Cygwin. Connectathon's basic test8 and special test nfsidem have been commented out.
  457. -*   Does not allow renaming a file on top of an existing open file. Connectathon's special test op_ren has been commented out.
  458. -*   Extended attributes are supported with some limitations: a) the server must support [NFS Named Attributes](https://tools.ietf.org/html/rfc5661#section-5.3 "RFC 5661: 5.3\. Named Attributes"), b) the order of listings cannot be guaranteed by NFS, and c) the EaSize field cannot be reported for directory queries of FileBothDirInformation, FileFullDirInfo, or FileIdFullDirInfo.
  459. +  - Implemented via Win32 `|FSCTL_DUPLICATE_EXTENTS_TO_FILE|` to clone
  460. +    file blocks from src to dst within the same filesystem.
  461.  
  462. -Please direct any questions to [ms-nfs41-client-devel@lists.sourceforge.net](mailto:ms-nfs41-client-devel@lists.sourceforge.net).
  463. +  - Requires NFSv4.2 server which supports the NFSv4.2 operations
  464. +    "CLONE", "DEALLOCATE", "SEEK", and exports a filesystem which
  465. +    supports block cloning (e.g. Linux BTRFS+XFS, but NOT Linux tmpfs)
  466. +
  467. +  - Sparse files are correctly cloned, including all hole and data
  468. +    ranges
  469. +
  470. +  - `/usr/bin/winclonefile.exe` can be used to clone a file
  471. +
  472. +  - Windows 11 `|CopyFile2()|` API uses
  473. +    `|FSCTL_DUPLICATE_EXTENTS_TO_FILE|` by default
  474. +
  475. +  - Windows 11 tools like xcopy.exe, robocopy etc. all use
  476. +    `|CopyFile2()|`, and therefore file cloning by default
  477. +
  478. +- Symlink reparse and translation support
  479. +
  480. +  - Translates Win32/NT symlink syntax (e.g.
  481. +    `$ mklink /D ... Y:\tmp\ #`) to NFS/POSIX syntax (e.g.
  482. +    "`/cygdrive/y/tmp/`") and back
  483. +
  484. +  - Translates Cygwin `/cygdrive/<devletter>` symlinks on NFS to Win32
  485. +    `<devletter>:\` and back
  486. +
  487. +  - Pass-through for NFS `/dev-Symlinks` (e.g. `/dev/null`) to Cygwin
  488. +
  489. +  - Interoperability for symlinks between Cygwin, powershell, cmd.exe
  490. +    and other POSIX-compatible NFSv4.2/NFSv4.1 clients.
  491. +
  492. +- Support for NFSv4 public mounts (i.e., use the NFSv4 public file
  493. +  handle lookup protocol via `$ nfs_mount -o public ... #`)
  494. +
  495. +- Support for NFSv4 referrals
  496. +
  497. +  - See Linux `export(5) refer=` option, `nfsref(5)` or
  498. +    <https://docs.oracle.com/cd/E86824_01/html/E54764/nfsref-1m.html>
  499. +
  500. +- SFU/Cygwin/MSYS2 support, including:
  501. +
  502. +  - POSIX uid/gid+mode
  503. +
  504. +  - Backwards compatibility to Microsoft's NFSv3 driver
  505. +
  506. +  - Cygwin ACLs, e.g., `setfacl`/`getfacl`
  507. +
  508. +  - Cygwin/MSYS2 symlinks
  509. +
  510. +- Custom primary group support
  511. +
  512. +  - Supports primary group changes in the calling process/thread (via
  513. +    `|SetTokenInformation(..., TokenPrimaryGroup,...)|`), e.g., if the
  514. +    calling process/threads switches the primary group in its access
  515. +    token then the NFSv4.2 client will use that group as GID for file
  516. +    creation.
  517. +
  518. +  - `newgrp(1)`/`sg(1)`-style "winsg" utility to run cmd.exe with
  519. +    different primary group, e.g.,
  520. +    `$ winsg [-] -g group [-c command | /C command] #`
  521. +
  522. +- Software compatibility:
  523. +
  524. +  - Any NFSv4.2/NFSv4.1 server (Linux, Solaris, Illumos, FreeBSD, nfs4j,
  525. +    ...)
  526. +
  527. +  - All tools from Cygwin/MSYS2/MinGW
  528. +
  529. +  - Visual Studio
  530. +
  531. +  - VMware Workstation (can use VMs hosted on NFSv4.2/NFSv4.1
  532. +    filesystem)
  533. +
  534. +# Requirements
  535. +
  536. +- Windows 10 (32bit or 64bit), Windows 11 or Windows Server 2019+2022
  537. +
  538. +- Cygwin:
  539. +
  540. +  - Cygwin versions:
  541. +
  542. +    - 64bit: \>= 3.5.7, recommended \>= 3.6.1
  543. +
  544. +    - 32bit: \>= 3.3.6
  545. +
  546. +  - Packages (required):
  547. +
  548. +    - `cygwin`
  549. +
  550. +    - `cygrunsrv`
  551. +
  552. +    - `cygutils`
  553. +
  554. +    - `cygutils-extra`
  555. +
  556. +    - `libiconv`
  557. +
  558. +    - `libiconv2`
  559. +
  560. +    - `procps-ng`
  561. +
  562. +    - `util-linux`
  563. +
  564. +  - Packages (optional, recommended, required to build ms-nf41-client):
  565. +
  566. +    - `bison`
  567. +
  568. +    - `cygport`
  569. +
  570. +    - `cygwin-devel`
  571. +
  572. +    - `clang`
  573. +
  574. +    - `dos2unix`
  575. +
  576. +    - `pax`
  577. +
  578. +    - `pbzip2`
  579. +
  580. +    - `libnfs-utils` (for `/usr/bin/nfs-ls`)
  581. +
  582. +    - `libiconv-devel`
  583. +
  584. +    - `make`
  585. +
  586. +    - `bmake`
  587. +
  588. +    - `git`
  589. +
  590. +    - `gcc-core`
  591. +
  592. +    - `gcc-g++`
  593. +
  594. +    - `gdb`
  595. +
  596. +    - `mingw64-i686-clang`
  597. +
  598. +    - `mingw64-x86_64-clang`
  599. +
  600. +    - `unzip`
  601. +
  602. +    - `time`
  603. +
  604. +    - `docbook-utils`
  605. +
  606. +    - `docbook-xml45`
  607. +
  608. +    - `docbook-xsl`
  609. +
  610. +    - `docbook-xsl-ns`
  611. +
  612. +    - `libxslt`
  613. +
  614. +    - `w3m`
  615. +
  616. +  - Packages (only-CI):
  617. +
  618. +    - \# required packages, but part of Cygwin default installation
  619. +
  620. +    - \# listed here for CI package list ONLY
  621. +
  622. +    - `bash`
  623. +
  624. +    - `bzip2`
  625. +
  626. +    - `coreutils`
  627. +
  628. +    - `getent`
  629. +
  630. +    - `grep`
  631. +
  632. +    - `hostname`
  633. +
  634. +    - `less`
  635. +
  636. +    - `sed`
  637. +
  638. +    - `tar`
  639. +
  640. +    - `wget`
  641. +
  642. +- MSYS2 (64bit, optional):
  643. +
  644. +  - Packages (recommended):
  645. +
  646. +    - `base-devel`
  647. +
  648. +    - `gcc`
  649. +
  650. +    - `clang`
  651. +
  652. +    - `sed`
  653. +
  654. +    - `time`
  655. +
  656. +    - `coreutils`
  657. +
  658. +    - `util-linux`
  659. +
  660. +    - `grep`
  661. +
  662. +    - `sed`
  663. +
  664. +    - `emacs`
  665. +
  666. +    - `gdb`
  667. +
  668. +    - `make`
  669. +
  670. +    - `autoconf`
  671. +
  672. +    - `automake`
  673. +
  674. +    - `gettext`
  675. +
  676. +    - `gettext-devel`
  677. +
  678. +    - `git`
  679. +
  680. +    - `subversion`
  681. +
  682. +    - `flex`
  683. +
  684. +    - `bison`
  685. +
  686. +    - `unzip`
  687. +
  688. +    - `pax`
  689. +
  690. +    - `tar`
  691. +
  692. +    - `libiconv-devel`
  693. +
  694. +    - `ncurses-devel`
  695. +
  696. +    - `gmp-devel`
  697. +
  698. +    - `mpfr-devel`
  699. +
  700. +    - `mpc-devel`
  701. +
  702. +    - `isl-devel`
  703. +
  704. +    - `procps-ng`
  705. +
  706. +    - `libiconv-devel`
  707. +
  708. +# Installation
  709. +
  710. +## Download and install Cygwin (if not installed yet)
  711. +
  712. +Windows 32bit-vs.-64bit can be tested from Windows `cmd.exe` console:
  713. +
  714. +Run this command:
  715. +
  716. +    echo %PROCESSOR_ARCHITECTURE%
  717. +
  718. +If this returns "AMD64" then you have a Windows 64bit kernel, and if it
  719. +returns "x86" then you have Windows 32bit kernel. If you get any other
  720. +value then this is a (documentation) bug.
  721. +
  722. +Cygwin 64bit can be installed like this:
  723. +
  724. +**Install Cygwin 64bit on Windows 64bit with packages required by
  725. +"ms-nfs41-client" (Windows NFSv4.2 client):**
  726. +
  727. +1.  Create subdir
  728. +
  729. +        mkdir download
  730. +        cd download
  731. +
  732. +2.  Get installer from <https://cygwin.com/setup-x86_64.exe>
  733. +
  734. +        curl --remote-name "https://www.cygwin.com/setup-x86_64.exe"
  735. +
  736. +3.  Run installer with these arguments:
  737. +
  738. +        setup-x86_64.exe -q --site "https://mirrors.kernel.org/sourceware/cygwin" -P cygwin,cygwin-devel,cygrunsrv,cygutils,cygutils-extra,bash,bzip2,coreutils,getent,gdb,grep,hostname,less,libiconv,libiconv2,pax,pbzip2,procps-ng,sed,tar,time,util-linux,wget,libnfs-utils,make,bmake,git,dos2unix,unzip
  739. +
  740. +Cygwin 32bit can be installed like this:
  741. +
  742. +**Install Cygwin 32bit on Windows 32bit with packages required by
  743. +"ms-nfs41-client" (Windows NFSv4.2 client):**
  744. +
  745. +1.  Create subdir
  746. +
  747. +        mkdir download
  748. +        cd download
  749. +
  750. +2.  Get installer from <https://www.cygwin.com/setup-x86.exe>
  751. +
  752. +        curl --remote-name "https://www.cygwin.com/setup-x86.exe"
  753. +
  754. +3.  Run installer with these arguments:
  755. +
  756. +        setup-x86.exe --allow-unsupported-windows -q --no-verify --site "http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/2022/11/23/063457" -P cygwin,cygwin-devel,cygrunsrv,cygutils,cygutils-extra,bash,bzip2,coreutils,getent,gdb,grep,hostname,less,libiconv,libiconv2,pax,pbzip2,procps-ng,sed,tar,time,util-linux,wget,libnfs-utils,make,bmake,git,dos2unix,unzip
  757. +
  758. +## Download and install MSYS2/64bit \[OPTIONAL\]
  759. +
  760. +1.  Download & install from Cygwin
  761. +
  762. +        mkdir -p download && cd download
  763. +        wget 'https://github.com/msys2/msys2-installer/releases/download/2025-02-21/msys2-x86_64-20250221.exe'
  764. +        chmod a+x 'msys2-x86_64-20250221'
  765. +        ./msys2-x86_64-20250221 --default-answer --root 'C:\msys64' install
  766. +
  767. +2.  Install extra packages:
  768. +
  769. +    Start MSYS2 UCRT mintty and execute this:
  770. +
  771. +        pacman -S --noconfirm base-devel gcc clang sed time coreutils util-linux grep sed emacs gdb make autoconf automake gettext gettext-devel git subversion flex bison unzip pax tar libiconv-devel ncurses-devel gmp-devel mpfr-devel mpc-devel isl-devel procps-ng libiconv-devel
  772. +
  773. +## Download "ms-nfs41-client" installation tarball
  774. +
  775. +(from a Cygwin terminal)
  776. +
  777. +    $ mkdir -p ~/download
  778. +    $ cd ~/download
  779. +    $ wget 'http://www.nrubsig.org/people/gisburn/work/msnfs41client/releases/testing/${bintarball.base_filename}.tar.bz2'
  780. +    $ openssl sha256 "${bintarball.base_filename}.tar.bz2"
  781. +    SHA2-256(${bintarball.base_filename}.tar.bz2)= ${bintarball.archive_sha256hash}
  782. +
  783. +## Installation (as "Administrator")
  784. +
  785. +    $ (cd / && tar -xf ~/download/${bintarball.base_filename}.tar.bz2 )
  786. +    $ /sbin/msnfs41client install
  787. +    <REBOOT>
  788. +
  789. +## Deinstallation
  790. +
  791. +    $ (set -o xtrace ; cd / && tar -tf ~/download/${bintarball.base_filename}.tar.bz2 | while read i ; do [[ -f "$i" ]] && rm "$i" ; done)
  792. +    <REBOOT>
  793. +
  794. +# Usage
  795. +
  796. +## Preparing the NFS server
  797. +
  798. +### NFS server config
  799. +
  800. +- Make sure the NFS client can access the NFS server
  801. +
  802. +- The NFS server should send owner and owner_group information as
  803. +  user@domain and group@domain, and not as numeric uid/gid information
  804. +
  805. +### User/group accounts on the NFS server
  806. +
  807. +It is required that all Windows users and groups used by the Windows NFS
  808. +client have user/group accounts on the server side.
  809. +
  810. +If no central user&group management between NFS server and NFS clients
  811. +exists the `/sbin/cygwinaccount2nfs4account` script can be used to
  812. +manually create matching `/etc/group` and `/etc/passwd` entries on the
  813. +NFS server side.
  814. +
  815. +## Starting the NFS client daemon
  816. +
  817. +### Run as Windows Service
  818. +
  819. +- Start NFSv4 client daemon as Windows service (requires "Administrator"
  820. +  account):
  821. +
  822. +      $ sc start ms-nfs41-client-service
  823. +
  824. +- Notes:
  825. +
  826. +  - requires "Administrator" account, and one nfsd client daemon is used
  827. +    for all users on a machine.
  828. +
  829. +  - The "ms-nfs41-client-service" service is installed by default as
  830. +    "disabled" and therefore always requires a "manual" start (e.g.,
  831. +    `$ sc start ms-nfs41-client-service #`)
  832. +
  833. +  - DOS devices are virtualised per LSA Logon, so each Logon needs to do
  834. +    a separate `nfs_mount.exe` to mount a NFSv4 share. The exception are
  835. +    mounts created by user "SYSTEM", such mounts are available to all
  836. +    users/logons. (see `PsExec` or function "su_system" in
  837. +    `msnfs41client.bash` how to run a process as user "SYSTEM")
  838. +
  839. +  - `nfsd_debug.exe` will run as user "SYSTEM", but will do user
  840. +    impersonation for each request
  841. +
  842. +  - stopping the service will NOT unmount filesystems, and due to a bug
  843. +    a reboot is required to restart and mount any NFSv4 filesystems
  844. +    again
  845. +
  846. +- Administration:
  847. +
  848. +  - Follow new log messages:
  849. +
  850. +        $ tail -f '/var/log/ms-nfs41-client-service.log'
  851. +
  852. +  - Query service status:
  853. +
  854. +        $ sc queryex ms-nfs41-client-service
  855. +
  856. +  - Query service config:
  857. +
  858. +        $ sc qc ms-nfs41-client-service
  859. +
  860. +  - Start service automatically:
  861. +
  862. +    (`nfsd_debug.exe` will be started automagically, but mounts are not
  863. +    restored):
  864. +
  865. +        $ sc config ms-nfs41-client-service start=auto
  866. +
  867. +  - Start service manually (default):
  868. +
  869. +        $ sc config ms-nfs41-client-service start=disabled
  870. +
  871. +### Manual starting the daemon
  872. +
  873. +Run the NFSv4 client daemon manually:
  874. +
  875. +- run this preferably as "Administrator", but this is not a requirement
  876. +
  877. +- requires separate terminal
  878. +
  879. +<!-- -->
  880. +
  881. +    $ /sbin/msnfs41client run_daemon
  882. +
  883. +## Mounting and using NFS filesystems
  884. +
  885. +### Basic usage
  886. +
  887. +Mount a filesystem to drive N: and use it
  888. +
  889. +    $ /sbin/nfs_mount -o rw N 10.49.202.230:/net_tmpfs2
  890. +    Successfully mounted '10.49.202.230@2049' to drive 'N:'
  891. +    $ cd /cygdrive/n/
  892. +    $ ls -la
  893. +    total 4
  894. +    drwxrwxrwt 5 Unix_User+0      Unix_Group+0      100 Dec  7 14:17 .
  895. +    dr-xr-xr-x 1 roland_mainz     Kein                0 Dec 14 13:48 ..
  896. +    drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  80 Dec 12 16:24 10492030
  897. +    drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  60 Dec 13 17:58 directory_t
  898. +    drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  60 Dec  7 11:01 test2
  899. +
  900. +Unmount filesystem:
  901. +
  902. +    $ cd ~ && /sbin/nfs_umount N:
  903. +    # OR
  904. +    $ cd ~
  905. +    $ net use N: /delete
  906. +
  907. +Mount a filesystem WITHOUT a dos drive assigned and use it via UNC path
  908. +
  909. +    $ /sbin/nfs_mount -o rw 10.49.202.230:/net_tmpfs2
  910. +    Successfully mounted '10.49.202.230@2049' to drive '\0.49.202.230@2049\nfs4\net_tmpfs2'
  911. +    $ cygpath -u '\0.49.202.230@2049\nfs4\net_tmpfs2'
  912. +    //10.49.202.230@2049/nfs4/net_tmpfs2
  913. +    $ cd '//10.49.202.230@2049/nfs4/net_tmpfs2'
  914. +    $ ls -la
  915. +    total 4
  916. +    drwxrwxrwt 5 Unix_User+0      Unix_Group+0      100 Dec  7 14:17 .
  917. +    dr-xr-xr-x 1 roland_mainz     Kein                0 Dec 14 13:48 ..
  918. +    drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  80 Dec 12 16:24 10492030
  919. +    drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  60 Dec 13 17:58 directory_t
  920. +    drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  60 Dec  7 11:01 test2
  921. +
  922. +Unmount filesystem:
  923. +
  924. +    $ cd ~ && /sbin/nfs_umount '\0.49.202.230@2049\nfs4\net_tmpfs2'
  925. +    # OR
  926. +    $ cd ~
  927. +    $ net use '\0.49.202.230@2049\nfs4\net_tmpfs2' /delete
  928. +
  929. +List mounted NFSv4.2 filesystems:
  930. +
  931. +    $ /sbin/nfs_mount
  932. +
  933. +### Global/System-wide mounts
  934. +
  935. +Mounts created by user "SYSTEM" are usable by all users in a system.
  936. +Example usage:
  937. +
  938. +    # Create a file /etc/fstab.msnfs41client, which list the mounts
  939. +    # which should be available system-wide
  940. +    $ cat /etc/fstab.msnfs41client
  941. +    nfs://[fe80::21b:1bff:fec3:7713]//bigdisk       V       nfs     rw      0       0
  942. +    # run "ms-nfs41-client-globalmountall-service", which runs
  943. +    # /sbin/mountall_msnfs41client as user "SYSTEM" to read
  944. +    # /etc/fstab.msnfs41client and mount the matching filesystems
  945. +    sc start ms-nfs41-client-globalmountall-service
  946. +
  947. +BUG: "ms-nfs41-client-globalmountall-service" currently does not wait
  948. +until `nfsd*.exe` is available for accepting mounts.
  949. +
  950. +### WSL usage
  951. +
  952. +Example 1: Mount Windows NFSv4.2 share via Windows drive letter
  953. +
  954. +Mount NFSv4.2 share in Windows to drive letter 'N':
  955. +
  956. +    $ /sbin/nfs_mount -o rw 'N' nfs://10.49.202.230//bigdisk
  957. +    Successfully mounted '10.49.202.230@2049' to drive 'N:'
  958. +
  959. +Within WSL mount drive letter 'N' to `/mnt/n`
  960. +
  961. +    $ sudo bash
  962. +    $ mkdir /mnt/n
  963. +    $ mount -t drvfs N: /mnt/n
  964. +
  965. +Example 2: Mount Windows NFSv4.2 share via UNC path:
  966. +
  967. +Mount NFSv4.2 share in Windows
  968. +
  969. +    $ /sbin/nfs_mount -o rw nfs://10.49.202.230//bigdisk
  970. +    Successfully mounted '10.49.202.230@2049' to drive '\0.49.202.230@2049\nfs4\bigdisk'
  971. +
  972. +Within WSL mount UNC path returned by `/sbin/nfs_mount`
  973. +
  974. +    $ sudo bash
  975. +    $ mkdir /mnt/bigdisk
  976. +    $ mount -t drvfs '\0.49.202.230@2049\nfs4\bigdisk' /mnt/bigdisk
  977. +
  978. +**Known issues with WSL:**
  979. +
  980. +- Softlinks do not work yet
  981. +
  982. +- Creating a hard link returns "Invalid Argument", maybe drvfs
  983. +  limitation
  984. +
  985. +- Not all POSIX file types (e.g. block devices) etc. are supported
  986. +
  987. +# Notes
  988. +
  989. +- Idmapping (including uid/gid mapping) between NFSv4 client and NFSv4
  990. +  server works via `/lib/msnfs41client/cygwin_idmapper.ksh`, which
  991. +  either uses builtin static data, or `/usr/bin/getent passwd` and
  992. +  `/usr/bin/getent group`. As `getent` uses the configured name services
  993. +  it should work with LDAP too. This is still work-in-progress, with the
  994. +  goal that both NFSv4 client and server can use different uid/gid
  995. +  numeric values for client and server side.
  996. +
  997. +- UNC paths are supported, after successful mounting `/sbin/nfs_mount`
  998. +  will list the paths in Cygwin/MSYS2 UNC format.
  999. +
  1000. +- SIDs work, users with valid Windows accounts (see Cygwin idmapping
  1001. +  above get their SIDs, unknown users with valid uid/gid values get
  1002. +  Unix_User+id/Unix_Group+id SIDs, and all others are mapped to
  1003. +  nobody/nogroup SIDs.
  1004. +
  1005. +- Workflow for `nfs://`-URLs:
  1006. +
  1007. +  - Create `nfs://`-URLs with `nfsurlconv`, read `$ nfsurlconv --man #`
  1008. +    for usage
  1009. +
  1010. +  - pass URL to `nfs_mount.exe` like this:
  1011. +    `$ nfs_mount -o sec=sys,rw 'L' nfs://derfwnb4966_ipv4//bigdisk #`
  1012. +
  1013. +- Cygwin/MSYS2 symlinks are supported, but might require
  1014. +  `$ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1 #`.
  1015. +  This includes symlinks to UNC paths, e.g., as Administrator
  1016. +  `$ cmd /c 'mklink /d c:\home\rmainz \\derfwpc5131_ipv6@2049\nfs4\export\home2\rmainz' #`
  1017. +  and then `$ cd /cygdrive/c/home/rmainz/ #` should work
  1018. +
  1019. +- performance: All binaries are built without any optimisation, so the
  1020. +  filesystem is much slower than it could be.
  1021. +
  1022. +- bad performance due to Windows Defender AntiVirus:
  1023. +
  1024. +  - Option 1: disable Windows defender realtime monitoring (requires
  1025. +    Administrator shell)
  1026. +
  1027. +        powershell -Command 'Set-MpPreference -DisableRealtimeMonitoring 1'
  1028. +
  1029. +  - Option 2: Add "`nfsd.exe`", "`nfsd_debug.exe`", "`ksh93.exe`",
  1030. +    "`bash.exe`", "`git.exe`" and other offending commands to the
  1031. +    process name whitelist.
  1032. +
  1033. +- performance: Use `vmxnet3` in VMware to improve performance
  1034. +
  1035. +- ACLs are supported via the normal Windows ACL tools, but on Linux
  1036. +  require the `nfs4_getfacl`/`nfs4_setfacl` utilities to see the data.
  1037. +
  1038. +  **Example 1** (assuming that Windows, Linux NFSv4 client and NFSv4
  1039. +  server have a user "siegfried_wulsch"):
  1040. +
  1041. +  - On Windows on a NFSv4 filesystem:
  1042. +
  1043. +        $ icacls myhorribledata.txt /grant "siegfried_wulsch:WD" #
  1044. +
  1045. +  - On Linux NFSv4 clients you will then see this:
  1046. +
  1047. +        $ nfs4_getfacl myhorribledata.txt
  1048. +        A::OWNER@:rwatTcCy
  1049. +        A::siegfried_wulsch@global.loc:rwatcy
  1050. +        A::GROUP@:rtcy
  1051. +        A::EVERYONE@:rtcy
  1052. +
  1053. +  **Example 2** (assuming that Windows, Linux NFSv4 client and NFSv4
  1054. +  server have a group "cygwingrp2"):
  1055. +
  1056. +  - On Windows on a NFSv4 filesystem:
  1057. +
  1058. +        $ icacls myhorribledata.txt /grant "cygwingrp2:(WDAC)" /t /c #
  1059. +
  1060. +  - On Linux NFSv4 clients you will then see this:
  1061. +
  1062. +        $ nfs4_getfacl myhorribledata.txt
  1063. +        A::OWNER@:rwatTcCy
  1064. +        A::GROUP@:rtcy
  1065. +        A:g:cygwingrp2@global.loc:rtcy
  1066. +        A::EVERYONE@:rtcy
  1067. +
  1068. +- `nfs_mount.exe` vs. reserved ports: By default the NFSv4 server on
  1069. +  Solaris, Illumos, Linux etc. only accepts connections if the NFSv4
  1070. +  client uses a "privileged (TCP) port", i.e., using a TCP port number
  1071. +  \< 1024. If `nfsd.exe`/`nfsd_debug.exe` is started without the Windows
  1072. +  privilege to use reserved ports, then a mount attempt can fail. This
  1073. +  can be worked around on the NFSv4 server side - on Linux using the
  1074. +  "insecure" export option in `/etc/exports` and on Solaris/Illumos
  1075. +  using export option "resvport" (see `nfs(5)`).
  1076. +
  1077. +- Accessing mounts from a VMware/QEMU/VirtualBox VM using NAT requires
  1078. +  the the "insecure" export option in `/etc/exports` and on
  1079. +  Solaris/Illumos using export option "resvport" (see `nfs(5)`), as the
  1080. +  NFSv4 client source TCP port will be \>= 1024.
  1081. +
  1082. +- Install: Adding Windows accounts+groups to the NFSv4 server:
  1083. +  `ms-nfs41-client` comes with `/sbin/cygwinaccount2nfs4account` to
  1084. +  convert the Win32/Cygwin account information of the (current)
  1085. +  user+groups to a small script for the NFSv4 server to set-up these
  1086. +  accounts on the server side.
  1087. +
  1088. +- `nfs_mount -o sec=none ... #` works with Solaris 11.4 nfsd, but might
  1089. +  require Linux kernel commit
  1090. +  <https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git/patch/?id=bb4f07f2409c26c01e97e6f9b432545f353e3b66>
  1091. +  ("nfsd: Fix NFSD_MAY_BYPASS_GSS and NFSD_MAY_BYPASS_GSS_ON_ROOT") to
  1092. +  work.
  1093. +
  1094. +# Known issues
  1095. +
  1096. +- The kernel driver ("`nfs41_driver.sys`") does not yet have a
  1097. +  cryptographic signature for SecureBoot - which means it will only work
  1098. +  if SecureBoot is turned off (otherwise
  1099. +  `$ /sbin/msnfs41client install #` will FAIL!)
  1100. +
  1101. +- If `nfsd_debug.exe` crashes or gets killed, the only safe way to run
  1102. +  it again requires a reboot
  1103. +
  1104. +- LDAP support does not work yet
  1105. +
  1106. +- Attribute caching is too aggressive
  1107. +
  1108. +- Caching in the kernel does not always work. For example
  1109. +  `$ tail -f ... #` does not not see new data. Workaround: Use GNU
  1110. +  tail'S `$ tail --follow=name ... #` Working theory is that this is
  1111. +  related to FCB caching, see `|FCB_STATE_FILESIZECACHEING_ENABLED|`, as
  1112. +  the `nfs41_driver.sys` kernel module does not see the `|stat()|`
  1113. +  syscalls. But `$ tail -f ... #` always works for a moment if something
  1114. +  else opens the same file.
  1115. +
  1116. +- Unmounting and then mounting the same filesystem causes issues as the
  1117. +  name cache in `nfsd*.exe` is not flushed on unmount, including
  1118. +  leftover delegations.
  1119. +
  1120. +- `krb5p` security with AES keys do not work against the linux server,
  1121. +  as it does not support gss krb5 v2 tokens with rotated data.
  1122. +
  1123. +- When recovering opens and locks outside of the server's grace period,
  1124. +  client does not check whether the file has been modified by another
  1125. +  client.
  1126. +
  1127. +- If `nfsd.exe` is restarted while a drive is mapped, that drive needs
  1128. +  to be remounted before further use.
  1129. +
  1130. +- Does not allow renaming a file on top of an existing open file.
  1131. +  Connectathon's special test `op_ren` has been commented out.
  1132. +
  1133. +- File access timestamps might be wrong for delegations.
  1134. +
  1135. +- Extended attributes are supported with some limitations:
  1136. +
  1137. +  - a\) the server must support NFS Named Attributes,
  1138. +
  1139. +  - b\) the order of listings cannot be guaranteed by NFS, and
  1140. +
  1141. +  - c\) the EaSize field cannot be reported for directory queries of
  1142. +    `FileBothDirInformation`, `FileFullDirInfo`, or `FileIdFullDirInfo`.
  1143. +
  1144. +- Win10/32bit-only: `$ net use H: /delete #` does not work, use
  1145. +  `$ nfs_umount 'H'` instead \#
  1146. +
  1147. +- Windows event log can list errors like "MUP 0xc0000222"
  1148. +  (`|STATUS_LOST_WRITEBEHIND_DATA|`) in case the disk on the NFSv4
  1149. +  server is full and outstanding writes from a memory-mapped file fail.
  1150. +  Example:
  1151. +
  1152. +      {Fehler beim verzoegerten Schreibvorgang} Nicht alle Daten fuer die
  1153. +      Datei "\\34.159.25.153@2049\nfs4\export\nfs4export\gcc\lto-dump.exe"
  1154. +      konnten gespeichert werden. Daten gingen verloren.
  1155. +      Dieser Fehler wurde von dem Server zurueckgegeben, auf dem sich die
  1156. +      Datei befindet. Versuchen Sie, die Datei woanders zu speichern.
  1157. +
  1158. +# Troubleshooting && finding bugs/debugging
  1159. +
  1160. +- `nfsd_debug.exe` has the `-d` option to set a level for debug output.
  1161. +  Edit `/sbin/msnfs41client` to set the `"-d"` option.
  1162. +
  1163. +- The "msnfs41client" script has the option "`watch_kernel_debuglog`" to
  1164. +  get the debug output of the kernel module.
  1165. +
  1166. +  Run as Administrator: `$ /sbin/msnfs41client watch_kernel_debuglog #`
  1167. +
  1168. +  Currently requires DebugView
  1169. +  (<https://learn.microsoft.com/en-gb/sysinternals/downloads/debugview>)
  1170. +  to be installed.
  1171. +
  1172. +- Watching network traffic:
  1173. +
  1174. +  - Use `$ /sbin/msnfs41client watch_nfs_traffic #` to watch the NFS
  1175. +    network traffic
  1176. +
  1177. +  - WireShark has a command line tool called "`tshark`", which can be
  1178. +    used to see NFSv4 traffic. As NFSv4 uses RPC you have to filter for
  1179. +    RPC, and the RPC filter automatically identifies NFSv4 traffic on
  1180. +    its RPC id. Example for Windows: (for NFSv4 default TCP port "2049",
  1181. +    replace "2049" with the desired port if you use a custom port; use
  1182. +    "ipconfig" to find the correct interface name, in this case
  1183. +    "Ethernet0"):
  1184. +
  1185. +        $ nfsv4port=2049 ; /cygdrive/c/Program\ Files/Wireshark/tshark \
  1186. +          -f "port $nfsv4port" -d "tcp.port==${nfsv4port},rpc" -i Ethernet0
  1187. +
  1188. +  - If you are running inside a VMware VM on a Linux host it might
  1189. +    require `$ chmod a+rw /dev/vmnet0 #` on VMware host, so that the VM
  1190. +    can use "Promiscuous Mode".
  1191. +
  1192. +# Development
  1193. +
  1194. +## Source code
  1195. +
  1196. +Source code can be obtained from
  1197. +<https://github.com/kofemann/ms-nfs41-client> or as git bundle from
  1198. +`/usr/src/msnfs41client/msnfs41client_git.bundle`
  1199. +
  1200. +## Building ms-nfs41-client
  1201. +
  1202. +### Building ms-nfs41-client using Cygwin+Makefile
  1203. +
  1204. +#### Required Software
  1205. +
  1206. +- **Option 1:** Windows 10 with Visual Studio 2019
  1207. +
  1208. +  - Start Visual Studio 2019 installer and import the installer config
  1209. +    file `ms-nfs41-client/build.vc19/ms-nfs41-client_vs2019.vsconfig`,
  1210. +    and then install Visual Studio.
  1211. +
  1212. +    > [!NOTE]
  1213. +    > Due to a bug in the VS installer, it is sometimes required to
  1214. +    > manually add another (random) component to be installed;
  1215. +    > otherwise, the imported config might be ignored.
  1216. +
  1217. +  - WDK for Windows 10, version 2004, from
  1218. +    <https://go.microsoft.com/fwlink/?linkid=2128854>
  1219. +
  1220. +  - Cygwin 64bit \>= 3.5.0 (see
  1221. +    `ms-nfs41-clientcygwin/README.bintarball.txt` for Cygwin 32bit and
  1222. +    64bit installation instructions)
  1223. +
  1224. +  - PanDoc document converter, from
  1225. +    <https://github.com/jgm/pandoc/releases/download/3.7.0.1/pandoc-3.7.0.1-windows-x86_64.msi>
  1226. +
  1227. +- **Option 2:** Windows 10/11 with Visual Studio 2022
  1228. +
  1229. +  - Start Visual Studio 2022 installer and import the installer config
  1230. +    file `ms-nfs41-client/build.vc19/ms-nfs41-client_vs2022.vsconfig`,
  1231. +    and then install Visual Studio.
  1232. +
  1233. +    > [!NOTE]
  1234. +    > Due to a bug in the VS installer, it is sometimes required to
  1235. +    > manually add another (random) component to be installed;
  1236. +    > otherwise, the imported config might be ignored.
  1237. +
  1238. +  - WDK for Windows 11, version 1591, from
  1239. +    <https://go.microsoft.com/fwlink/?linkid=2286137>
  1240. +
  1241. +  - Cygwin 64bit \>= 3.5.0 (see
  1242. +    `ms-nfs41-clientcygwin/README.bintarball.txt` for Cygwin 32bit and
  1243. +    64bit installation instructions)
  1244. +
  1245. +  - PanDoc document converter, from
  1246. +    <https://github.com/jgm/pandoc/releases/download/3.7.0.1/pandoc-3.7.0.1-windows-x86_64.msi>
  1247. +
  1248. +#### Build the Project
  1249. +
  1250. +- **Using Visual Studio 2019+Cygwin command line (bash/ksh93):**
  1251. +
  1252. +      # this creates a 32bit+kernel+64bit-kernel build for Windows 10+11
  1253. +      export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/:$PATH"
  1254. +      git clone https://github.com/kofemann/ms-nfs41-client.git
  1255. +      cd ms-nfs41-client
  1256. +      cd cygwin
  1257. +      make build
  1258. +      make installdest
  1259. +      make bintarball
  1260. +
  1261. +- **Using Visual Studio 2022+Cygwin command line (bash/ksh93):**
  1262. +
  1263. +      # this creates a 64bit-kernel only build for Windows 11
  1264. +      export PATH="/cygdrive/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/:$PATH"
  1265. +      git clone https://github.com/kofemann/ms-nfs41-client.git
  1266. +      cd ms-nfs41-client
  1267. +      # "retarget" VS platform toolset to "v143"
  1268. +      # ("v142" should remain the default when comitting)
  1269. +      sed -i -E 's/<PlatformToolset>v142<\/PlatformToolset>/<PlatformToolset>v143<\/PlatformToolset>/g' $(find 'build.vc19' -name \*.vcxproj)
  1270. +      cd cygwin
  1271. +      make build64
  1272. +      make installdest64
  1273. +      make bintarball64
  1274. +
  1275. +> [!NOTE]
  1276. +> `make installdest` or `make installdest64` can fail on SMB/NFSv4.1
  1277. +> filesystems with a "link.exe" crash. The workaround is to disable
  1278. +> incremental linking before building, e.g., do:
  1279. +>
  1280. +>     cd ms-nfs41-client
  1281. +>     sed -i -E 's/<LinkIncremental>true<\/LinkIncremental>/<LinkIncremental>false<\/LinkIncremental>/g' $(find build.vc19 -name \*.vcxproj)
  1282. +>
  1283. +> This Visual Studio bug is tracked as
  1284. +> <https://developercommunity.visualstudio.com/t/Visual-Studio-link.exe-crashes-on-networ/10735424>
  1285. +> ("Visual Studio link.exe crashes on network filesystem").
  1286. +
  1287. +### Testing
  1288. +
  1289. +See `tests/manual_testing.txt`
  1290. +
  1291. +# Mailing list
  1292. +
  1293. +Please direct any questions to
  1294. +<ms-nfs41-client-devel@lists.sourceforge.net> (list
  1295. +[archive](https://sourceforge.net/p/ms-nfs41-client/mailman/ms-nfs41-client-devel/))
  1296. +
  1297. +\#EOF.
  1298. diff --git a/cygwin/Makefile b/cygwin/Makefile
  1299. index f2aadb4..c390347 100644
  1300. --- a/cygwin/Makefile
  1301. +++ b/cygwin/Makefile
  1302. @@ -154,7 +154,7 @@ installdest64: \
  1303.  # in parallel
  1304.  installdest: installdest_util installdest32 .WAIT installdest64
  1305.  
  1306. -bintarball: installdest
  1307. +bintarball: installdest $(PROJECT_BASEDIR_DIR)/README.txt $(PROJECT_BASEDIR_DIR)/README.md
  1308.         set -o errexit ; set -o xtrace ; \
  1309.         base_filename="msnfs41client_cygwin_64bit32bit_binaries_$$(date +%Y%m%d_%Hh%Mm)_git$$(git rev-parse --short HEAD)" ; \
  1310.         ( \
  1311. @@ -167,7 +167,7 @@ bintarball: installdest
  1312.                 | \
  1313.                         bzip2 -9 >"$${base_filename}.tar.bz2" ; \
  1314.         archive_sha256hash="$$(openssl sha256 -r "$${base_filename}.tar.bz2" | while read a dummy ; do printf "%s\n" "$$a" ; done)" ; \
  1315. -               sed -E <"../cygwin/README.bintarball.txt" \
  1316. +               sed -E <"../README.txt" \
  1317.                         -e "s/\\$$\{bintarball.base_filename\}/$${base_filename}/g" \
  1318.                         -e "s/\\$$\{bintarball.archive_sha256hash\}/$${archive_sha256hash}/g" >"$${base_filename}.readme" \
  1319.         ) ; \
  1320. @@ -176,7 +176,7 @@ bintarball: installdest
  1321.         ls -l "$(DESTDIR)/$${base_filename}.readme"
  1322.         sync
  1323.  
  1324. -bintarball32: installdest32
  1325. +bintarball32: installdest32 $(PROJECT_BASEDIR_DIR)/README.txt $(PROJECT_BASEDIR_DIR)/README.md
  1326.         set -o errexit ; set -o xtrace ; \
  1327.         base_filename="msnfs41client_cygwin_32bit_binaries_$$(date +%Y%m%d_%Hh%Mm)_git$$(git rev-parse --short HEAD)" ; \
  1328.         ( \
  1329. @@ -188,7 +188,7 @@ bintarball32: installdest32
  1330.                 | \
  1331.                         bzip2 -9 >"$${base_filename}.tar.bz2" ; \
  1332.         archive_sha256hash="$$(openssl sha256 -r "$${base_filename}.tar.bz2" | while read a dummy ; do printf "%s\n" "$$a" ; done)" ; \
  1333. -               sed -E <"../cygwin/README.bintarball.txt" \
  1334. +               sed -E <"../README.txt" \
  1335.                         -e "s/\\$$\{bintarball.base_filename\}/$${base_filename}/g" \
  1336.                         -e "s/\\$$\{bintarball.archive_sha256hash\}/$${archive_sha256hash}/g" >"$${base_filename}.readme" \
  1337.         ) ; \
  1338. @@ -197,7 +197,7 @@ bintarball32: installdest32
  1339.         ls -l "$(DESTDIR)/$${base_filename}.readme"
  1340.         sync
  1341.  
  1342. -bintarball64: installdest64
  1343. +bintarball64: installdest64 $(PROJECT_BASEDIR_DIR)/README.txt $(PROJECT_BASEDIR_DIR)/README.md
  1344.         set -o errexit ; set -o xtrace ; \
  1345.         base_filename="msnfs41client_cygwin_64bit_binaries_$$(date +%Y%m%d_%Hh%Mm)_git$$(git rev-parse --short HEAD)" ; \
  1346.         ( \
  1347. @@ -209,7 +209,7 @@ bintarball64: installdest64
  1348.                 | \
  1349.                         bzip2 -9 >"$${base_filename}.tar.bz2" ; \
  1350.         archive_sha256hash="$$(openssl sha256 -r "$${base_filename}.tar.bz2" | while read a dummy ; do printf "%s\n" "$$a" ; done)" ; \
  1351. -               sed -E <"../cygwin/README.bintarball.txt" \
  1352. +               sed -E <"../README.txt" \
  1353.                         -e "s/\\$$\{bintarball.base_filename\}/$${base_filename}/g" \
  1354.                         -e "s/\\$$\{bintarball.archive_sha256hash\}/$${archive_sha256hash}/g" >"$${base_filename}.readme" \
  1355.         ) ; \
  1356. @@ -218,6 +218,34 @@ bintarball64: installdest64
  1357.         ls -l "$(DESTDIR)/$${base_filename}.readme"
  1358.         sync
  1359.  
  1360. +$(PROJECT_BASEDIR_DIR)/README.html: $(PROJECT_BASEDIR_DIR)/docs/README.xml
  1361. +       xsltproc \
  1362. +               -xinclude \
  1363. +               -o "$(PROJECT_BASEDIR_DIR)/README.html" \
  1364. +               /usr/share/sgml/docbook/xsl-ns-stylesheets/xhtml-1_1/docbook.xsl \
  1365. +               $(PROJECT_BASEDIR_DIR)/docs/README.xml
  1366. +
  1367. +# README.md rule is not part of the default build as Cygwin does not have a pandoc package
  1368. +$(PROJECT_BASEDIR_DIR)/README.md: $(PROJECT_BASEDIR_DIR)/docs/README.xml
  1369. +       pandoc \
  1370. +               -f docbook \
  1371. +               -t gfm \
  1372. +               --table-of-contents=true \
  1373. +               -s "$$(cygpath -w "$(PROJECT_BASEDIR_DIR)/docs/README.xml")" \
  1374. +               -o "$$(cygpath -w "$(PROJECT_BASEDIR_DIR)/README.md")"
  1375. +       # make sure we always use UNIX line endings
  1376. +       dos2unix "$(PROJECT_BASEDIR_DIR)/README.md"
  1377. +       # Remove bogus -x flag set by Windows PanDoc
  1378. +       chmod a-x "$(PROJECT_BASEDIR_DIR)/README.md"
  1379. +
  1380. +$(PROJECT_BASEDIR_DIR)/README.txt: $(PROJECT_BASEDIR_DIR)/README.html
  1381. +       w3m \
  1382. +               -O UTF8 \
  1383. +               -graph \
  1384. +               -cols 80 \
  1385. +               -dump \
  1386. +               "README.html" >"$(PROJECT_BASEDIR_DIR)/README.txt"
  1387. +
  1388.  #
  1389.  # clean destdir/, but only if nfsd*.exe does not use it right now
  1390.  #
  1391. diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
  1392. deleted file mode 100644
  1393. index 160df6f..0000000
  1394. --- a/cygwin/README.bintarball.txt
  1395. +++ /dev/null
  1396. @@ -1,685 +0,0 @@
  1397. -###
  1398. -### msnfs41client Cygwin binary tarball README
  1399. -###
  1400. -
  1401. -##
  1402. -## WARNING: ALPHA VERSION, ONLY SUITABLE FOR BUG HUNTING!!
  1403. -##
  1404. -
  1405. -
  1406. -#
  1407. -# 1. What is this ?
  1408. -#
  1409. -NFSv4.2/NFSv4.1 filesystem driver for Windows 10/11&Windows Server 2019+2022
  1410. -
  1411. -
  1412. -#
  1413. -# 2. Features:
  1414. -#
  1415. -- Full NFSv4.2/NFSv4.1 protocol support
  1416. -
  1417. -- idmapper (mapping usernames and uid/gid values between server and
  1418. -    client)
  1419. -
  1420. -- Support for custom ports (NFSv4 defaults to TCP port 2049, this
  1421. -    client can use different ports per mount)
  1422. -
  1423. -- Support for nfs://-URLs
  1424. -    * Why ? nfs://-URLs are cross-platform, portable and
  1425. -      Character-Encoding independent descriptions of NFSv4 server
  1426. -      resources (exports).
  1427. -    - including custom ports and raw IPv6 addresses
  1428. -    - nfs://-URL conversion utility (/usr/bin/nfsurlconv) to convert
  1429. -        URLs, including non-ASCII/Unicode characters in mount path
  1430. -
  1431. -- Support ssh forwarding, e.g. mounting NFSv4 filesystems via ssh
  1432. -    tunnel
  1433. -
  1434. -- Support for long paths (up to 4096 bytes), no Windows MAXPATH limit
  1435. -
  1436. -- Unicode support
  1437. -    - File names can use any Unicode character supported by
  1438. -      the NFS server's filesystem.
  1439. -    - nfs://-URLs can be used to mount filesystems with non-ASCII
  1440. -      characters in the mount path, independent of current locale.
  1441. -
  1442. -- UNC paths
  1443. -    - Mounting UNC paths without DOS drive letter
  1444. -    - IPv6 support in UNC paths
  1445. -    - /sbin/nfs_mount prints UNC paths in Win32+Cygwin/MSYS2 formats
  1446. -    - Cygwin/MSYS2 bash+ksh93 support UNC paths, e.g.
  1447. -      cd //derfwnb4966@2049/nfs4/bigdisk/mysqldb4/
  1448. -    - Symlinks on NFS can redirect to other filesystems via UNC
  1449. -      syntax and work with Cygwin, MSYS2, cmd.exe, powershell etc.,
  1450. -      e.g.:
  1451. -      mklink /D symlnk1_to_h_tmp \\lab17@2049\nfs4\export\home\rsm\tmp
  1452. -
  1453. -- WSL support
  1454. -    - Mount Windows NFSv4.2 shares via drive letter or UNC path
  1455. -      in WSL via mount -t drvfs
  1456. -    - Supports NFS owner/group to WSL uid/gid mapping
  1457. -
  1458. -- IPv6 support
  1459. -    - IPv6 address within '[', ']'
  1460. -      (will be converted to *.ipv6-literal.net)
  1461. -
  1462. -- Windows ACLs <---> NFSv4 ACL translation
  1463. -    - Win32 C:\Windows\system32\icacls.exe
  1464. -    - Cygwin /usr/bin/setfacl+/usr/bin/getfacl
  1465. -    - Windows Explorer ACL dialog
  1466. -
  1467. -- Sparse file support
  1468. -    - Requires NFSv4.2 server which supports the NFSv4.2
  1469. -      operations "ALLOCATE", "DEALLOCATE", "SEEK", and the
  1470. -      |FATTR4_WORD1_SPACE_USED| attribute.
  1471. -    - Full Win32 sparse file API support, including creation,
  1472. -      punching holes, enumeration of hole&data ranges etc.
  1473. -    - Supports Win32 APIs |FSCTL_QUERY_ALLOCATED_RANGES|,
  1474. -      |FSCTL_SET_SPARSE|, |FSCTL_SET_ZERO_DATA|; and
  1475. -      |NfsV3Attributes.used| EA
  1476. -    - Cygwin sparse file support requires >= Cygwin 3.6 to support
  1477. -      POSIX-1.2024 |lseek(...,SEEK_HOLE/SEEK_DATA,...)|, which is
  1478. -      needed for coreutils /usr/bin/fallocate and
  1479. -      $ /usr/bin/cp --sparse=auto src dest #
  1480. -    - /cygdrive/c/Windows/system32/fsutil sparse queryrange myfile.dat
  1481. -      can be used to enumerate ranges where data are allocated
  1482. -      (BUG: Win10+Win11 fsutil only support 64 data ranges, the
  1483. -      filesystem itself supports an unlimited number of data ranges)
  1484. -    - /cygdrive/c/Windows/system32/xcopy /sparse can be
  1485. -      used to copy sparse files.
  1486. -      Requires on Win11 >= 22H2 because it relies on |CopyFile2()|
  1487. -      flag |COPY_FILE_ENABLE_SPARSE_COPY|.
  1488. -
  1489. -- Block cloning support
  1490. -    - Implmenented via Win32 |FSCTL_DUPLICATE_EXTENTS_TO_FILE| to
  1491. -      clone file blocks from src to dst within the same
  1492. -      filesystem.
  1493. -    - Requires NFSv4.2 server which supports the NFSv4.2
  1494. -      operations "CLONE", "DEALLOCATE", "SEEK", and exports
  1495. -      a filesystem which supports block cloning (e.g. Linux BTRFS+XFS,
  1496. -      but NOT Linux tmpfs)
  1497. -    - Sparse files are correctly cloned, including all hole and data
  1498. -      ranges
  1499. -    - /usr/bin/winclonefile.exe can be used to clone a file
  1500. -    - Windows 11 |CopyFile2()| API uses
  1501. -      |FSCTL_DUPLICATE_EXTENTS_TO_FILE| by default
  1502. -    - Windows 11 tools like xcopy.exe, robocopy etc. all use
  1503. -      |CopyFile2()|, and therefore file cloning by default
  1504. -
  1505. -- Symlink reparse and translation support
  1506. -    - Translates Win32/NT symlink syntax (e.g.
  1507. -      $ mklink /D ... Y:\tmp\ #) to NFS/POSIX syntax (e.g.
  1508. -      "/cygdrive/y/tmp/") and back
  1509. -    - Translates Cygwin /cygdrive/<devletter> symlinks on NFS to
  1510. -      Win32 <devletter>:\ and back
  1511. -    - Pass-through for NFS /dev-Symlinks (e.g. /dev/null) to Cygwin
  1512. -    - Interoperability for symlinks between Cygwin, powershell,
  1513. -      cmd.exe and other POSIX-compatible NFSv4.2/NFSv4.1 clients.
  1514. -
  1515. -- Support for NFSv4 public mounts (i.e. use the NFSv4 public file handle
  1516. -    lookup protocol via $ nfs_mount -o public ... #)
  1517. -
  1518. -- Support for NFSv4 referrals
  1519. -    - See Linux export(5) refer= option, nfsref(5) or
  1520. -        https://docs.oracle.com/cd/E86824_01/html/E54764/nfsref-1m.html
  1521. -
  1522. -- SFU/Cygwin/MSYS2 support, including:
  1523. -    - POSIX uid/gid+mode
  1524. -    - Backwards compatibility to Microsoft's NFSv3 driver
  1525. -    - Cygwin ACLs, e.g. setfacl/getfacl
  1526. -    - Cygwin/MSYS2 symlinks
  1527. -
  1528. -- Custom primary group support
  1529. -    - Supports primary group changes in the calling process/thread
  1530. -      (via |SetTokenInformation(..., TokenPrimaryGroup,...)|), e.g.
  1531. -      if the calling process/threads switches the primary group
  1532. -      in its access token then the NFSv4.2 client will use that
  1533. -      group as GID for file creation.
  1534. -    - newgrp(1)/sg(1)-style "winsg" utilty to run cmd.exe with
  1535. -      different primary group, e.g.
  1536. -      $ winsg [-] -g group [-c command | /C command] #
  1537. -
  1538. -- Software compatibility:
  1539. -    - Any NFSv4.2/NFSv4.1 server (Linux, Solaris, Illumos,
  1540. -        FreeBSD, nfs4j, ...)
  1541. -    - All tools from Cygwin/MSYS2/MinGW
  1542. -    - Visual Studio
  1543. -    - VMware Workstation (can use VMs hosted on NFSv4.2/NFSv4.1
  1544. -        filesystem)
  1545. -
  1546. -
  1547. -#
  1548. -# 3. Requirements:
  1549. -#
  1550. -- Windows 10 (32bit or 64bit), Windows 11 or Windows Server 2019+2022
  1551. -- Cygwin:
  1552. -    - Cygwin versions:
  1553. -        - 64bit: >= 3.5.7, recommended >= 3.6.1
  1554. -        - 32bit: >= 3.3.6
  1555. -    - Packages (required):
  1556. -        cygwin
  1557. -        cygrunsrv
  1558. -        cygutils
  1559. -        cygutils-extra
  1560. -        libiconv
  1561. -        libiconv2
  1562. -        procps-ng
  1563. -        util-linux
  1564. -
  1565. -    - Packages (optional, recommended):
  1566. -        bison
  1567. -        cygport
  1568. -        cygwin-devel
  1569. -        clang
  1570. -        dos2unix
  1571. -        pax
  1572. -        pbzip2
  1573. -        libnfs-utils (for /usr/bin/nfs-ls)
  1574. -        libiconv-devel
  1575. -        make
  1576. -        bmake
  1577. -        git
  1578. -        gcc-core
  1579. -        gcc-g++
  1580. -        gdb
  1581. -        mingw64-i686-clang
  1582. -        mingw64-x86_64-clang
  1583. -        unzip
  1584. -        time
  1585. -
  1586. -    - Packages (only-CI):
  1587. -        # required packages, but part of Cygwin default installation
  1588. -        # listed here for CI package list ONLY
  1589. -        bash
  1590. -        bzip2
  1591. -        coreutils
  1592. -        getent
  1593. -        grep
  1594. -        hostname
  1595. -        less
  1596. -        sed
  1597. -        tar
  1598. -        wget
  1599. -
  1600. -- MSYS2 (64bit, optional):
  1601. -    - Packages (recommended):
  1602. -        base-devel
  1603. -        gcc
  1604. -        clang
  1605. -        sed
  1606. -        time
  1607. -        coreutils
  1608. -        util-linux
  1609. -        grep
  1610. -        sed
  1611. -        emacs
  1612. -        gdb
  1613. -        make
  1614. -        autoconf
  1615. -        automake
  1616. -        gettext
  1617. -        gettext-devel
  1618. -        git
  1619. -        subversion
  1620. -        flex
  1621. -        bison
  1622. -        unzip
  1623. -        pax
  1624. -        tar
  1625. -        libiconv-devel
  1626. -        ncurses-devel
  1627. -        gmp-devel
  1628. -        mpfr-devel
  1629. -        mpc-devel
  1630. -        isl-devel
  1631. -        procps-ng
  1632. -        libiconv-devel
  1633. -
  1634. -
  1635. -#
  1636. -# 4. Download and install Cygwin (if not installed yet):
  1637. -#
  1638. -# Windows 32bit-vs.-64bit can be tested from Windows cmd.exe console:
  1639. -# Run this command:
  1640. -# ---- snip ----
  1641. -echo %PROCESSOR_ARCHITECTURE%
  1642. -# ---- snip ----
  1643. -# If this returns "AMD64" then you have a Windows 64bit kernel, and
  1644. -# if it returns "x86" then you have Windows 32bit kernel.
  1645. -# If you get any other value then this is a (documentation) bug.
  1646. -
  1647. -- Cygwin 64bit can be installed like this:
  1648. -# ---- snip ----
  1649. -# Install Cygwin 64bit on Windows 64bit with packages required by "ms-nfs41-client"
  1650. -# (Windows NFSv4.2 client):
  1651. -# 1. Create subdir
  1652. -mkdir download
  1653. -cd download
  1654. -# 2. Get installer from https://cygwin.com/setup-x86_64.exe
  1655. -curl --remote-name "https://www.cygwin.com/setup-x86_64.exe"
  1656. -# 3. Run installer with these arguments:
  1657. -setup-x86_64.exe -q --site "https://mirrors.kernel.org/sourceware/cygwin" -P cygwin,cygwin-devel,cygrunsrv,cygutils,cygutils-extra,bash,bzip2,coreutils,getent,gdb,grep,hostname,less,libiconv,libiconv2,pax,pbzip2,procps-ng,sed,tar,time,util-linux,wget,libnfs-utils,make,bmake,git,dos2unix,unzip
  1658. -# ---- snip ----
  1659. -
  1660. -
  1661. -- Cygwin 32bit can be installed like this:
  1662. -# ---- snip ----
  1663. -# Install Cygwin 32bit on Windows 32bit with packages required by "ms-nfs41-client"
  1664. -# (Windows NFSv4.2 client):
  1665. -# 1. Create subdir
  1666. -mkdir download
  1667. -cd download
  1668. -# 2. Get installer from https://www.cygwin.com/setup-x86.exe
  1669. -curl --remote-name "https://www.cygwin.com/setup-x86.exe"
  1670. -# 3. Run installer with these arguments:
  1671. -setup-x86.exe --allow-unsupported-windows -q --no-verify --site "http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/2022/11/23/063457" -P cygwin,cygwin-devel,cygrunsrv,cygutils,cygutils-extra,bash,bzip2,coreutils,getent,gdb,grep,hostname,less,libiconv,libiconv2,pax,pbzip2,procps-ng,sed,tar,time,util-linux,wget,libnfs-utils,make,bmake,git,dos2unix,unzip
  1672. -# ---- snip ----
  1673. -
  1674. -
  1675. -#
  1676. -# 5. Download and install MSYS2/64bit [OPTIONAL]
  1677. -#
  1678. -# 1. Download&&install from Cygwin
  1679. -# ---- snip ----
  1680. -mkdir -p download && cd download
  1681. -wget 'https://github.com/msys2/msys2-installer/releases/download/2025-02-21/msys2-x86_64-20250221.exe'
  1682. -chmod a+x 'msys2-x86_64-20250221'
  1683. -./msys2-x86_64-20250221 --default-answer --root 'C:\msys64' install
  1684. -# ---- snip ----
  1685. -
  1686. -# 2. Install extra packages:
  1687. -# Start MSYS2 UCRT mintty and execute this:
  1688. -# ---- snip ----
  1689. -pacman -S --noconfirm base-devel gcc clang sed time coreutils util-linux grep sed emacs gdb make autoconf automake gettext gettext-devel git subversion flex bison unzip pax tar libiconv-devel ncurses-devel gmp-devel mpfr-devel mpc-devel isl-devel procps-ng libiconv-devel
  1690. -# ---- snip ----
  1691. -
  1692. -
  1693. -#
  1694. -# 6. Download "ms-nfs41-client" installation tarball:
  1695. -#
  1696. -# (from a Cygwin terminal)
  1697. -$ mkdir -p ~/download
  1698. -$ cd ~/download
  1699. -$ wget 'http://www.nrubsig.org/people/gisburn/work/msnfs41client/releases/testing/${bintarball.base_filename}.tar.bz2'
  1700. -$ openssl sha256 "${bintarball.base_filename}.tar.bz2"
  1701. -SHA2-256(${bintarball.base_filename}.tar.bz2)= ${bintarball.archive_sha256hash}
  1702. -
  1703. -
  1704. -#
  1705. -# 7. Installation (as "Administrator"):
  1706. -#
  1707. -$ (cd / && tar -xf ~/download/${bintarball.base_filename}.tar.bz2 )
  1708. -$ /sbin/msnfs41client install
  1709. -<REBOOT>
  1710. -
  1711. -
  1712. -#
  1713. -# 8. Deinstallation:
  1714. -#
  1715. -$ (set -o xtrace ; cd / && tar -tf ~/download/${bintarball.base_filename}.tar.bz2 | while read i ; do [[ -f "$i" ]] && rm "$i" ; done)
  1716. -<REBOOT>
  1717. -
  1718. -
  1719. -#
  1720. -# 9. Usage:
  1721. -#
  1722. -
  1723. -# Option a)
  1724. -# * Start NFSv4 client daemon as Windows service (requires
  1725. -# "Administrator" account):
  1726. -
  1727. -$ sc start ms-nfs41-client-service
  1728. -
  1729. -# * Notes:
  1730. -# - requires "Administrator" account, and one nfsd client daemon is
  1731. -#   used for all users on a machine.
  1732. -# - The "ms-nfs41-client-service" service is installed by default as
  1733. -#   "disabled" and therefore always requires a "manual" start (e.g.
  1734. -#   $ sc start ms-nfs41-client-service #)
  1735. -# - note that DOS devices are virtualised per LSA Logon, so each Logon
  1736. -#   needs to do a separare nfs_mount.exe to mount a NFSv4 share.
  1737. -#   The exception are mounts created by user "SYSTEM", such mounts
  1738. -#   are available to all users/logons.
  1739. -#   (see PsExec or function "su_system" in msnfs41client.bash how
  1740. -#   to run a process as user "SYSTEM")
  1741. -# - nfsd_debug.exe will run as user "SYSTEM", but will do user
  1742. -#   impersonation for each request
  1743. -# - stopping the service will NOT unmount filesystems, and due to a
  1744. -#   bug a reboot is required to restart and mount any NFSv4
  1745. -#   filesystems again
  1746. -
  1747. -# * Administration:
  1748. -# - Follow new log messages:
  1749. -$ tail -f '/var/log/ms-nfs41-client-service.log'
  1750. -# - Query service status:
  1751. -$ sc queryex ms-nfs41-client-service
  1752. -# - Query service config:
  1753. -$ sc qc ms-nfs41-client-service
  1754. -# - Start service automatically:
  1755. -# (nfsd_debug.exe will be started automagically, but mounts are
  1756. -# not restored):
  1757. -$ sc config ms-nfs41-client-service start=auto
  1758. -# - Start service manually (default):
  1759. -$ sc config ms-nfs41-client-service start=disabled
  1760. -
  1761. -
  1762. -# Option b)
  1763. -# Run the NFSv4 client daemon manually:
  1764. -#
  1765. -# - run this preferably as "Administrator", but this is not a requirement
  1766. -# - requires separate terminal
  1767. -$ /sbin/msnfs41client run_daemon
  1768. -
  1769. -# Mount a filesystem to drive N: and use it
  1770. -$ /sbin/nfs_mount -o rw N 10.49.202.230:/net_tmpfs2
  1771. -Successfully mounted '10.49.202.230@2049' to drive 'N:'
  1772. -$ cd /cygdrive/n/
  1773. -$ ls -la
  1774. -total 4
  1775. -drwxrwxrwt 5 Unix_User+0      Unix_Group+0      100 Dec  7 14:17 .
  1776. -dr-xr-xr-x 1 roland_mainz     Kein                0 Dec 14 13:48 ..
  1777. -drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  80 Dec 12 16:24 10492030
  1778. -drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  60 Dec 13 17:58 directory_t
  1779. -drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  60 Dec  7 11:01 test2
  1780. -
  1781. -# Unmount filesystem:
  1782. -$ cd ~ && /sbin/nfs_umount N:
  1783. -# OR
  1784. -$ cd ~
  1785. -$ net use N: /delete
  1786. -
  1787. -# Mount a filesystem WITHOUT a dos drive assigned and use it via UNC path
  1788. -$ /sbin/nfs_mount -o rw 10.49.202.230:/net_tmpfs2
  1789. -Successfully mounted '10.49.202.230@2049' to drive '\0.49.202.230@2049\nfs4\net_tmpfs2'
  1790. -$ cygpath -u '\0.49.202.230@2049\nfs4\net_tmpfs2'
  1791. -//10.49.202.230@2049/nfs4/net_tmpfs2
  1792. -$ cd '//10.49.202.230@2049/nfs4/net_tmpfs2'
  1793. -$ ls -la
  1794. -total 4
  1795. -drwxrwxrwt 5 Unix_User+0      Unix_Group+0      100 Dec  7 14:17 .
  1796. -dr-xr-xr-x 1 roland_mainz     Kein                0 Dec 14 13:48 ..
  1797. -drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  80 Dec 12 16:24 10492030
  1798. -drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  60 Dec 13 17:58 directory_t
  1799. -drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  60 Dec  7 11:01 test2
  1800. -
  1801. -# Unmount filesystem:
  1802. -$ cd ~ && /sbin/nfs_umount '\0.49.202.230@2049\nfs4\net_tmpfs2'
  1803. -# OR
  1804. -$ cd ~
  1805. -$ net use '\0.49.202.230@2049\nfs4\net_tmpfs2' /delete
  1806. -
  1807. -# List mounted NFSv4.2 filesystems:
  1808. -$ /sbin/nfs_mount
  1809. -
  1810. -
  1811. -# Global/System-wide mounts:
  1812. -Mounts created by user "SYSTEM" are useable by all users in a system.
  1813. -Example usage:
  1814. ----- snip ----
  1815. -# Create a file /etc/fstab.msnfs41client, which list the mounts
  1816. -# which should be available system-wide
  1817. -$ cat /etc/fstab.msnfs41client
  1818. -nfs://[fe80::21b:1bff:fec3:7713]//bigdisk       V       nfs     rw      0       0
  1819. -# run "ms-nfs41-client-globalmountall-service", which runs
  1820. -# /sbin/mountall_msnfs41client as user "SYSTEM" to read
  1821. -# /etc/fstab.msnfs41client and mount the matching filesystems
  1822. -sc start ms-nfs41-client-globalmountall-service
  1823. ----- snip ----
  1824. -
  1825. -BUG: Note that "ms-nfs41-client-globalmountall-service" currently
  1826. -does not wait until nfsd*.exe is available for accepting mounts.
  1827. -
  1828. -
  1829. -# WSL usage:
  1830. -Example 1: Mount Windows NFSv4.2 share via Windows drive letter
  1831. -# Mount NFSv4.2 share in Windows to drive letter 'N':
  1832. ----- snip ----
  1833. -$ /sbin/nfs_mount -o rw 'N' nfs://10.49.202.230//bigdisk
  1834. -Successfully mounted '10.49.202.230@2049' to drive 'N:'
  1835. ----- snip ----
  1836. -
  1837. -# Within WSL mount drive letter 'N' to /mnt/n
  1838. ----- snip ----
  1839. -$ sudo bash
  1840. -$ mkdir /mnt/n
  1841. -$ mount -t drvfs N: /mnt/n
  1842. ----- snip ----
  1843. -
  1844. -Example 2: Mount Windows NFSv4.2 share via UNC path:
  1845. -# Mount NFSv4.2 share in Windows
  1846. ----- snip ----
  1847. -$ /sbin/nfs_mount -o rw nfs://10.49.202.230//bigdisk
  1848. -Successfully mounted '10.49.202.230@2049' to drive '\0.49.202.230@2049\nfs4\bigdisk'
  1849. ----- snip ----
  1850. -
  1851. -# Within WSL mount UNC path returned by /sbin/nfs_mount
  1852. ----- snip ----
  1853. -$ sudo bash
  1854. -$ mkdir /mnt/bigdisk
  1855. -$ mount -t drvfs '\0.49.202.230@2049\nfs4\bigdisk' /mnt/bigdisk
  1856. ----- snip ----
  1857. -
  1858. -* Known issues with WSL:
  1859. -- Softlinks do not work yet
  1860. -- Creating a hard link returns "Invalid Argument", maybe drvfs
  1861. -  limitation
  1862. -- Not all POSIX file types (e.g. block devices) etc. are supported
  1863. -
  1864. -
  1865. -#
  1866. -# 10. Notes:
  1867. -#
  1868. -- Idmapping (including uid/gid mapping) between NFSv4 client and
  1869. -  NFSv4 server works via /lib/msnfs41client/cygwin_idmapper.ksh,
  1870. -  which either uses builtin static data, or /usr/bin/getent passwd
  1871. -  and /usr/bin/getent group.
  1872. -  As getent uses the configured name services it should work with
  1873. -  LDAP too.
  1874. -  This is still work-in-progress, with the goal that both NFSv4
  1875. -  client and server can use different uid/gid numeric values for
  1876. -  client and server side.
  1877. -
  1878. -- UNC paths are supported, after successful mounting /sbin/nfs_mount
  1879. -  will list the paths in Cygwin/MSYS2 UNC format.
  1880. -
  1881. -- SIDs work, users with valid Windows accounts (see Cygwin idmapping
  1882. -  above get their SIDs, unknown users with valid uid/gid values get
  1883. -  Unix_User+id/Unix_Group+id SIDs, and all others are mapped
  1884. -  to nobody/nogroup SIDs.
  1885. -
  1886. -- Workflow for nfs://-URLs:
  1887. -  - Create nfs://-URLs with nfsurlconv, read $ nfsurlconv --man # for usage
  1888. -  - pass URL to nfs_mount.exe like this:
  1889. -    $ nfs_mount -o sec=sys,rw 'L' nfs://derfwnb4966_ipv4//bigdisk #
  1890. -
  1891. -- Cygwin/MSYS2 symlinks are supported, but might require
  1892. -  $ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1 #.
  1893. -  This includes symlinks to UNC paths, e.g. as Administrator
  1894. -  $ cmd /c 'mklink /d c:\home\rmainz \\derfwpc5131_ipv6@2049\nfs4\export\home2\rmainz' #
  1895. -  and then $ cd /cygdrive/c/home/rmainz/ # should work
  1896. -
  1897. -- performance: All binaries are build without any optimisation, so
  1898. -  the filesystem is much slower than it could be.
  1899. -
  1900. -- bad performance due to Windows Defender AntiVirus:
  1901. -  Option 1:
  1902. -  # disable Windows defender realtime monitoring
  1903. -  # (requires Administrator shell)
  1904. -  powershell -Command 'Set-MpPreference -DisableRealtimeMonitoring 1'
  1905. -  Option 2:
  1906. -  Add "nfsd.exe", "nfsd_debug.exe", "ksh93.exe", "bash.exe",
  1907. -  "git.exe" and other offending commands to the process name
  1908. -  whitelist.
  1909. -
  1910. -- performance: Use vmxnet3 in VMware to improve performance
  1911. -
  1912. -- ACLs are supported via the normal Windows ACL tools, but on
  1913. -  Linux require the nfs4_getfacl/nfs4_setfacl utilities to see the
  1914. -  data.
  1915. -  * Example 1 (assuming that Windows, Linux NFSv4 client and NFSv4
  1916. -  server have a user "siegfried_wulsch"):
  1917. -  - On Windows on a NFSv4 filesystem:
  1918. -  $ icacls myhorribledata.txt /grant "siegfried_wulsch:WD" #
  1919. -  - On Linux NFSv4 clients you will then see this:
  1920. -  # ---- snip ----
  1921. -  $ nfs4_getfacl myhorribledata.txt
  1922. -  A::OWNER@:rwatTcCy
  1923. -  A::siegfried_wulsch@global.loc:rwatcy
  1924. -  A::GROUP@:rtcy
  1925. -  A::EVERYONE@:rtcy
  1926. -  # ---- snip ----
  1927. -
  1928. -  * Example 2 (assuming that Windows, Linux NFSv4 client and NFSv4
  1929. -  server have a group "cygwingrp2"):
  1930. -  - On Windows on a NFSv4 filesystem:
  1931. -  $ icacls myhorribledata.txt /grant "cygwingrp2:(WDAC)" /t /c #
  1932. -  - On Linux NFSv4 clients you will then see this:
  1933. -  # ---- snip ----
  1934. -  $ nfs4_getfacl myhorribledata.txt
  1935. -  A::OWNER@:rwatTcCy
  1936. -  A::GROUP@:rtcy
  1937. -  A:g:cygwingrp2@global.loc:rtcy
  1938. -  A::EVERYONE@:rtcy
  1939. -  # ---- snip ----
  1940. -
  1941. -- nfs_mount.exe vs. reserved ports:
  1942. -  By default the NFSv4 server on Solaris, Illumos, Linux
  1943. -  etc. only accepts connections if the NFSv4 client uses a
  1944. -  "privileged (TCP) port", i.e. using a TCP port number < 1024.
  1945. -  If nfsd.exe/nfsd_debug.exe is started without the Windows priviledge
  1946. -  to use reserved ports, then a mount attempt can fail.
  1947. -  This can be worked around on the NFSv4 server side - on Linux using
  1948. -  the "insecure" export option in /etc/exports and on Solaris/Illumos
  1949. -  using export option "resvport" (see nfs(5)).
  1950. -
  1951. -- Accessing mounts from a VMware/QEMU/VirtualBox VM using NAT requires
  1952. -  the the "insecure" export option in /etc/exports and on
  1953. -  Solaris/Illumos using export option "resvport" (see nfs(5)), as the
  1954. -  NFSv4 client source TCP port will be >= 1024.
  1955. -
  1956. -- Install: Adding Windows accounts+groups to the NFSv4 server:
  1957. -  ms-nfs41-client comes with /sbin/cygwinaccount2nfs4account to
  1958. -  convert the Win32/Cygwin account information of the (current)
  1959. -  user+groups to a small script for the NFSv4 server to set-up
  1960. -  these accounts on the server side.
  1961. -
  1962. -- nfs_mount -o sec=none ... # works with Solaris 11.4 nfsd, but
  1963. -  might require Linux kernel commit
  1964. -  https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git/patch/?id=bb4f07f2409c26c01e97e6f9b432545f353e3b66
  1965. -  ("nfsd: Fix NFSD_MAY_BYPASS_GSS and NFSD_MAY_BYPASS_GSS_ON_ROOT") to
  1966. -  work.
  1967. -
  1968. -
  1969. -#
  1970. -# 11. Known issues:
  1971. -#
  1972. -- The kernel driver ("nfs41_driver.sys") does not yet have a
  1973. -  cryptographic signature for SecureBoot - which means it will only
  1974. -  work if SecureBoot is turned off (otherwise
  1975. -  $ /sbin/msnfs41client install # will FAIL!)
  1976. -
  1977. -- If nfsd_debug.exe crashes or gets killed, the only safe way
  1978. -  to run it again requires a reboot
  1979. -
  1980. -- LDAP support does not work yet
  1981. -
  1982. -- Attribute caching is too aggressive
  1983. -
  1984. -- Caching in the kernel does not always work. For example
  1985. -  $ tail -f ... # does not not see new data.
  1986. -  Workaround: Use GNU tail'S $ tail --follow=name ... #
  1987. -  Working theory is that this is related to FCB caching, see
  1988. -  |FCB_STATE_FILESIZECACHEING_ENABLED|, as the nfs41_driver.sys
  1989. -  kernel module does not see the |stat()| syscalls. But $ tail -f ... #
  1990. -  always works for a moment if something else opens the same file.
  1991. -
  1992. -- Unmounting and then mounting the same filesystem causes issues
  1993. -  as the name cache in nfsd*.exe is not flushed on umount, including
  1994. -  leftover delegations.
  1995. -
  1996. -- krb5p security with AES keys do not work against the linux server,
  1997. -  as it does not support gss krb5 v2 tokens with rotated data.
  1998. -
  1999. -- When recovering opens and locks outside of the server's grace
  2000. -  period, client does not check whether the file has been modified
  2001. -  by another client.
  2002. -
  2003. -- If nfsd.exe is restarted while a drive is mapped, that drive needs
  2004. -  to be remounted before further use.
  2005. -
  2006. -- Does not allow renaming a file on top of an existing open file.
  2007. -  Connectathon's special test op_ren has been commented out.
  2008. -
  2009. -- File access timestamps might be wrong for delegations.
  2010. -
  2011. -- Extended attributes are supported with some limitations:
  2012. -  a) the server must support NFS Named Attributes,
  2013. -  b) the order of listings cannot be guaranteed by NFS, and
  2014. -  c) the EaSize field cannot be reported for directory queries of
  2015. -  FileBothDirInformation, FileFullDirInfo, or FileIdFullDirInfo.
  2016. -
  2017. -- Win10/32bit-only: $ net use H: /delete # does not work,
  2018. -  use $ nfs_umount 'H' instead #
  2019. -
  2020. -- Windows event log can list errors like "MUP 0xc0000222"
  2021. -  (|STATUS_LOST_WRITEBEHIND_DATA|) in case the disk on the NFSv4 server
  2022. -  is full and outstanding writes from a memory-mapped file fail.
  2023. -  Example:
  2024. -  ---- snip ----
  2025. -  {Fehler beim verzoegerten Schreibvorgang} Nicht alle Daten fuer die
  2026. -  Datei "\\34.159.25.153@2049\nfs4\export\nfs4export\gcc\lto-dump.exe"
  2027. -  konnten gespeichert werden. Daten gingen verloren.
  2028. -  Dieser Fehler wurde von dem Server zurueckgegeben, auf dem sich die
  2029. -  Datei befindet. Versuchen Sie, die Datei woanders zu speichern.
  2030. -  ---- snip ----
  2031. -
  2032. -
  2033. -#
  2034. -# 12. Notes for troubleshooting && finding bugs/debugging:
  2035. -#
  2036. -- nfsd_debug.exe has the -d option to set a level for debug
  2037. -  output.
  2038. -  Edit /sbin/msnfs41client to set the "-d" option.
  2039. -
  2040. -- The "msnfs41client" script has the option "watch_kernel_debuglog"
  2041. -  to get the debug output of the kernel module.
  2042. -
  2043. -  Run as Administrator: $ /sbin/msnfs41client watch_kernel_debuglog #
  2044. -
  2045. -  Currently requires DebugView
  2046. -  (https://learn.microsoft.com/en-gb/sysinternals/downloads/debugview)
  2047. -  to be installed.
  2048. -
  2049. -- Watching network traffic:
  2050. -  - Use $ /sbin/msnfs41client watch_nfs_traffic # to watch the
  2051. -  NFS network traffic
  2052. -
  2053. -  - WireShark has a command line tool called "tshark", which can be
  2054. -  used to see NFSv4 traffic. As NFSv4 uses RPC you have to filter for
  2055. -  RPC, and the RPC filter automatically identifies NFSv4 traffic on
  2056. -  it's RPC id.
  2057. -  Example for Windows:
  2058. -  (for NFSv4 default TCP port "2049", replace "2049" with the
  2059. -  desired port if you use a custom port ; use "ipconfig" to find the
  2060. -  correct interface name, in this case "Ethernet0"):
  2061. -  # ---- snip ----
  2062. -  $ nfsv4port=2049 ; /cygdrive/c/Program\ Files/Wireshark/tshark \
  2063. -    -f "port $nfsv4port" -d "tcp.port==${nfsv4port},rpc" -i Ethernet0
  2064. -  # ---- snip ----
  2065. -
  2066. -  If you are running inside a VMware VM on a Linux host it
  2067. -  might require $ chmod a+rw /dev/vmnet0 # on VMware host, so that
  2068. -  the VM can use "Promiscuous Mode".
  2069. -
  2070. -
  2071. -#
  2072. -# 13. Source code:
  2073. -#
  2074. -- Source code can be obtained from https://github.com/kofemann/ms-nfs41-client
  2075. -  or as git bundle from /usr/src/msnfs41client/msnfs41client_git.bundle
  2076. -
  2077. -- Build instructions can be found at
  2078. -https://github.com/kofemann/ms-nfs41-client/tree/master/cygwin
  2079. -
  2080. -
  2081. -# EOF.
  2082. diff --git a/cygwin/README.txt b/cygwin/README.txt
  2083. deleted file mode 100644
  2084. index 634cfcf..0000000
  2085. --- a/cygwin/README.txt
  2086. +++ /dev/null
  2087. @@ -1,150 +0,0 @@
  2088. -#
  2089. -# ms-nfs41-client/cygwin/README.txt
  2090. -#
  2091. -# Draft README/ToDo list&co.
  2092. -#
  2093. -
  2094. -######## Building ms-nfs41-client using Cygwin+Makefile:
  2095. -** Required software:
  2096. -* Option 1:
  2097. -  Windows 10 with Visual Studio 2019
  2098. -- Start Visual Studio 19 installer and import the installer
  2099. -  config file "ms-nfs41-client/build.vc19/ms-nfs41-client_vs2019.vsconfig",
  2100. -  and then install Visual Studio.
  2101. -  (Note that due to a bug in the VS installer it is sometimes
  2102. -  required to manually add another (random) component to be installed,
  2103. -  otherwise the imported config might be ignored)
  2104. -- WDK for Windows 10, version 2004, from
  2105. -  https://go.microsoft.com/fwlink/?linkid=2128854
  2106. -- Cygwin 64bit >= 3.5.0
  2107. -  (see "ms-nfs41-clientcygwin/README.bintarball.txt" for Cygwin 32bit
  2108. -  and 64bit installation instructions)
  2109. -
  2110. -* Option 2:
  2111. -  Windows 10/11 with Visual Studio 2022
  2112. -- Start Visual Studio 2022 installer and import the installer
  2113. -  config file "ms-nfs41-client/build.vc19/ms-nfs41-client_vs2022.vsconfig",
  2114. -  and then install Visual Studio.
  2115. -  (Note that due to a bug in the VS installer it is sometimes
  2116. -  required to manually add another (random) component to be installed,
  2117. -  otherwise the imported config might be ignored)
  2118. -- WDK for Windows 11, version 1591, from
  2119. -  https://go.microsoft.com/fwlink/?linkid=2286137
  2120. -- Cygwin 64bit >= 3.5.0
  2121. -  (see "ms-nfs41-clientcygwin/README.bintarball.txt" for Cygwin 32bit
  2122. -  and 64bit installation instructions)
  2123. -
  2124. -
  2125. -** Build the project
  2126. -* using Visual Studio 2019+Cygwin command line (bash/ksh93):
  2127. -# this creates a 32bit+kernel+64bit-kernel build for Windows 10+11
  2128. -export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/:$PATH"
  2129. -git clone https://github.com/kofemann/ms-nfs41-client.git
  2130. -cd ms-nfs41-client
  2131. -cd cygwin
  2132. -make build
  2133. -make installdest
  2134. -make bintarball
  2135. -
  2136. -* using Visual Studio 2022+Cygwin command line (bash/ksh93):
  2137. -# this creates a 64bit-kernel only build for Windows 11
  2138. -export PATH="/cygdrive/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/:$PATH"
  2139. -git clone https://github.com/kofemann/ms-nfs41-client.git
  2140. -cd ms-nfs41-client
  2141. -# "retarget" VS platform toolset to "v143"
  2142. -# ("v142" should remain the default when comitting)
  2143. -sed -i -E 's/<PlatformToolset>v142<\/PlatformToolset>/<PlatformToolset>v143<\/PlatformToolset>/g' $(find 'build.vc19' -name \*.vcxproj)
  2144. -cd cygwin
  2145. -make build64
  2146. -make installdest64
  2147. -make bintarball64
  2148. -
  2149. -# Note that $ make installdest #/$ make installdest64 # can fail on SMB/NFSv4.1 filesystems
  2150. -# with a "link.exe" crash.
  2151. -# Workaround is to disable incremental linking before building, e.g. do
  2152. -# ---- snip ----
  2153. -cd ms-nfs41-client
  2154. -sed -i -E 's/<LinkIncremental>true<\/LinkIncremental>/<LinkIncremental>false<\/LinkIncremental>/g' $(find build.vc19 -name \*.vcxproj)
  2155. -# ---- snip ----
  2156. -# This Visual Studio bug is tracked as
  2157. -# https://developercommunity.visualstudio.com/t/Visual-Studio-linkexe-crashes-on-networ/10735424
  2158. -# ("Visual Studio link.exe crashes on network filesystem").
  2159. -
  2160. -
  2161. -#### Install the software (requires mintty.exe running as "Adminstrator"):
  2162. -cd ms-nfs41-client/destdir/cygdrive/c/cygwin64/sbin
  2163. -bash ./msnfs41client.bash install
  2164. -# then reboot
  2165. -
  2166. -
  2167. -#### Run nfs41 client:
  2168. -** Run deamon:
  2169. -(requires to modify "msnfs41client.bash")
  2170. -cd ms-nfs41-client/destdir/cygdrive/c/cygwin64/sbin
  2171. -bash ./msnfs41client.bash run_daemon
  2172. -
  2173. -** mount home dir:
  2174. -(requires to modify "msnfs41client.bash")
  2175. -cd ms-nfs41-client/destdir/cygdrive/c/cygwin64/sbin
  2176. -bash ./msnfs41client.bash mount_homedir
  2177. -
  2178. -
  2179. -
  2180. -######## Manually building ms-nfs41-client using Cygwin:
  2181. -** Required software:
  2182. -- Visual Studio 19
  2183. -- WDK for Windows 10, version 2004, from
  2184. -  https://go.microsoft.com/fwlink/?linkid=2128854
  2185. -- Cygwin >= 3.5.0
  2186. -
  2187. -** Building the project using GUI:
  2188. -1. Start Visual Studio 19
  2189. -2. Load the project file "build.vc19/nfs41-client.sln"
  2190. -3. Select menu item "Build/Build solution" as "Debug/x64"
  2191. -4. Select menu item "Build/Build solution" as "Release/x64"
  2192. -
  2193. -** Build the project using Cygwin command line (bash/ksh93):
  2194. -export PATH+=":/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/"
  2195. -git clone https://github.com/kofemann/ms-nfs41-client.git
  2196. -cd ms-nfs41-client
  2197. -MSBuild.exe build.vc19/nfs41-client.sln -t:Build -p:Configuration=Debug -p:Platform=x64
  2198. -MSBuild.exe build.vc19/nfs41-client.sln -t:Build -p:Configuration=Release -p:Platform=x64
  2199. -
  2200. -** Make release blob:
  2201. -mkdir dist
  2202. -cd dist/
  2203. -cp ../build.vc19/x64/Debug/nfsd.exe nfsd_debug.exe
  2204. -cp ../build.vc19/x64/Release/* .
  2205. -cp ../nfs41rdr.inf .
  2206. -cp ../etc_netconfig .
  2207. -cp ../ms-nfs41-idmap.conf .
  2208. -
  2209. -
  2210. -#### Install release blob (requires mintty.exe running as "Adminstrator"):
  2211. -cd ms-nfs41-client/dist
  2212. -bash ../cygwin/devel/msnfs41client.bash install
  2213. -# then reboot
  2214. -
  2215. -#### Run nfs41 client:
  2216. -** Run deamon:
  2217. -(requires to modify "msnfs41client.bash")
  2218. -bash ../cygwin/devel/msnfs41client.bash run_daemon
  2219. -
  2220. -
  2221. -** mount home dir:
  2222. -(requires to modify "msnfs41client.bash")
  2223. -bash ../cygwin/devel/msnfs41client.bash mount_homedir
  2224. -
  2225. -
  2226. -######## Testing:
  2227. -Seen tests/manual_testing.txt
  2228. -
  2229. -#### ToDo:
  2230. -- Makefile/script support for release blob generaetion, local test installation etc
  2231. -- DocBook/XML based documentation
  2232. -- Document how to get and build ksh93 for Cygwin
  2233. -- Cygwin-specific binary release blob
  2234. -- Document the usage of utils/mount_sshnfs/ and utils/sshnfs/
  2235. -- Add test code for SID etc mapping
  2236. -
  2237. -# EOF.
  2238. diff --git a/docs/README.xml b/docs/README.xml
  2239. new file mode 100644
  2240. index 0000000..b292e8f
  2241. --- /dev/null
  2242. +++ b/docs/README.xml
  2243. @@ -0,0 +1,963 @@
  2244. +<?xml version="1.0" encoding="UTF-8"?>
  2245. +<article xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xl="http://www.w3.org/1999/xlink" version="5.1" xml:id="articlemain">
  2246. +
  2247. +  <!--
  2248. +    DocBook XML: Compile to HTML via
  2249. +    $ xsltproc -xinclude -o README.html /usr/share/sgml/docbook/xsl-ns-stylesheets/xhtml-1_1/docbook.xsl README.xml #
  2250. +  -->
  2251. +
  2252. +  <title xml:id="articletitle">Windows NFS 4.2 FileSystem Client Instructions</title>
  2253. +
  2254. +  <section xml:id="what-is-this">
  2255. +    <title>What is this ?</title>
  2256. +    <para>NFSv4.2/NFSv4.1 filesystem driver for Windows 10/11 &amp; Windows Server 2019+2022</para>
  2257. +  </section>
  2258. +
  2259. +  <section xml:id="features">
  2260. +    <title>Features</title>
  2261. +    <itemizedlist>
  2262. +      <listitem>
  2263. +        <para>Full NFSv4.2/NFSv4.1 protocol support</para>
  2264. +      </listitem>
  2265. +      <listitem>
  2266. +        <para>idmapper (mapping usernames and uid/gid values between server and client)</para>
  2267. +      </listitem>
  2268. +      <listitem>
  2269. +        <para>Support for custom ports (NFSv4 defaults to TCP port 2049, this client can use different ports per mount)</para>
  2270. +      </listitem>
  2271. +      <listitem>
  2272. +        <para>Support for <literal>nfs://</literal>-URLs
  2273. +          <itemizedlist>
  2274. +            <listitem>
  2275. +              <para>Why? <literal>nfs://</literal>-URLs are cross-platform, portable and Character-Encoding independent descriptions of NFSv4 server resources (exports).</para>
  2276. +            </listitem>
  2277. +            <listitem>
  2278. +              <para>including custom ports and raw IPv6 addresses</para>
  2279. +            </listitem>
  2280. +            <listitem>
  2281. +              <para><literal>nfs://</literal>-URL conversion utility (<filename>/usr/bin/nfsurlconv</filename>) to convert URLs, including non-ASCII/Unicode characters in mount path</para>
  2282. +            </listitem>
  2283. +          </itemizedlist>
  2284. +        </para>
  2285. +      </listitem>
  2286. +      <listitem>
  2287. +        <para>Support ssh forwarding, e.g., mounting NFSv4 filesystems via ssh tunnel</para>
  2288. +      </listitem>
  2289. +      <listitem>
  2290. +        <para>Support for long paths (up to 4096 bytes), no Windows MAXPATH limit</para>
  2291. +      </listitem>
  2292. +      <listitem>
  2293. +        <para>Unicode support
  2294. +          <itemizedlist>
  2295. +            <listitem>
  2296. +              <para>File names can use any Unicode character supported by the NFS server's filesystem.</para>
  2297. +            </listitem>
  2298. +            <listitem>
  2299. +              <para><literal>nfs://</literal>-URLs can be used to mount filesystems with non-ASCII characters in the mount path, independent of current locale.</para>
  2300. +            </listitem>
  2301. +          </itemizedlist>
  2302. +        </para>
  2303. +      </listitem>
  2304. +      <listitem>
  2305. +        <para>UNC paths
  2306. +          <itemizedlist>
  2307. +            <listitem>
  2308. +              <para>Mounting UNC paths without DOS drive letter</para>
  2309. +            </listitem>
  2310. +            <listitem>
  2311. +              <para>IPv6 support in UNC paths</para>
  2312. +            </listitem>
  2313. +            <listitem>
  2314. +              <para><filename>/sbin/nfs_mount</filename> prints UNC paths in Win32+Cygwin/MSYS2 formats</para>
  2315. +            </listitem>
  2316. +            <listitem>
  2317. +              <para>Cygwin/MSYS2 bash+ksh93 support UNC paths, e.g., <command>cd //derfwnb4966@2049/nfs4/bigdisk/mysqldb4/</command></para>
  2318. +            </listitem>
  2319. +            <listitem>
  2320. +              <para>Symlinks on NFS can redirect to other filesystems via UNC syntax and work with Cygwin, MSYS2, cmd.exe, powershell etc., e.g.:
  2321. +                <programlisting>mklink /D symlnk1_to_h_tmp \\lab17@2049\nfs4\export\home\rsm\tmp</programlisting>
  2322. +              </para>
  2323. +            </listitem>
  2324. +          </itemizedlist>
  2325. +        </para>
  2326. +      </listitem>
  2327. +      <listitem>
  2328. +        <para>WSL support
  2329. +          <itemizedlist>
  2330. +            <listitem>
  2331. +              <para>Mount Windows NFSv4.2 shares via drive letter or UNC path in WSL via <command>mount -t drvfs</command></para>
  2332. +            </listitem>
  2333. +            <listitem>
  2334. +              <para>Supports NFS owner/group to WSL uid/gid mapping</para>
  2335. +            </listitem>
  2336. +          </itemizedlist>
  2337. +        </para>
  2338. +      </listitem>
  2339. +      <listitem>
  2340. +        <para>IPv6 support
  2341. +          <itemizedlist>
  2342. +            <listitem>
  2343. +              <para>IPv6 address within '[', ']' (will be converted to *.ipv6-literal.net)</para>
  2344. +            </listitem>
  2345. +          </itemizedlist>
  2346. +        </para>
  2347. +      </listitem>
  2348. +      <listitem>
  2349. +        <para>Windows ACLs &lt;---&gt; NFSv4 ACL translation
  2350. +          <itemizedlist>
  2351. +            <listitem>
  2352. +              <para>Win32 <filename>C:\Windows\system32\icacls.exe</filename></para>
  2353. +            </listitem>
  2354. +            <listitem>
  2355. +              <para>Cygwin <filename>/usr/bin/setfacl</filename>+<filename>/usr/bin/getfacl</filename></para>
  2356. +            </listitem>
  2357. +            <listitem>
  2358. +              <para>Windows Explorer ACL dialog</para>
  2359. +            </listitem>
  2360. +          </itemizedlist>
  2361. +        </para>
  2362. +      </listitem>
  2363. +      <listitem>
  2364. +        <para>Sparse file support
  2365. +          <itemizedlist>
  2366. +            <listitem>
  2367. +              <para>Requires NFSv4.2 server which supports the NFSv4.2 operations "ALLOCATE", "DEALLOCATE", "SEEK", and the <literal>|FATTR4_WORD1_SPACE_USED|</literal> attribute.</para>
  2368. +            </listitem>
  2369. +            <listitem>
  2370. +              <para>Full Win32 sparse file API support, including creation, punching holes, enumeration of hole&amp;data ranges etc.</para>
  2371. +            </listitem>
  2372. +            <listitem>
  2373. +              <para>Supports Win32 APIs <literal>|FSCTL_QUERY_ALLOCATED_RANGES|</literal>, <literal>|FSCTL_SET_SPARSE|</literal>, <literal>|FSCTL_SET_ZERO_DATA|</literal>; and <literal>|NfsV3Attributes.used|</literal> EA</para>
  2374. +            </listitem>
  2375. +            <listitem>
  2376. +              <para>Cygwin sparse file support requires &gt;= Cygwin 3.6 to support POSIX-1.2024 <literal>|lseek(...,SEEK_HOLE/SEEK_DATA,...)|</literal>, which is needed for coreutils <filename>/usr/bin/fallocate</filename> and <command>$ /usr/bin/cp --sparse=auto src dest #</command></para>
  2377. +            </listitem>
  2378. +            <listitem>
  2379. +              <para><filename>/cygdrive/c/Windows/system32/fsutil sparse queryrange myfile.dat</filename> can be used to enumerate ranges where data are allocated (BUG: Win10+Win11 fsutil only support 64 data ranges, the filesystem itself supports an unlimited number of data ranges)</para>
  2380. +            </listitem>
  2381. +            <listitem>
  2382. +              <para><filename>/cygdrive/c/Windows/system32/xcopy /sparse</filename> can be used to copy sparse files. Requires on Win11 &gt;= 22H2 because it relies on <literal>|CopyFile2()|</literal> flag <literal>|COPY_FILE_ENABLE_SPARSE_COPY|</literal>.</para>
  2383. +            </listitem>
  2384. +          </itemizedlist>
  2385. +        </para>
  2386. +      </listitem>
  2387. +      <listitem>
  2388. +        <para>Block cloning support
  2389. +          <itemizedlist>
  2390. +            <listitem>
  2391. +              <para>Implemented via Win32 <literal>|FSCTL_DUPLICATE_EXTENTS_TO_FILE|</literal> to clone file blocks from src to dst within the same filesystem.</para>
  2392. +            </listitem>
  2393. +            <listitem>
  2394. +              <para>Requires NFSv4.2 server which supports the NFSv4.2 operations "CLONE", "DEALLOCATE", "SEEK", and exports a filesystem which supports block cloning (e.g. Linux BTRFS+XFS, but NOT Linux tmpfs)</para>
  2395. +            </listitem>
  2396. +            <listitem>
  2397. +              <para>Sparse files are correctly cloned, including all hole and data ranges</para>
  2398. +            </listitem>
  2399. +            <listitem>
  2400. +              <para><filename>/usr/bin/winclonefile.exe</filename> can be used to clone a file</para>
  2401. +            </listitem>
  2402. +            <listitem>
  2403. +              <para>Windows 11 <literal>|CopyFile2()|</literal> API uses <literal>|FSCTL_DUPLICATE_EXTENTS_TO_FILE|</literal> by default</para>
  2404. +            </listitem>
  2405. +            <listitem>
  2406. +              <para>Windows 11 tools like xcopy.exe, robocopy etc. all use <literal>|CopyFile2()|</literal>, and therefore file cloning by default</para>
  2407. +            </listitem>
  2408. +          </itemizedlist>
  2409. +        </para>
  2410. +      </listitem>
  2411. +      <listitem>
  2412. +        <para>Symlink reparse and translation support
  2413. +          <itemizedlist>
  2414. +            <listitem>
  2415. +              <para>Translates Win32/NT symlink syntax (e.g. <command>$ mklink /D ... Y:\tmp\ #</command>) to NFS/POSIX syntax (e.g. "<filename>/cygdrive/y/tmp/</filename>") and back</para>
  2416. +            </listitem>
  2417. +            <listitem>
  2418. +              <para>Translates Cygwin <filename>/cygdrive/&lt;devletter&gt;</filename> symlinks on NFS to Win32 <filename>&lt;devletter&gt;:\</filename> and back</para>
  2419. +            </listitem>
  2420. +            <listitem>
  2421. +              <para>Pass-through for NFS <filename>/dev-Symlinks</filename> (e.g. <filename>/dev/null</filename>) to Cygwin</para>
  2422. +            </listitem>
  2423. +            <listitem>
  2424. +              <para>Interoperability for symlinks between Cygwin, powershell, cmd.exe and other POSIX-compatible NFSv4.2/NFSv4.1 clients.</para>
  2425. +            </listitem>
  2426. +          </itemizedlist>
  2427. +        </para>
  2428. +      </listitem>
  2429. +      <listitem>
  2430. +        <para>Support for NFSv4 public mounts (i.e., use the NFSv4 public file handle lookup protocol via <command>$ nfs_mount -o public ... #</command>)</para>
  2431. +      </listitem>
  2432. +      <listitem>
  2433. +        <para>Support for NFSv4 referrals
  2434. +          <itemizedlist>
  2435. +            <listitem>
  2436. +              <para>See Linux <command>export(5) refer=</command> option, <command>nfsref(5)</command> or <link xl:href="https://docs.oracle.com/cd/E86824_01/html/E54764/nfsref-1m.html">https://docs.oracle.com/cd/E86824_01/html/E54764/nfsref-1m.html</link></para>
  2437. +            </listitem>
  2438. +          </itemizedlist>
  2439. +        </para>
  2440. +      </listitem>
  2441. +      <listitem>
  2442. +        <para>SFU/Cygwin/MSYS2 support, including:
  2443. +          <itemizedlist>
  2444. +            <listitem>
  2445. +              <para>POSIX uid/gid+mode</para>
  2446. +            </listitem>
  2447. +            <listitem>
  2448. +              <para>Backwards compatibility to Microsoft's NFSv3 driver</para>
  2449. +            </listitem>
  2450. +            <listitem>
  2451. +              <para>Cygwin ACLs, e.g., <command>setfacl</command>/<command>getfacl</command></para>
  2452. +            </listitem>
  2453. +            <listitem>
  2454. +              <para>Cygwin/MSYS2 symlinks</para>
  2455. +            </listitem>
  2456. +          </itemizedlist>
  2457. +        </para>
  2458. +      </listitem>
  2459. +      <listitem>
  2460. +        <para>Custom primary group support
  2461. +          <itemizedlist>
  2462. +            <listitem>
  2463. +              <para>Supports primary group changes in the calling process/thread (via <literal>|SetTokenInformation(..., TokenPrimaryGroup,...)|</literal>), e.g., if the calling process/threads switches the primary group in its access token then the NFSv4.2 client will use that group as GID for file creation.</para>
  2464. +            </listitem>
  2465. +            <listitem>
  2466. +              <para><command>newgrp(1)</command>/<command>sg(1)</command>-style "winsg" utility to run cmd.exe with different primary group, e.g., <command>$ winsg [-] -g group [-c command | /C command] #</command></para>
  2467. +            </listitem>
  2468. +          </itemizedlist>
  2469. +        </para>
  2470. +      </listitem>
  2471. +      <listitem>
  2472. +        <para>Software compatibility:
  2473. +          <itemizedlist>
  2474. +            <listitem>
  2475. +              <para>Any NFSv4.2/NFSv4.1 server (Linux, Solaris, Illumos, FreeBSD, nfs4j, ...)</para>
  2476. +            </listitem>
  2477. +            <listitem>
  2478. +              <para>All tools from Cygwin/MSYS2/MinGW</para>
  2479. +            </listitem>
  2480. +            <listitem>
  2481. +              <para>Visual Studio</para>
  2482. +            </listitem>
  2483. +            <listitem>
  2484. +              <para>VMware Workstation (can use VMs hosted on NFSv4.2/NFSv4.1 filesystem)</para>
  2485. +            </listitem>
  2486. +          </itemizedlist>
  2487. +        </para>
  2488. +      </listitem>
  2489. +    </itemizedlist>
  2490. +  </section>
  2491. +
  2492. +  <section xml:id="requirements">
  2493. +    <title>Requirements</title>
  2494. +    <itemizedlist>
  2495. +      <listitem>
  2496. +        <para>Windows 10 (32bit or 64bit), Windows 11 or Windows Server 2019+2022</para>
  2497. +      </listitem>
  2498. +      <listitem>
  2499. +        <para>Cygwin:
  2500. +          <itemizedlist>
  2501. +            <listitem>
  2502. +              <para>Cygwin versions:
  2503. +                <itemizedlist>
  2504. +                  <listitem>
  2505. +                    <para>64bit: &gt;= 3.5.7, recommended &gt;= 3.6.1</para>
  2506. +                  </listitem>
  2507. +                  <listitem>
  2508. +                    <para>32bit: &gt;= 3.3.6</para>
  2509. +                  </listitem>
  2510. +                </itemizedlist>
  2511. +              </para>
  2512. +            </listitem>
  2513. +            <listitem>
  2514. +              <para>Packages (required):
  2515. +                <itemizedlist>
  2516. +                  <listitem><para><literal>cygwin</literal></para></listitem>
  2517. +                  <listitem><para><literal>cygrunsrv</literal></para></listitem>
  2518. +                  <listitem><para><literal>cygutils</literal></para></listitem>
  2519. +                  <listitem><para><literal>cygutils-extra</literal></para></listitem>
  2520. +                  <listitem><para><literal>libiconv</literal></para></listitem>
  2521. +                  <listitem><para><literal>libiconv2</literal></para></listitem>
  2522. +                  <listitem><para><literal>procps-ng</literal></para></listitem>
  2523. +                  <listitem><para><literal>util-linux</literal></para></listitem>
  2524. +                </itemizedlist>
  2525. +              </para>
  2526. +            </listitem>
  2527. +            <listitem>
  2528. +              <para>Packages (optional, recommended, required to build ms-nf41-client):
  2529. +                <itemizedlist>
  2530. +                  <listitem><para><literal>bison</literal></para></listitem>
  2531. +                  <listitem><para><literal>cygport</literal></para></listitem>
  2532. +                  <listitem><para><literal>cygwin-devel</literal></para></listitem>
  2533. +                  <listitem><para><literal>clang</literal></para></listitem>
  2534. +                  <listitem><para><literal>dos2unix</literal></para></listitem>
  2535. +                  <listitem><para><literal>pax</literal></para></listitem>
  2536. +                  <listitem><para><literal>pbzip2</literal></para></listitem>
  2537. +                  <listitem><para><literal>libnfs-utils</literal> (for <filename>/usr/bin/nfs-ls</filename>)</para></listitem>
  2538. +                  <listitem><para><literal>libiconv-devel</literal></para></listitem>
  2539. +                  <listitem><para><literal>make</literal></para></listitem>
  2540. +                  <listitem><para><literal>bmake</literal></para></listitem>
  2541. +                  <listitem><para><literal>git</literal></para></listitem>
  2542. +                  <listitem><para><literal>gcc-core</literal></para></listitem>
  2543. +                  <listitem><para><literal>gcc-g++</literal></para></listitem>
  2544. +                  <listitem><para><literal>gdb</literal></para></listitem>
  2545. +                  <listitem><para><literal>mingw64-i686-clang</literal></para></listitem>
  2546. +                  <listitem><para><literal>mingw64-x86_64-clang</literal></para></listitem>
  2547. +                  <listitem><para><literal>unzip</literal></para></listitem>
  2548. +                  <listitem><para><literal>time</literal></para></listitem>
  2549. +                  <listitem><para><literal>docbook-utils</literal></para></listitem>
  2550. +                  <listitem><para><literal>docbook-xml45</literal></para></listitem>
  2551. +                  <listitem><para><literal>docbook-xsl</literal></para></listitem>
  2552. +                  <listitem><para><literal>docbook-xsl-ns</literal></para></listitem>
  2553. +                  <listitem><para><literal>libxslt</literal></para></listitem>
  2554. +                  <listitem><para><literal>w3m</literal></para></listitem>
  2555. +                </itemizedlist>
  2556. +              </para>
  2557. +            </listitem>
  2558. +            <listitem>
  2559. +              <para>Packages (only-CI):
  2560. +                <itemizedlist>
  2561. +                  <listitem><para># required packages, but part of Cygwin default installation</para></listitem>
  2562. +                  <listitem><para># listed here for CI package list ONLY</para></listitem>
  2563. +                  <listitem><para><literal>bash</literal></para></listitem>
  2564. +                  <listitem><para><literal>bzip2</literal></para></listitem>
  2565. +                  <listitem><para><literal>coreutils</literal></para></listitem>
  2566. +                  <listitem><para><literal>getent</literal></para></listitem>
  2567. +                  <listitem><para><literal>grep</literal></para></listitem>
  2568. +                  <listitem><para><literal>hostname</literal></para></listitem>
  2569. +                  <listitem><para><literal>less</literal></para></listitem>
  2570. +                  <listitem><para><literal>sed</literal></para></listitem>
  2571. +                  <listitem><para><literal>tar</literal></para></listitem>
  2572. +                  <listitem><para><literal>wget</literal></para></listitem>
  2573. +                </itemizedlist>
  2574. +              </para>
  2575. +            </listitem>
  2576. +          </itemizedlist>
  2577. +        </para>
  2578. +      </listitem>
  2579. +      <listitem>
  2580. +        <para>MSYS2 (64bit, optional):
  2581. +          <itemizedlist>
  2582. +            <listitem>
  2583. +              <para>Packages (recommended):
  2584. +                <itemizedlist>
  2585. +                  <listitem><para><literal>base-devel</literal></para></listitem>
  2586. +                  <listitem><para><literal>gcc</literal></para></listitem>
  2587. +                  <listitem><para><literal>clang</literal></para></listitem>
  2588. +                  <listitem><para><literal>sed</literal></para></listitem>
  2589. +                  <listitem><para><literal>time</literal></para></listitem>
  2590. +                  <listitem><para><literal>coreutils</literal></para></listitem>
  2591. +                  <listitem><para><literal>util-linux</literal></para></listitem>
  2592. +                  <listitem><para><literal>grep</literal></para></listitem>
  2593. +                  <listitem><para><literal>sed</literal></para></listitem>
  2594. +                  <listitem><para><literal>emacs</literal></para></listitem>
  2595. +                  <listitem><para><literal>gdb</literal></para></listitem>
  2596. +                  <listitem><para><literal>make</literal></para></listitem>
  2597. +                  <listitem><para><literal>autoconf</literal></para></listitem>
  2598. +                  <listitem><para><literal>automake</literal></para></listitem>
  2599. +                  <listitem><para><literal>gettext</literal></para></listitem>
  2600. +                  <listitem><para><literal>gettext-devel</literal></para></listitem>
  2601. +                  <listitem><para><literal>git</literal></para></listitem>
  2602. +                  <listitem><para><literal>subversion</literal></para></listitem>
  2603. +                  <listitem><para><literal>flex</literal></para></listitem>
  2604. +                  <listitem><para><literal>bison</literal></para></listitem>
  2605. +                  <listitem><para><literal>unzip</literal></para></listitem>
  2606. +                  <listitem><para><literal>pax</literal></para></listitem>
  2607. +                  <listitem><para><literal>tar</literal></para></listitem>
  2608. +                  <listitem><para><literal>libiconv-devel</literal></para></listitem>
  2609. +                  <listitem><para><literal>ncurses-devel</literal></para></listitem>
  2610. +                  <listitem><para><literal>gmp-devel</literal></para></listitem>
  2611. +                  <listitem><para><literal>mpfr-devel</literal></para></listitem>
  2612. +                  <listitem><para><literal>mpc-devel</literal></para></listitem>
  2613. +                  <listitem><para><literal>isl-devel</literal></para></listitem>
  2614. +                  <listitem><para><literal>procps-ng</literal></para></listitem>
  2615. +                  <listitem><para><literal>libiconv-devel</literal></para></listitem>
  2616. +                </itemizedlist>
  2617. +              </para>
  2618. +            </listitem>
  2619. +          </itemizedlist>
  2620. +        </para>
  2621. +      </listitem>
  2622. +    </itemizedlist>
  2623. +  </section>
  2624. +
  2625. +  <section xml:id="installation">
  2626. +    <title>Installation</title>
  2627. +
  2628. +  <section xml:id="download-install-cygwin">
  2629. +    <title>Download and install Cygwin (if not installed yet)</title>
  2630. +    <para>Windows 32bit-vs.-64bit can be tested from Windows <command>cmd.exe</command> console:</para>
  2631. +    <para>Run this command:</para>
  2632. +    <programlisting>echo %PROCESSOR_ARCHITECTURE%</programlisting>
  2633. +    <para>If this returns "AMD64" then you have a Windows 64bit kernel, and if it returns "x86" then you have Windows 32bit kernel. If you get any other value then this is a (documentation) bug.</para>
  2634. +
  2635. +    <para>Cygwin 64bit can be installed like this:</para>
  2636. +    <para>
  2637. +      <emphasis role="strong">Install Cygwin 64bit on Windows 64bit with packages required by "ms-nfs41-client" (Windows NFSv4.2 client):</emphasis>
  2638. +    </para>
  2639. +    <orderedlist>
  2640. +      <listitem>
  2641. +        <para>Create subdir</para>
  2642. +        <programlisting>mkdir download
  2643. +cd download</programlisting>
  2644. +      </listitem>
  2645. +      <listitem>
  2646. +        <para>Get installer from <link xl:href="https://cygwin.com/setup-x86_64.exe">https://cygwin.com/setup-x86_64.exe</link></para>
  2647. +        <programlisting>curl --remote-name "https://www.cygwin.com/setup-x86_64.exe"</programlisting>
  2648. +      </listitem>
  2649. +      <listitem>
  2650. +        <para>Run installer with these arguments:</para>
  2651. +        <programlisting>setup-x86_64.exe -q --site "https://mirrors.kernel.org/sourceware/cygwin" -P cygwin,cygwin-devel,cygrunsrv,cygutils,cygutils-extra,bash,bzip2,coreutils,getent,gdb,grep,hostname,less,libiconv,libiconv2,pax,pbzip2,procps-ng,sed,tar,time,util-linux,wget,libnfs-utils,make,bmake,git,dos2unix,unzip</programlisting>
  2652. +      </listitem>
  2653. +    </orderedlist>
  2654. +
  2655. +    <para>Cygwin 32bit can be installed like this:</para>
  2656. +    <para>
  2657. +      <emphasis role="strong">Install Cygwin 32bit on Windows 32bit with packages required by "ms-nfs41-client" (Windows NFSv4.2 client):</emphasis>
  2658. +    </para>
  2659. +    <orderedlist>
  2660. +      <listitem>
  2661. +        <para>Create subdir</para>
  2662. +        <programlisting>mkdir download
  2663. +cd download</programlisting>
  2664. +      </listitem>
  2665. +      <listitem>
  2666. +        <para>Get installer from <link xl:href="https://www.cygwin.com/setup-x86.exe">https://www.cygwin.com/setup-x86.exe</link></para>
  2667. +        <programlisting>curl --remote-name "https://www.cygwin.com/setup-x86.exe"</programlisting>
  2668. +      </listitem>
  2669. +      <listitem>
  2670. +        <para>Run installer with these arguments:</para>
  2671. +        <programlisting>setup-x86.exe --allow-unsupported-windows -q --no-verify --site "http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/2022/11/23/063457" -P cygwin,cygwin-devel,cygrunsrv,cygutils,cygutils-extra,bash,bzip2,coreutils,getent,gdb,grep,hostname,less,libiconv,libiconv2,pax,pbzip2,procps-ng,sed,tar,time,util-linux,wget,libnfs-utils,make,bmake,git,dos2unix,unzip</programlisting>
  2672. +      </listitem>
  2673. +    </orderedlist>
  2674. +  </section>
  2675. +
  2676. +  <section xml:id="download-install-msys2">
  2677. +    <title>Download and install MSYS2/64bit [OPTIONAL]</title>
  2678. +    <orderedlist>
  2679. +      <listitem>
  2680. +        <para>Download &amp; install from Cygwin</para>
  2681. +        <programlisting>mkdir -p download &amp;&amp; cd download
  2682. +wget 'https://github.com/msys2/msys2-installer/releases/download/2025-02-21/msys2-x86_64-20250221.exe'
  2683. +chmod a+x 'msys2-x86_64-20250221'
  2684. +./msys2-x86_64-20250221 --default-answer --root 'C:\msys64' install</programlisting>
  2685. +      </listitem>
  2686. +      <listitem>
  2687. +        <para>Install extra packages:</para>
  2688. +        <para>Start MSYS2 UCRT mintty and execute this:</para>
  2689. +        <programlisting>pacman -S --noconfirm base-devel gcc clang sed time coreutils util-linux grep sed emacs gdb make autoconf automake gettext gettext-devel git subversion flex bison unzip pax tar libiconv-devel ncurses-devel gmp-devel mpfr-devel mpc-devel isl-devel procps-ng libiconv-devel</programlisting>
  2690. +      </listitem>
  2691. +    </orderedlist>
  2692. +  </section>
  2693. +
  2694. +  <section xml:id="download-msnfs41client-tarball">
  2695. +    <title>Download "ms-nfs41-client" installation tarball</title>
  2696. +    <para>(from a Cygwin terminal)</para>
  2697. +    <programlisting>$ mkdir -p ~/download
  2698. +$ cd ~/download
  2699. +$ wget 'http://www.nrubsig.org/people/gisburn/work/msnfs41client/releases/testing/${bintarball.base_filename}.tar.bz2'
  2700. +$ openssl sha256 "${bintarball.base_filename}.tar.bz2"
  2701. +SHA2-256(${bintarball.base_filename}.tar.bz2)= ${bintarball.archive_sha256hash}</programlisting>
  2702. +  </section>
  2703. +
  2704. +  <section xml:id="installation-via-cygwin">
  2705. +    <title>Installation (as "Administrator")</title>
  2706. +    <programlisting>$ (cd / &amp;&amp; tar -xf ~/download/${bintarball.base_filename}.tar.bz2 )
  2707. +$ /sbin/msnfs41client install
  2708. +&lt;REBOOT&gt;</programlisting>
  2709. +  </section>
  2710. +
  2711. +  <section xml:id="deinstallation">
  2712. +    <title>Deinstallation</title>
  2713. +    <programlisting>$ (set -o xtrace ; cd / &amp;&amp; tar -tf ~/download/${bintarball.base_filename}.tar.bz2 | while read i ; do [[ -f "$i" ]] &amp;&amp; rm "$i" ; done)
  2714. +&lt;REBOOT&gt;</programlisting>
  2715. +  </section>
  2716. +
  2717. +  </section>
  2718. +
  2719. +  <section xml:id="usage">
  2720. +    <title>Usage</title>
  2721. +
  2722. +    <section xml:id="prep_nfs_server">
  2723. +      <title>Preparing the NFS server</title>
  2724. +
  2725. +      <section xml:id="nfs_server_config">
  2726. +        <title>NFS server config</title>
  2727. +        <itemizedlist>
  2728. +          <listitem><para>Make sure the NFS client can access the NFS server</para></listitem>
  2729. +          <listitem><para>The NFS server should send owner and owner_group information as user@domain and group@domain, and not as numeric uid/gid information</para></listitem>
  2730. +        </itemizedlist>
  2731. +      </section>
  2732. +
  2733. +      <section xml:id="nfs_server_accounts">
  2734. +        <title>User/group accounts on the NFS server</title>
  2735. +        <para>It is required that all Windows users and groups used by the
  2736. +        Windows NFS client have user/group accounts on the server
  2737. +        side.</para>
  2738. +        <para>If no central user&amp;group management between NFS server
  2739. +        and NFS clients exists the
  2740. +        <filename>/sbin/cygwinaccount2nfs4account</filename> script can be
  2741. +        used to manually create matching <filename>/etc/group</filename> and
  2742. +        <filename>/etc/passwd</filename> entries on the NFS server side.</para>
  2743. +      </section>
  2744. +    </section>
  2745. +
  2746. +    <section xml:id="starting_nfs_daemon">
  2747. +      <title>Starting the NFS client daemon</title>
  2748. +
  2749. +      <section xml:id="run_as_windows_service">
  2750. +        <title>Run as Windows Service</title>
  2751. +        <para>
  2752. +          <itemizedlist>
  2753. +            <listitem>
  2754. +              <para>Start NFSv4 client daemon as Windows service (requires "Administrator" account):</para>
  2755. +              <programlisting>$ sc start ms-nfs41-client-service</programlisting>
  2756. +            </listitem>
  2757. +            <listitem>
  2758. +              <para>Notes:
  2759. +                <itemizedlist>
  2760. +                  <listitem>
  2761. +                    <para>requires "Administrator" account, and one nfsd client daemon is used for all users on a machine.</para>
  2762. +                  </listitem>
  2763. +                  <listitem>
  2764. +                    <para>The "ms-nfs41-client-service" service is installed by default as "disabled" and therefore always requires a "manual" start (e.g., <command>$ sc start ms-nfs41-client-service #</command>)</para>
  2765. +                  </listitem>
  2766. +                  <listitem>
  2767. +                    <para>DOS devices are virtualised per LSA Logon, so each Logon needs to do a separate <command>nfs_mount.exe</command> to mount a NFSv4 share. The exception are mounts created by user "SYSTEM", such mounts are available to all users/logons. (see <command>PsExec</command> or function "su_system" in <filename>msnfs41client.bash</filename> how to run a process as user "SYSTEM")</para>
  2768. +                  </listitem>
  2769. +                  <listitem>
  2770. +                    <para><command>nfsd_debug.exe</command> will run as user "SYSTEM", but will do user impersonation for each request</para>
  2771. +                  </listitem>
  2772. +                  <listitem>
  2773. +                    <para>stopping the service will NOT unmount filesystems, and due to a bug a reboot is required to restart and mount any NFSv4 filesystems again</para>
  2774. +                  </listitem>
  2775. +                </itemizedlist>
  2776. +              </para>
  2777. +            </listitem>
  2778. +            <listitem>
  2779. +              <para>Administration:
  2780. +                <itemizedlist>
  2781. +                  <listitem>
  2782. +                    <para>Follow new log messages:</para>
  2783. +                    <programlisting>$ tail -f '/var/log/ms-nfs41-client-service.log'</programlisting>
  2784. +                  </listitem>
  2785. +                  <listitem>
  2786. +                    <para>Query service status:</para>
  2787. +                    <programlisting>$ sc queryex ms-nfs41-client-service</programlisting>
  2788. +                  </listitem>
  2789. +                  <listitem>
  2790. +                    <para>Query service config:</para>
  2791. +                    <programlisting>$ sc qc ms-nfs41-client-service</programlisting>
  2792. +                  </listitem>
  2793. +                  <listitem>
  2794. +                    <para>Start service automatically:</para>
  2795. +                    <para>(<command>nfsd_debug.exe</command> will be started automagically, but mounts are not restored):</para>
  2796. +                    <programlisting>$ sc config ms-nfs41-client-service start=auto</programlisting>
  2797. +                  </listitem>
  2798. +                  <listitem>
  2799. +                    <para>Start service manually (default):</para>
  2800. +                    <programlisting>$ sc config ms-nfs41-client-service start=disabled</programlisting>
  2801. +                  </listitem>
  2802. +                </itemizedlist>
  2803. +              </para>
  2804. +            </listitem>
  2805. +          </itemizedlist>
  2806. +        </para>
  2807. +      </section>
  2808. +
  2809. +      <section xml:id="manual_start">
  2810. +        <title>Manual starting the daemon</title>
  2811. +        <para>Run the NFSv4 client daemon manually:</para>
  2812. +        <itemizedlist>
  2813. +          <listitem>
  2814. +            <para>run this preferably as "Administrator", but this is not a requirement</para>
  2815. +          </listitem>
  2816. +          <listitem>
  2817. +            <para>requires separate terminal</para>
  2818. +          </listitem>
  2819. +        </itemizedlist>
  2820. +        <programlisting>$ /sbin/msnfs41client run_daemon</programlisting>
  2821. +      </section>
  2822. +
  2823. +    </section>
  2824. +
  2825. +    <section xml:id="mounting_and_using">
  2826. +      <title>Mounting and using NFS filesystems</title>
  2827. +
  2828. +      <section xml:id="basic_usage">
  2829. +        <title>Basic usage</title>
  2830. +        <para>Mount a filesystem to drive N: and use it</para>
  2831. +        <programlisting>$ /sbin/nfs_mount -o rw N 10.49.202.230:/net_tmpfs2
  2832. +Successfully mounted '10.49.202.230@2049' to drive 'N:'
  2833. +$ cd /cygdrive/n/
  2834. +$ ls -la
  2835. +total 4
  2836. +drwxrwxrwt 5 Unix_User+0      Unix_Group+0      100 Dec  7 14:17 .
  2837. +dr-xr-xr-x 1 roland_mainz     Kein                0 Dec 14 13:48 ..
  2838. +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  80 Dec 12 16:24 10492030
  2839. +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  60 Dec 13 17:58 directory_t
  2840. +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  60 Dec  7 11:01 test2</programlisting>
  2841. +
  2842. +        <para>Unmount filesystem:</para>
  2843. +        <programlisting>$ cd ~ &amp;&amp; /sbin/nfs_umount N:
  2844. +# OR
  2845. +$ cd ~
  2846. +$ net use N: /delete</programlisting>
  2847. +
  2848. +        <para>Mount a filesystem WITHOUT a dos drive assigned and use it via UNC path</para>
  2849. +        <programlisting>$ /sbin/nfs_mount -o rw 10.49.202.230:/net_tmpfs2
  2850. +Successfully mounted '10.49.202.230@2049' to drive '\0.49.202.230@2049\nfs4\net_tmpfs2'
  2851. +$ cygpath -u '\0.49.202.230@2049\nfs4\net_tmpfs2'
  2852. +//10.49.202.230@2049/nfs4/net_tmpfs2
  2853. +$ cd '//10.49.202.230@2049/nfs4/net_tmpfs2'
  2854. +$ ls -la
  2855. +total 4
  2856. +drwxrwxrwt 5 Unix_User+0      Unix_Group+0      100 Dec  7 14:17 .
  2857. +dr-xr-xr-x 1 roland_mainz     Kein                0 Dec 14 13:48 ..
  2858. +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  80 Dec 12 16:24 10492030
  2859. +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  60 Dec 13 17:58 directory_t
  2860. +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  60 Dec  7 11:01 test2</programlisting>
  2861. +        <para>Unmount filesystem:</para>
  2862. +        <programlisting>$ cd ~ &amp;&amp; /sbin/nfs_umount '\0.49.202.230@2049\nfs4\net_tmpfs2'
  2863. +# OR
  2864. +$ cd ~
  2865. +$ net use '\0.49.202.230@2049\nfs4\net_tmpfs2' /delete</programlisting>
  2866. +        <para>List mounted NFSv4.2 filesystems:</para>
  2867. +        <programlisting>$ /sbin/nfs_mount</programlisting>
  2868. +      </section>
  2869. +
  2870. +      <section xml:id="global-system-wide-mounts">
  2871. +        <title>Global/System-wide mounts</title>
  2872. +        <para>Mounts created by user "SYSTEM" are usable by all users in a system. Example usage:</para>
  2873. +        <programlisting># Create a file /etc/fstab.msnfs41client, which list the mounts
  2874. +# which should be available system-wide
  2875. +$ cat /etc/fstab.msnfs41client
  2876. +nfs://[fe80::21b:1bff:fec3:7713]//bigdisk       V       nfs     rw      0       0
  2877. +# run "ms-nfs41-client-globalmountall-service", which runs
  2878. +# /sbin/mountall_msnfs41client as user "SYSTEM" to read
  2879. +# /etc/fstab.msnfs41client and mount the matching filesystems
  2880. +sc start ms-nfs41-client-globalmountall-service</programlisting>
  2881. +        <para>BUG: "ms-nfs41-client-globalmountall-service" currently does not wait until <command>nfsd*.exe</command> is available for accepting mounts.</para>
  2882. +      </section>
  2883. +
  2884. +      <section xml:id="wsl-usage">
  2885. +        <title>WSL usage</title>
  2886. +        <para>Example 1: Mount Windows NFSv4.2 share via Windows drive letter</para>
  2887. +        <para>Mount NFSv4.2 share in Windows to drive letter 'N':</para>
  2888. +        <programlisting>$ /sbin/nfs_mount -o rw 'N' nfs://10.49.202.230//bigdisk
  2889. +Successfully mounted '10.49.202.230@2049' to drive 'N:'</programlisting>
  2890. +        <para>Within WSL mount drive letter 'N' to <filename>/mnt/n</filename></para>
  2891. +        <programlisting>$ sudo bash
  2892. +$ mkdir /mnt/n
  2893. +$ mount -t drvfs N: /mnt/n</programlisting>
  2894. +
  2895. +        <para>Example 2: Mount Windows NFSv4.2 share via UNC path:</para>
  2896. +        <para>Mount NFSv4.2 share in Windows</para>
  2897. +        <programlisting>$ /sbin/nfs_mount -o rw nfs://10.49.202.230//bigdisk
  2898. +Successfully mounted '10.49.202.230@2049' to drive '\0.49.202.230@2049\nfs4\bigdisk'</programlisting>
  2899. +        <para>Within WSL mount UNC path returned by <filename>/sbin/nfs_mount</filename></para>
  2900. +        <programlisting>$ sudo bash
  2901. +$ mkdir /mnt/bigdisk
  2902. +$ mount -t drvfs '\0.49.202.230@2049\nfs4\bigdisk' /mnt/bigdisk</programlisting>
  2903. +
  2904. +        <para><emphasis role="strong">Known issues with WSL:</emphasis></para>
  2905. +        <itemizedlist>
  2906. +          <listitem><para>Softlinks do not work yet</para></listitem>
  2907. +          <listitem><para>Creating a hard link returns "Invalid Argument", maybe drvfs limitation</para></listitem>
  2908. +          <listitem><para>Not all POSIX file types (e.g. block devices) etc. are supported</para></listitem>
  2909. +        </itemizedlist>
  2910. +      </section>
  2911. +    </section>
  2912. +  </section>
  2913. +
  2914. +  <section xml:id="notes">
  2915. +    <title>Notes</title>
  2916. +    <itemizedlist>
  2917. +      <listitem>
  2918. +        <para>Idmapping (including uid/gid mapping) between NFSv4 client and NFSv4 server works via <filename>/lib/msnfs41client/cygwin_idmapper.ksh</filename>, which either uses builtin static data, or <filename>/usr/bin/getent passwd</filename> and <filename>/usr/bin/getent group</filename>. As <command>getent</command> uses the configured name services it should work with LDAP too. This is still work-in-progress, with the goal that both NFSv4 client and server can use different uid/gid numeric values for client and server side.</para>
  2919. +      </listitem>
  2920. +      <listitem>
  2921. +        <para>UNC paths are supported, after successful mounting <filename>/sbin/nfs_mount</filename> will list the paths in Cygwin/MSYS2 UNC format.</para>
  2922. +      </listitem>
  2923. +      <listitem>
  2924. +        <para>SIDs work, users with valid Windows accounts (see Cygwin idmapping above get their SIDs, unknown users with valid uid/gid values get Unix_User+id/Unix_Group+id SIDs, and all others are mapped to nobody/nogroup SIDs.</para>
  2925. +      </listitem>
  2926. +      <listitem>
  2927. +        <para>Workflow for <literal>nfs://</literal>-URLs:
  2928. +          <itemizedlist>
  2929. +            <listitem><para>Create <literal>nfs://</literal>-URLs with <command>nfsurlconv</command>, read <command>$ nfsurlconv --man #</command> for usage</para></listitem>
  2930. +            <listitem><para>pass URL to <filename>nfs_mount.exe</filename> like this: <command>$ nfs_mount -o sec=sys,rw 'L' nfs://derfwnb4966_ipv4//bigdisk #</command></para></listitem>
  2931. +          </itemizedlist>
  2932. +        </para>
  2933. +      </listitem>
  2934. +      <listitem>
  2935. +        <para>Cygwin/MSYS2 symlinks are supported, but might require <command>$ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1 #</command>. This includes symlinks to UNC paths, e.g., as Administrator <command>$ cmd /c 'mklink /d c:\home\rmainz \\derfwpc5131_ipv6@2049\nfs4\export\home2\rmainz' #</command> and then <command>$ cd /cygdrive/c/home/rmainz/ #</command> should work</para>
  2936. +      </listitem>
  2937. +      <listitem>
  2938. +        <para>performance: All binaries are built without any optimisation, so the filesystem is much slower than it could be.</para>
  2939. +      </listitem>
  2940. +      <listitem>
  2941. +        <para>bad performance due to Windows Defender AntiVirus:
  2942. +          <itemizedlist>
  2943. +            <listitem>
  2944. +              <para>Option 1: disable Windows defender realtime monitoring (requires Administrator shell)</para>
  2945. +              <programlisting>powershell -Command 'Set-MpPreference -DisableRealtimeMonitoring 1'</programlisting>
  2946. +            </listitem>
  2947. +            <listitem>
  2948. +              <para>Option 2: Add "<filename>nfsd.exe</filename>", "<filename>nfsd_debug.exe</filename>", "<filename>ksh93.exe</filename>", "<filename>bash.exe</filename>", "<filename>git.exe</filename>" and other offending commands to the process name whitelist.</para>
  2949. +            </listitem>
  2950. +          </itemizedlist>
  2951. +        </para>
  2952. +      </listitem>
  2953. +      <listitem>
  2954. +        <para>performance: Use <literal>vmxnet3</literal> in VMware to improve performance</para>
  2955. +      </listitem>
  2956. +      <listitem>
  2957. +        <para>ACLs are supported via the normal Windows ACL tools, but on Linux require the <command>nfs4_getfacl</command>/<command>nfs4_setfacl</command> utilities to see the data.</para>
  2958. +        <para><emphasis role="strong">Example 1</emphasis> (assuming that Windows, Linux NFSv4 client and NFSv4 server have a user "siegfried_wulsch"):</para>
  2959. +        <itemizedlist>
  2960. +          <listitem>
  2961. +            <para>On Windows on a NFSv4 filesystem:</para>
  2962. +            <programlisting>$ icacls myhorribledata.txt /grant "siegfried_wulsch:WD" #</programlisting>
  2963. +          </listitem>
  2964. +          <listitem>
  2965. +            <para>On Linux NFSv4 clients you will then see this:</para>
  2966. +            <programlisting>$ nfs4_getfacl myhorribledata.txt
  2967. +A::OWNER@:rwatTcCy
  2968. +A::siegfried_wulsch@global.loc:rwatcy
  2969. +A::GROUP@:rtcy
  2970. +A::EVERYONE@:rtcy</programlisting>
  2971. +          </listitem>
  2972. +        </itemizedlist>
  2973. +        <para><emphasis role="strong">Example 2</emphasis> (assuming that Windows, Linux NFSv4 client and NFSv4 server have a group "cygwingrp2"):</para>
  2974. +        <itemizedlist>
  2975. +          <listitem>
  2976. +            <para>On Windows on a NFSv4 filesystem:</para>
  2977. +            <programlisting>$ icacls myhorribledata.txt /grant "cygwingrp2:(WDAC)" /t /c #</programlisting>
  2978. +          </listitem>
  2979. +          <listitem>
  2980. +            <para>On Linux NFSv4 clients you will then see this:</para>
  2981. +            <programlisting>$ nfs4_getfacl myhorribledata.txt
  2982. +A::OWNER@:rwatTcCy
  2983. +A::GROUP@:rtcy
  2984. +A:g:cygwingrp2@global.loc:rtcy
  2985. +A::EVERYONE@:rtcy</programlisting>
  2986. +          </listitem>
  2987. +        </itemizedlist>
  2988. +      </listitem>
  2989. +      <listitem>
  2990. +        <para><filename>nfs_mount.exe</filename> vs. reserved ports: By default the NFSv4 server on Solaris, Illumos, Linux etc. only accepts connections if the NFSv4 client uses a "privileged (TCP) port", i.e., using a TCP port number &lt; 1024. If <filename>nfsd.exe</filename>/<filename>nfsd_debug.exe</filename> is started without the Windows privilege to use reserved ports, then a mount attempt can fail. This can be worked around on the NFSv4 server side - on Linux using the "insecure" export option in <filename>/etc/exports</filename> and on Solaris/Illumos using export option "resvport" (see <command>nfs(5)</command>).</para>
  2991. +      </listitem>
  2992. +      <listitem>
  2993. +        <para>Accessing mounts from a VMware/QEMU/VirtualBox VM using NAT requires the the "insecure" export option in <filename>/etc/exports</filename> and on Solaris/Illumos using export option "resvport" (see <command>nfs(5)</command>), as the NFSv4 client source TCP port will be &gt;= 1024.</para>
  2994. +      </listitem>
  2995. +      <listitem>
  2996. +        <para>Install: Adding Windows accounts+groups to the NFSv4 server: <literal>ms-nfs41-client</literal> comes with <filename>/sbin/cygwinaccount2nfs4account</filename> to convert the Win32/Cygwin account information of the (current) user+groups to a small script for the NFSv4 server to set-up these accounts on the server side.</para>
  2997. +      </listitem>
  2998. +      <listitem>
  2999. +        <para><command>nfs_mount -o sec=none ... #</command> works with Solaris 11.4 nfsd, but might require Linux kernel commit <link xl:href="https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git/patch/?id=bb4f07f2409c26c01e97e6f9b432545f353e3b66">https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git/patch/?id=bb4f07f2409c26c01e97e6f9b432545f353e3b66</link> ("nfsd: Fix NFSD_MAY_BYPASS_GSS and NFSD_MAY_BYPASS_GSS_ON_ROOT") to work.</para>
  3000. +      </listitem>
  3001. +    </itemizedlist>
  3002. +  </section>
  3003. +
  3004. +  <section xml:id="known-issues">
  3005. +    <title>Known issues</title>
  3006. +    <itemizedlist>
  3007. +      <listitem>
  3008. +        <para>The kernel driver ("<filename>nfs41_driver.sys</filename>") does not yet have a cryptographic signature for SecureBoot - which means it will only work if SecureBoot is turned off (otherwise <command>$ /sbin/msnfs41client install #</command> will FAIL!)</para>
  3009. +      </listitem>
  3010. +      <listitem>
  3011. +        <para>If <filename>nfsd_debug.exe</filename> crashes or gets killed, the only safe way to run it again requires a reboot</para>
  3012. +      </listitem>
  3013. +      <listitem>
  3014. +        <para>LDAP support does not work yet</para>
  3015. +      </listitem>
  3016. +      <listitem>
  3017. +        <para>Attribute caching is too aggressive</para>
  3018. +      </listitem>
  3019. +      <listitem>
  3020. +        <para>Caching in the kernel does not always work. For example <command>$ tail -f ... #</command> does not not see new data. Workaround: Use GNU tail'S <command>$ tail --follow=name ... #</command> Working theory is that this is related to FCB caching, see <literal>|FCB_STATE_FILESIZECACHEING_ENABLED|</literal>, as the <filename>nfs41_driver.sys</filename> kernel module does not see the <literal>|stat()|</literal> syscalls. But <command>$ tail -f ... #</command> always works for a moment if something else opens the same file.</para>
  3021. +      </listitem>
  3022. +      <listitem>
  3023. +        <para>Unmounting and then mounting the same filesystem causes issues as the name cache in <command>nfsd*.exe</command> is not flushed on unmount, including leftover delegations.</para>
  3024. +      </listitem>
  3025. +      <listitem>
  3026. +        <para><literal>krb5p</literal> security with AES keys do not work against the linux server, as it does not support gss krb5 v2 tokens with rotated data.</para>
  3027. +      </listitem>
  3028. +      <listitem>
  3029. +        <para>When recovering opens and locks outside of the server's grace period, client does not check whether the file has been modified by another client.</para>
  3030. +      </listitem>
  3031. +      <listitem>
  3032. +        <para>If <filename>nfsd.exe</filename> is restarted while a drive is mapped, that drive needs to be remounted before further use.</para>
  3033. +      </listitem>
  3034. +      <listitem>
  3035. +        <para>Does not allow renaming a file on top of an existing open file. Connectathon's special test <literal>op_ren</literal> has been commented out.</para>
  3036. +      </listitem>
  3037. +      <listitem>
  3038. +        <para>File access timestamps might be wrong for delegations.</para>
  3039. +      </listitem>
  3040. +      <listitem>
  3041. +        <para>Extended attributes are supported with some limitations:
  3042. +          <itemizedlist>
  3043. +            <listitem><para>a) the server must support NFS Named Attributes,</para></listitem>
  3044. +            <listitem><para>b) the order of listings cannot be guaranteed by NFS, and</para></listitem>
  3045. +            <listitem><para>c) the EaSize field cannot be reported for directory queries of <literal>FileBothDirInformation</literal>, <literal>FileFullDirInfo</literal>, or <literal>FileIdFullDirInfo</literal>.</para></listitem>
  3046. +          </itemizedlist>
  3047. +        </para>
  3048. +      </listitem>
  3049. +      <listitem>
  3050. +        <para>Win10/32bit-only: <command>$ net use H: /delete #</command> does not work, use <command>$ nfs_umount 'H'</command> instead #</para>
  3051. +      </listitem>
  3052. +      <listitem>
  3053. +        <para>Windows event log can list errors like "MUP 0xc0000222" (<literal>|STATUS_LOST_WRITEBEHIND_DATA|</literal>) in case the disk on the NFSv4 server is full and outstanding writes from a memory-mapped file fail. Example:</para>
  3054. +        <programlisting>{Fehler beim verzoegerten Schreibvorgang} Nicht alle Daten fuer die
  3055. +Datei "\\34.159.25.153@2049\nfs4\export\nfs4export\gcc\lto-dump.exe"
  3056. +konnten gespeichert werden. Daten gingen verloren.
  3057. +Dieser Fehler wurde von dem Server zurueckgegeben, auf dem sich die
  3058. +Datei befindet. Versuchen Sie, die Datei woanders zu speichern.</programlisting>
  3059. +      </listitem>
  3060. +    </itemizedlist>
  3061. +  </section>
  3062. +
  3063. +  <section xml:id="troubleshooting-debugging">
  3064. +    <title>Troubleshooting &amp;&amp; finding bugs/debugging</title>
  3065. +    <itemizedlist>
  3066. +      <listitem>
  3067. +        <para><filename>nfsd_debug.exe</filename> has the <literal>-d</literal> option to set a level for debug output. Edit <filename>/sbin/msnfs41client</filename> to set the <literal>"-d"</literal> option.</para>
  3068. +      </listitem>
  3069. +      <listitem>
  3070. +        <para>The "msnfs41client" script has the option "<literal>watch_kernel_debuglog</literal>" to get the debug output of the kernel module.</para>
  3071. +        <para>Run as Administrator: <command>$ /sbin/msnfs41client watch_kernel_debuglog #</command></para>
  3072. +        <para>Currently requires DebugView (<link xl:href="https://learn.microsoft.com/en-gb/sysinternals/downloads/debugview">https://learn.microsoft.com/en-gb/sysinternals/downloads/debugview</link>) to be installed.</para>
  3073. +      </listitem>
  3074. +      <listitem>
  3075. +        <para>Watching network traffic:
  3076. +          <itemizedlist>
  3077. +            <listitem><para>Use <command>$ /sbin/msnfs41client watch_nfs_traffic #</command> to watch the NFS network traffic</para></listitem>
  3078. +            <listitem>
  3079. +              <para>WireShark has a command line tool called "<command>tshark</command>", which can be used to see NFSv4 traffic. As NFSv4 uses RPC you have to filter for RPC, and the RPC filter automatically identifies NFSv4 traffic on its RPC id. Example for Windows: (for NFSv4 default TCP port "2049", replace "2049" with the desired port if you use a custom port; use "ipconfig" to find the correct interface name, in this case "Ethernet0"):</para>
  3080. +              <programlisting>$ nfsv4port=2049 ; /cygdrive/c/Program\ Files/Wireshark/tshark \
  3081. +  -f "port $nfsv4port" -d "tcp.port==${nfsv4port},rpc" -i Ethernet0</programlisting>
  3082. +            </listitem>
  3083. +            <listitem>
  3084. +              <para>If you are running inside a VMware VM on a Linux host it might require <command>$ chmod a+rw /dev/vmnet0 #</command> on VMware host, so that the VM can use "Promiscuous Mode".</para>
  3085. +            </listitem>
  3086. +          </itemizedlist>
  3087. +        </para>
  3088. +      </listitem>
  3089. +    </itemizedlist>
  3090. +  </section>
  3091. +
  3092. +  <section xml:id="development">
  3093. +    <title>Development</title>
  3094. +
  3095. +    <section xml:id="source-code">
  3096. +      <title>Source code</title>
  3097. +      <para>Source code can be obtained from <link xl:href="https://github.com/kofemann/ms-nfs41-client">https://github.com/kofemann/ms-nfs41-client</link> or as git bundle from <filename>/usr/src/msnfs41client/msnfs41client_git.bundle</filename></para>
  3098. +    </section>
  3099. +
  3100. +    <section xml:id="building_msnfs41client">
  3101. +    <title>Building ms-nfs41-client</title>
  3102. +
  3103. +    <section xml:id="building-cygwin-makefile">
  3104. +      <title>Building ms-nfs41-client using Cygwin+Makefile</title>
  3105. +
  3106. +      <section xml:id="required-software-makefile">
  3107. +        <title>Required Software</title>
  3108. +        <itemizedlist>
  3109. +          <listitem>
  3110. +            <para><emphasis role="bold">Option 1:</emphasis> Windows 10 with Visual Studio 2019</para>
  3111. +            <itemizedlist>
  3112. +              <listitem>
  3113. +                <para>Start Visual Studio 2019 installer and import the installer config file
  3114. +                <filename>ms-nfs41-client/build.vc19/ms-nfs41-client_vs2019.vsconfig</filename>, and then install Visual Studio.</para>
  3115. +                <note>
  3116. +                  <para>Due to a bug in the VS installer, it is sometimes required to manually add another (random) component to be installed; otherwise, the imported config might be ignored.</para>
  3117. +                </note>
  3118. +              </listitem>
  3119. +              <listitem>
  3120. +                <para>WDK for Windows 10, version 2004, from <link xl:href="https://go.microsoft.com/fwlink/?linkid=2128854">https://go.microsoft.com/fwlink/?linkid=2128854</link></para>
  3121. +              </listitem>
  3122. +              <listitem>
  3123. +                <para>Cygwin 64bit &gt;= 3.5.0 (see <filename>ms-nfs41-clientcygwin/README.bintarball.txt</filename> for Cygwin 32bit and 64bit installation instructions)</para>
  3124. +              </listitem>
  3125. +              <listitem>
  3126. +                <para>PanDoc document converter, from <link xl:href="https://github.com/jgm/pandoc/releases/download/3.7.0.1/pandoc-3.7.0.1-windows-x86_64.msi">https://github.com/jgm/pandoc/releases/download/3.7.0.1/pandoc-3.7.0.1-windows-x86_64.msi</link></para>
  3127. +              </listitem>
  3128. +            </itemizedlist>
  3129. +          </listitem>
  3130. +          <listitem>
  3131. +            <para><emphasis role="bold">Option 2:</emphasis> Windows 10/11 with Visual Studio 2022</para>
  3132. +            <itemizedlist>
  3133. +              <listitem>
  3134. +                <para>Start Visual Studio 2022 installer and import the installer config file
  3135. +                <filename>ms-nfs41-client/build.vc19/ms-nfs41-client_vs2022.vsconfig</filename>, and then install Visual Studio.</para>
  3136. +                <note>
  3137. +                  <para>Due to a bug in the VS installer, it is sometimes required to manually add another (random) component to be installed; otherwise, the imported config might be ignored.</para>
  3138. +                </note>
  3139. +              </listitem>
  3140. +              <listitem>
  3141. +                <para>WDK for Windows 11, version 1591, from <link xl:href="https://go.microsoft.com/fwlink/?linkid=2286137">https://go.microsoft.com/fwlink/?linkid=2286137</link></para>
  3142. +              </listitem>
  3143. +              <listitem>
  3144. +                <para>Cygwin 64bit &gt;= 3.5.0 (see <filename>ms-nfs41-clientcygwin/README.bintarball.txt</filename> for Cygwin 32bit and 64bit installation instructions)</para>
  3145. +              </listitem>
  3146. +              <listitem>
  3147. +                <para>PanDoc document converter, from <link xl:href="https://github.com/jgm/pandoc/releases/download/3.7.0.1/pandoc-3.7.0.1-windows-x86_64.msi">https://github.com/jgm/pandoc/releases/download/3.7.0.1/pandoc-3.7.0.1-windows-x86_64.msi</link></para>
  3148. +              </listitem>
  3149. +            </itemizedlist>
  3150. +          </listitem>
  3151. +        </itemizedlist>
  3152. +      </section>
  3153. +
  3154. +      <section xml:id="build-project-makefile">
  3155. +        <title>Build the Project</title>
  3156. +        <itemizedlist>
  3157. +          <listitem>
  3158. +            <para><emphasis role="bold">Using Visual Studio 2019+Cygwin command line (bash/ksh93):</emphasis></para>
  3159. +            <programlisting># this creates a 32bit+kernel+64bit-kernel build for Windows 10+11
  3160. +export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/:$PATH"
  3161. +git clone https://github.com/kofemann/ms-nfs41-client.git
  3162. +cd ms-nfs41-client
  3163. +cd cygwin
  3164. +make build
  3165. +make installdest
  3166. +make bintarball</programlisting>
  3167. +          </listitem>
  3168. +          <listitem>
  3169. +            <para><emphasis role="bold">Using Visual Studio 2022+Cygwin command line (bash/ksh93):</emphasis></para>
  3170. +            <programlisting># this creates a 64bit-kernel only build for Windows 11
  3171. +export PATH="/cygdrive/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/:$PATH"
  3172. +git clone https://github.com/kofemann/ms-nfs41-client.git
  3173. +cd ms-nfs41-client
  3174. +# "retarget" VS platform toolset to "v143"
  3175. +# ("v142" should remain the default when comitting)
  3176. +sed -i -E 's/&lt;PlatformToolset&gt;v142&lt;\/PlatformToolset&gt;/&lt;PlatformToolset&gt;v143&lt;\/PlatformToolset&gt;/g' $(find 'build.vc19' -name \*.vcxproj)
  3177. +cd cygwin
  3178. +make build64
  3179. +make installdest64
  3180. +make bintarball64</programlisting>
  3181. +          </listitem>
  3182. +        </itemizedlist>
  3183. +        <note>
  3184. +          <para><command>make installdest</command> or <command>make installdest64</command> can fail on SMB/NFSv4.1 filesystems with a "link.exe" crash. The workaround is to disable incremental linking before building, e.g., do:</para>
  3185. +          <programlisting>cd ms-nfs41-client
  3186. +sed -i -E 's/&lt;LinkIncremental&gt;true&lt;\/LinkIncremental&gt;/&lt;LinkIncremental&gt;false&lt;\/LinkIncremental&gt;/g' $(find build.vc19 -name \*.vcxproj)</programlisting>
  3187. +            <para>This Visual Studio bug is tracked as <link xl:href="https://developercommunity.visualstudio.com/t/Visual-Studio-link.exe-crashes-on-networ/10735424">https://developercommunity.visualstudio.com/t/Visual-Studio-link.exe-crashes-on-networ/10735424</link> ("Visual Studio link.exe crashes on network filesystem").</para>
  3188. +          </note>
  3189. +        </section>
  3190. +      </section>
  3191. +
  3192. +      <section xml:id="testing">
  3193. +        <title>Testing</title>
  3194. +        <para>See <filename>tests/manual_testing.txt</filename></para>
  3195. +      </section>
  3196. +    </section>
  3197. +  </section>
  3198. +
  3199. +  <section xml:id="mailinglist">
  3200. +    <title>Mailing list</title>
  3201. +    <para>Please direct any questions to <email>ms-nfs41-client-devel@lists.sourceforge.net</email>
  3202. +    (list <link xl:href="https://sourceforge.net/p/ms-nfs41-client/mailman/ms-nfs41-client-devel/">archive</link>)</para>
  3203. +  </section>
  3204. +
  3205. +  <para>#EOF.</para>
  3206. +</article>
  3207. --
  3208. 2.45.1
  3209.  
  3210. From 3e258e53beceaf8ace696bf711c195d6701ee2df Mon Sep 17 00:00:00 2001
  3211. From: Roland Mainz <roland.mainz@nrubsig.org>
  3212. Date: Fri, 30 May 2025 14:07:24 +0200
  3213. Subject: [PATCH 2/5] daemon,libtirpc: Use types from <stdint.h> for XDR
  3214.  
  3215. Use types from <stdint.h> for XDR
  3216.  
  3217. Reported-by: Cedric Blancher <cedric.blancher@gmail.com>
  3218. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  3219. ---
  3220. daemon/callback_xdr.c          |  61 ++---
  3221.  daemon/nfs41_xdr.c             | 470 ++++++++++++++++-----------------
  3222.  daemon/nfs42_xdr.c             |  46 ++--
  3223.  libtirpc/libtirpc/libtirpc.def |  12 +
  3224.  libtirpc/src/xdr.c             | 190 ++++++++++---
  3225.  libtirpc/tirpc/rpc/types.h     |  19 +-
  3226.  libtirpc/tirpc/rpc/xdr.h       |   9 +
  3227.  7 files changed, 471 insertions(+), 336 deletions(-)
  3228.  
  3229. diff --git a/daemon/callback_xdr.c b/daemon/callback_xdr.c
  3230. index 7cf7132..7598db3 100644
  3231. --- a/daemon/callback_xdr.c
  3232. +++ b/daemon/callback_xdr.c
  3233. @@ -1,9 +1,10 @@
  3234.  /* NFSv4.1 client for Windows
  3235.   * Copyright (C) 2012 The Regents of the University of Michigan
  3236. - * Copyright (C) 2023-2025 Roland Mainz <roland.mainz@nrubsig.org>
  3237. + * Copyright (C) 2024-2025 Roland Mainz <roland.mainz@nrubsig.org>
  3238.   *
  3239.   * Olga Kornievskaia <aglo@umich.edu>
  3240.   * Casey Bodley <cbodley@umich.edu>
  3241. + * Roland Mainz <roland.mainz@nrubsig.org>
  3242.   *
  3243.   * This library is free software; you can redistribute it and/or modify it
  3244.   * under the terms of the GNU Lesser General Public License as published by
  3245. @@ -36,21 +37,21 @@ bool_t xdr_fattr4(XDR *xdr, fattr4 *fattr);
  3246.  
  3247.  static bool_t common_stateid(XDR *xdr, stateid4 *stateid)
  3248.  {
  3249. -    return xdr_u_int32_t(xdr, &stateid->seqid)
  3250. +    return xdr_uint32_t(xdr, &stateid->seqid)
  3251.          && xdr_opaque(xdr, (char*)stateid->other, NFS4_STATEID_OTHER);
  3252.  }
  3253.  
  3254.  static bool_t common_fh(XDR *xdr, nfs41_fh *fh)
  3255.  {
  3256. -    return xdr_u_int32_t(xdr, &fh->len)
  3257. +    return xdr_uint32_t(xdr, &fh->len)
  3258.          && fh->len <= NFS4_FHSIZE
  3259.          && xdr_opaque(xdr, (char*)fh->fh, fh->len);
  3260.  }
  3261.  
  3262.  static bool_t common_fsid(XDR *xdr, nfs41_fsid *fsid)
  3263.  {
  3264. -    return xdr_u_int64_t(xdr, &fsid->major)
  3265. -        && xdr_u_int64_t(xdr, &fsid->minor);
  3266. +    return xdr_uint64_t(xdr, &fsid->major)
  3267. +        && xdr_uint64_t(xdr, &fsid->minor);
  3268.  }
  3269.  
  3270.  static bool_t common_notify4(XDR *xdr, struct notify4 *notify)
  3271. @@ -67,10 +68,10 @@ static bool_t op_cb_layoutrecall_file(XDR *xdr, struct cb_recall_file *args)
  3272.      result = common_fh(xdr, &args->fh);
  3273.      if (!result) { CBX_ERR("layoutrecall_file.fh"); goto out; }
  3274.  
  3275. -    result = xdr_u_int64_t(xdr, &args->offset);
  3276. +    result = xdr_uint64_t(xdr, &args->offset);
  3277.      if (!result) { CBX_ERR("layoutrecall_file.offset"); goto out; }
  3278.  
  3279. -    result = xdr_u_int64_t(xdr, &args->length);
  3280. +    result = xdr_uint64_t(xdr, &args->length);
  3281.      if (!result) { CBX_ERR("layoutrecall_file.length"); goto out; }
  3282.  
  3283.      result = common_stateid(xdr, &args->stateid);
  3284. @@ -132,7 +133,7 @@ static bool_t op_cb_recall_slot_args(XDR *xdr, struct cb_recall_slot_args *res)
  3285.  {
  3286.      bool_t result;
  3287.  
  3288. -    result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
  3289. +    result = xdr_uint32_t(xdr, &res->target_highest_slotid);
  3290.      if (!result) { CBX_ERR("recall_slot.target_highest_slotid"); goto out; }
  3291.  out:
  3292.      return result;
  3293. @@ -154,10 +155,10 @@ static bool_t op_cb_sequence_ref(XDR *xdr, struct cb_sequence_ref *args)
  3294.  {
  3295.      bool_t result;
  3296.  
  3297. -    result = xdr_u_int32_t(xdr, &args->sequenceid);
  3298. +    result = xdr_uint32_t(xdr, &args->sequenceid);
  3299.      if (!result) { CBX_ERR("sequence_ref.sequenceid"); goto out; }
  3300.  
  3301. -    result = xdr_u_int32_t(xdr, &args->slotid);
  3302. +    result = xdr_uint32_t(xdr, &args->slotid);
  3303.      if (!result) { CBX_ERR("sequence_ref.slotid"); goto out; }
  3304.  out:
  3305.      return result;
  3306. @@ -184,13 +185,13 @@ static bool_t op_cb_sequence_args(XDR *xdr, struct cb_sequence_args *args)
  3307.      result = xdr_opaque(xdr, args->sessionid, NFS4_SESSIONID_SIZE);
  3308.      if (!result) { CBX_ERR("sequence_args.sessionid"); goto out; }
  3309.  
  3310. -    result = xdr_u_int32_t(xdr, &args->sequenceid);
  3311. +    result = xdr_uint32_t(xdr, &args->sequenceid);
  3312.      if (!result) { CBX_ERR("sequence_args.sequenceid"); goto out; }
  3313.  
  3314. -    result = xdr_u_int32_t(xdr, &args->slotid);
  3315. +    result = xdr_uint32_t(xdr, &args->slotid);
  3316.      if (!result) { CBX_ERR("sequence_args.slotid"); goto out; }
  3317.  
  3318. -    result = xdr_u_int32_t(xdr, &args->highest_slotid);
  3319. +    result = xdr_uint32_t(xdr, &args->highest_slotid);
  3320.      if (!result) { CBX_ERR("sequence_args.highest_slotid"); goto out; }
  3321.  
  3322.      result = xdr_bool(xdr, &args->cachethis);
  3323. @@ -211,16 +212,16 @@ static bool_t op_cb_sequence_res_ok(XDR *xdr, struct cb_sequence_res_ok *res)
  3324.      result = xdr_opaque(xdr, res->sessionid, NFS4_SESSIONID_SIZE);
  3325.      if (!result) { CBX_ERR("sequence_res.sessionid"); goto out; }
  3326.  
  3327. -    result = xdr_u_int32_t(xdr, &res->sequenceid);
  3328. +    result = xdr_uint32_t(xdr, &res->sequenceid);
  3329.      if (!result) { CBX_ERR("sequence_res.sequenceid"); goto out; }
  3330.  
  3331. -    result = xdr_u_int32_t(xdr, &res->slotid);
  3332. +    result = xdr_uint32_t(xdr, &res->slotid);
  3333.      if (!result) { CBX_ERR("sequence_res.slotid"); goto out; }
  3334.  
  3335. -    result = xdr_u_int32_t(xdr, &res->highest_slotid);
  3336. +    result = xdr_uint32_t(xdr, &res->highest_slotid);
  3337.      if (!result) { CBX_ERR("sequence_res.highest_slotid"); goto out; }
  3338.  
  3339. -    result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
  3340. +    result = xdr_uint32_t(xdr, &res->target_highest_slotid);
  3341.      if (!result) { CBX_ERR("sequence_res.target_highest_slotid"); goto out; }
  3342.  out:
  3343.      return result;
  3344. @@ -270,12 +271,12 @@ static bool_t info_to_fattr4(nfs41_file_info *info, fattr4 *fattr)
  3345.       * FIXME: What about |FATTR4_WORD1_SPACE_USED| ?
  3346.       */
  3347.      if (bitmap_isset(&info->attrmask, 0, FATTR4_WORD0_CHANGE)) {
  3348. -        result = xdr_u_hyper(&fattr_xdr, &info->change);
  3349. +        result = xdr_uint64_t(&fattr_xdr, &info->change);
  3350.          if (!result) { CBX_ERR("getattr.info.change"); goto out; }
  3351.          bitmap_set(&fattr->attrmask, 0, FATTR4_WORD0_CHANGE);
  3352.      }
  3353.      if (bitmap_isset(&info->attrmask, 0, FATTR4_WORD0_SIZE)) {
  3354. -        result = xdr_u_hyper(&fattr_xdr, &info->size);
  3355. +        result = xdr_uint64_t(&fattr_xdr, &info->size);
  3356.          if (!result) { CBX_ERR("getattr.info.size"); goto out; }
  3357.          bitmap_set(&fattr->attrmask, 0, FATTR4_WORD0_SIZE);
  3358.      }
  3359. @@ -336,7 +337,7 @@ static bool_t op_cb_notify_args(XDR *xdr, struct cb_notify_args *res)
  3360.  {
  3361.      bool_t result;
  3362.  
  3363. -    result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
  3364. +    result = xdr_uint32_t(xdr, &res->target_highest_slotid);
  3365.      if (!result) { CBX_ERR("notify.target_highest_slotid"); goto out; }
  3366.  out:
  3367.      return result;
  3368. @@ -357,7 +358,7 @@ static bool_t op_cb_push_deleg_args(XDR *xdr, struct cb_push_deleg_args *res)
  3369.  {
  3370.      bool_t result;
  3371.  
  3372. -    result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
  3373. +    result = xdr_uint32_t(xdr, &res->target_highest_slotid);
  3374.      if (!result) { CBX_ERR("push_deleg.target_highest_slotid"); goto out; }
  3375.  out:
  3376.      return result;
  3377. @@ -378,7 +379,7 @@ static bool_t op_cb_recall_any_args(XDR *xdr, struct cb_recall_any_args *res)
  3378.  {
  3379.      bool_t result;
  3380.  
  3381. -    result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
  3382. +    result = xdr_uint32_t(xdr, &res->target_highest_slotid);
  3383.      if (!result) { CBX_ERR("recall_any.target_highest_slotid"); goto out; }
  3384.  out:
  3385.      return result;
  3386. @@ -399,7 +400,7 @@ static bool_t op_cb_recallable_obj_avail_args(XDR *xdr, struct cb_recallable_obj
  3387.  {
  3388.      bool_t result;
  3389.  
  3390. -    result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
  3391. +    result = xdr_uint32_t(xdr, &res->target_highest_slotid);
  3392.      if (!result) { CBX_ERR("recallable_obj_avail.target_highest_slotid"); goto out; }
  3393.  out:
  3394.      return result;
  3395. @@ -420,7 +421,7 @@ static bool_t op_cb_wants_cancelled_args(XDR *xdr, struct cb_wants_cancelled_arg
  3396.  {
  3397.      bool_t result;
  3398.  
  3399. -    result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
  3400. +    result = xdr_uint32_t(xdr, &res->target_highest_slotid);
  3401.      if (!result) { CBX_ERR("wants_cancelled.target_highest_slotid"); goto out; }
  3402.  out:
  3403.      return result;
  3404. @@ -441,7 +442,7 @@ static bool_t op_cb_notify_lock_args(XDR *xdr, struct cb_notify_lock_args *res)
  3405.  {
  3406.      bool_t result;
  3407.  
  3408. -    result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
  3409. +    result = xdr_uint32_t(xdr, &res->target_highest_slotid);
  3410.      if (!result) { CBX_ERR("notify_lock.target_highest_slotid"); goto out; }
  3411.  out:
  3412.      return result;
  3413. @@ -462,7 +463,7 @@ static bool_t cb_notify_deviceid_change(XDR *xdr, struct notify_deviceid4 *chang
  3414.  {
  3415.      bool_t result;
  3416.  
  3417. -    result = xdr_u_int32_t(xdr, (uint32_t*)&change->layouttype);
  3418. +    result = xdr_uint32_t(xdr, (uint32_t*)&change->layouttype);
  3419.      if (!result) { CBX_ERR("notify_deviceid.change.layouttype"); goto out; }
  3420.  
  3421.      result = xdr_opaque(xdr, (char*)change->deviceid, PNFS_DEVICEID_SIZE);
  3422. @@ -478,7 +479,7 @@ static bool_t cb_notify_deviceid_delete(XDR *xdr, struct notify_deviceid4 *chang
  3423.  {
  3424.      bool_t result;
  3425.  
  3426. -    result = xdr_u_int32_t(xdr, (uint32_t*)&change->layouttype);
  3427. +    result = xdr_uint32_t(xdr, (uint32_t*)&change->layouttype);
  3428.      if (!result) { CBX_ERR("notify_deviceid.delete.layouttype"); goto out; }
  3429.  
  3430.      result = xdr_opaque(xdr, (char*)change->deviceid, PNFS_DEVICEID_SIZE);
  3431. @@ -559,7 +560,7 @@ out:
  3432.  /* CB_COMPOUND */
  3433.  static bool_t cb_compound_tag(XDR *xdr, struct cb_compound_tag *args)
  3434.  {
  3435. -    return xdr_u_int32_t(xdr, &args->len)
  3436. +    return xdr_uint32_t(xdr, &args->len)
  3437.          && args->len <= CB_COMPOUND_MAX_TAG
  3438.          && xdr_opaque(xdr, args->str, args->len);
  3439.  }
  3440. @@ -599,11 +600,11 @@ bool_t proc_cb_compound_args(XDR *xdr, struct cb_compound_args *args)
  3441.      result = cb_compound_tag(xdr, &args->tag);
  3442.      if (!result) { CBX_ERR("compound.tag"); goto out; }
  3443.  
  3444. -    result = xdr_u_int32_t(xdr, &args->minorversion);
  3445. +    result = xdr_uint32_t(xdr, &args->minorversion);
  3446.      if (!result) { CBX_ERR("compound.minorversion"); goto out; }
  3447.  
  3448.      /* "superfluous in NFSv4.1 and MUST be ignored by the client" */
  3449. -    result = xdr_u_int32_t(xdr, &args->callback_ident);
  3450. +    result = xdr_uint32_t(xdr, &args->callback_ident);
  3451.      if (!result) { CBX_ERR("compound.callback_ident"); goto out; }
  3452.  
  3453.      result = xdr_array(xdr, (char**)&args->argarray,
  3454. diff --git a/daemon/nfs41_xdr.c b/daemon/nfs41_xdr.c
  3455. index 927bfe8..e1a20ee 100644
  3456. --- a/daemon/nfs41_xdr.c
  3457. +++ b/daemon/nfs41_xdr.c
  3458. @@ -60,15 +60,15 @@ bool_t xdr_bitmap4(
  3459.                  BITMAP4_MAXCOUNT);
  3460.              return FALSE;
  3461.          }
  3462. -        if (!xdr_u_int32_t(xdr, &bitmap->count))
  3463. +        if (!xdr_uint32_t(xdr, &bitmap->count))
  3464.              return FALSE;
  3465.  
  3466.          for (i = 0; i < bitmap->count; i++)
  3467. -            if (!xdr_u_int32_t(xdr, &bitmap->arr[i]))
  3468. +            if (!xdr_uint32_t(xdr, &bitmap->arr[i]))
  3469.                  return FALSE;
  3470.  
  3471.      } else if (xdr->x_op == XDR_DECODE) {
  3472. -        if (!xdr_u_int32_t(xdr, &bitmap->count))
  3473. +        if (!xdr_uint32_t(xdr, &bitmap->count))
  3474.              return FALSE;
  3475.          if (bitmap->count > BITMAP4_MAXCOUNT) {
  3476.              eprintf("decode_bitmap4: count (%d) must be <= %d\n",
  3477. @@ -78,9 +78,9 @@ bool_t xdr_bitmap4(
  3478.          }
  3479.  
  3480.          for (i = 0; i < bitmap->count; i++)
  3481. -            if (!xdr_u_int32_t(xdr, &bitmap->arr[i]))
  3482. +            if (!xdr_uint32_t(xdr, &bitmap->arr[i]))
  3483.                  return FALSE;
  3484. -    } else
  3485. +    } else
  3486.          return FALSE;
  3487.  
  3488.      return TRUE;
  3489. @@ -91,10 +91,10 @@ static bool_t xdr_nfstime4(
  3490.      XDR *xdr,
  3491.      nfstime4 *nt)
  3492.  {
  3493. -    if (!xdr_hyper(xdr, &nt->seconds))
  3494. +    if (!xdr_int64_t(xdr, &nt->seconds))
  3495.          return FALSE;
  3496.  
  3497. -    return xdr_u_int32_t(xdr, &nt->nseconds);
  3498. +    return xdr_uint32_t(xdr, &nt->nseconds);
  3499.  }
  3500.  
  3501.  
  3502. @@ -124,7 +124,7 @@ static bool_t xdr_settime4(
  3503.      if (xdr->x_op != XDR_ENCODE) /* not used for decode */
  3504.          return FALSE;
  3505.  
  3506. -    if (!xdr_u_int32_t(xdr, &how))
  3507. +    if (!xdr_uint32_t(xdr, &how))
  3508.          return FALSE;
  3509.  
  3510.      if (how == SET_TO_CLIENT_TIME4)
  3511. @@ -138,7 +138,7 @@ bool_t xdr_stateid4(
  3512.      XDR *xdr,
  3513.      stateid4 *si)
  3514.  {
  3515. -    if (!xdr_u_int32_t(xdr, &si->seqid))
  3516. +    if (!xdr_uint32_t(xdr, &si->seqid))
  3517.          return FALSE;
  3518.  
  3519.      return xdr_opaque(xdr, (char *)si->other, NFS4_STATEID_OTHER);
  3520. @@ -171,10 +171,10 @@ static bool_t xdr_fsid(
  3521.      XDR *xdr,
  3522.      nfs41_fsid *fsid)
  3523.  {
  3524. -    if (!xdr_u_hyper(xdr, &fsid->major))
  3525. +    if (!xdr_uint64_t(xdr, &fsid->major))
  3526.          return FALSE;
  3527.  
  3528. -    return xdr_u_hyper(xdr, &fsid->minor);
  3529. +    return xdr_uint64_t(xdr, &fsid->minor);
  3530.  }
  3531.  
  3532.  
  3533. @@ -213,10 +213,10 @@ static bool_t xdr_state_owner4(
  3534.       * client ID from the session ID of the SEQUENCE operation of the
  3535.       * COMPOUND request. */
  3536.      if (xdr->x_op == XDR_ENCODE) {
  3537. -        if (!xdr_u_hyper(xdr, &clientid)) /* clientid = 0 */
  3538. +        if (!xdr_uint64_t(xdr, &clientid)) /* clientid = 0 */
  3539.              return FALSE;
  3540.      } else if (xdr->x_op == XDR_DECODE) {
  3541. -        if (!xdr_u_hyper(xdr, &clientid))
  3542. +        if (!xdr_uint64_t(xdr, &clientid))
  3543.              return FALSE;
  3544.      } else return FALSE;
  3545.  
  3546. @@ -237,11 +237,11 @@ static bool_t xdr_layout_types(
  3547.  
  3548.      *layout_type = 0;
  3549.  
  3550. -    if (!xdr_u_int32_t(xdr, &count))
  3551. +    if (!xdr_uint32_t(xdr, &count))
  3552.          return FALSE;
  3553.  
  3554.      for (i = 0; i < count; i++) {
  3555. -        if (!xdr_u_int32_t(xdr, &type))
  3556. +        if (!xdr_uint32_t(xdr, &type))
  3557.              return FALSE;
  3558.  
  3559.          *layout_type |= 1 << (type - 1);
  3560. @@ -255,23 +255,23 @@ static bool_t xdr_threshold_item(
  3561.  {
  3562.      bitmap4 bitmap;
  3563.  
  3564. -    if (!xdr_u_int32_t(xdr, &item->type))
  3565. +    if (!xdr_uint32_t(xdr, &item->type))
  3566.          return FALSE;
  3567.  
  3568.      if (!xdr_bitmap4(xdr, &bitmap))
  3569.          return FALSE;
  3570.  
  3571. -    if (!xdr_u_int32_t(xdr, &bitmap.count))
  3572. +    if (!xdr_uint32_t(xdr, &bitmap.count))
  3573.          return FALSE;
  3574.  
  3575.      if (bitmap.count) {
  3576. -        if (bitmap.arr[0] & 0x1 && !xdr_u_hyper(xdr, &item->hints[0]))
  3577. +        if (bitmap.arr[0] & 0x1 && !xdr_uint64_t(xdr, &item->hints[0]))
  3578.              return FALSE;
  3579. -        if (bitmap.arr[0] & 0x2 && !xdr_u_hyper(xdr, &item->hints[1]))
  3580. +        if (bitmap.arr[0] & 0x2 && !xdr_uint64_t(xdr, &item->hints[1]))
  3581.              return FALSE;
  3582. -        if (bitmap.arr[0] & 0x4 && !xdr_u_hyper(xdr, &item->hints[2]))
  3583. +        if (bitmap.arr[0] & 0x4 && !xdr_uint64_t(xdr, &item->hints[2]))
  3584.              return FALSE;
  3585. -        if (bitmap.arr[0] & 0x8 && !xdr_u_hyper(xdr, &item->hints[3]))
  3586. +        if (bitmap.arr[0] & 0x8 && !xdr_uint64_t(xdr, &item->hints[3]))
  3587.              return FALSE;
  3588.      }
  3589.      return TRUE;
  3590. @@ -283,7 +283,7 @@ static bool_t xdr_mdsthreshold(
  3591.  {
  3592.      uint32_t i;
  3593.  
  3594. -    if (!xdr_u_int32_t(xdr, &mdsthreshold->count))
  3595. +    if (!xdr_uint32_t(xdr, &mdsthreshold->count))
  3596.          return FALSE;
  3597.  
  3598.      if (mdsthreshold->count > MAX_MDSTHRESHOLD_ITEMS)
  3599. @@ -301,13 +301,13 @@ static bool_t xdr_nfsace4(
  3600.  {
  3601.      char *who = ace->who;
  3602.  
  3603. -    if (!xdr_u_int32_t(xdr, &ace->acetype))
  3604. +    if (!xdr_uint32_t(xdr, &ace->acetype))
  3605.          return FALSE;
  3606.  
  3607. -    if (!xdr_u_int32_t(xdr, &ace->aceflag))
  3608. +    if (!xdr_uint32_t(xdr, &ace->aceflag))
  3609.          return FALSE;
  3610.  
  3611. -    if (!xdr_u_int32_t(xdr, &ace->acemask))
  3612. +    if (!xdr_uint32_t(xdr, &ace->acemask))
  3613.          return FALSE;
  3614.  
  3615.      /* 'who' is a static array, so don't try to free it */
  3616. @@ -321,7 +321,7 @@ static bool_t xdr_nfsdacl41(
  3617.      XDR *xdr,
  3618.      nfsacl41 *acl)
  3619.  {
  3620. -    if (!xdr_u_int32_t(xdr, &acl->flag))
  3621. +    if (!xdr_uint32_t(xdr, &acl->flag))
  3622.          return FALSE;
  3623.  
  3624.      return xdr_array(xdr, (char**)&acl->aces, &acl->count,
  3625. @@ -352,7 +352,7 @@ static bool_t decode_pathname4(
  3626.      u_int32_t i, count, len, remaining;
  3627.  
  3628.      /* decode the number of components */
  3629. -    if (!xdr_u_int32_t(xdr, &count))
  3630. +    if (!xdr_uint32_t(xdr, &count))
  3631.          return FALSE;
  3632.  
  3633.      pos = (char *)path->path;
  3634. @@ -387,7 +387,7 @@ static bool_t decode_fs_location4(
  3635.      u_int32_t i, count, len;
  3636.  
  3637.      /* decode the number of servers */
  3638. -    if (!xdr_u_int32_t(xdr, &count))
  3639. +    if (!xdr_uint32_t(xdr, &count))
  3640.          return FALSE;
  3641.  
  3642.      /* allocate the fs_location_server array */
  3643. @@ -430,7 +430,7 @@ static bool_t decode_fs_locations4(
  3644.      if (!decode_pathname4(xdr, &locations->path))
  3645.          return FALSE;
  3646.  
  3647. -    if (!xdr_u_int32_t(xdr, &count))
  3648. +    if (!xdr_uint32_t(xdr, &count))
  3649.          return FALSE;
  3650.  
  3651.      /* allocate the fs_location array */
  3652. @@ -498,10 +498,10 @@ static bool_t encode_ssv_sp_parms4(
  3653.          &spp->ssp_encr_algs_len, NFS4_OPAQUE_LIMIT))
  3654.          return FALSE;
  3655.  
  3656. -    if (!xdr_u_int32_t(xdr, &spp->ssp_window))
  3657. +    if (!xdr_uint32_t(xdr, &spp->ssp_window))
  3658.          return FALSE;
  3659.  
  3660. -    return xdr_u_int32_t(xdr, &spp->ssp_num_gss_handles);
  3661. +    return xdr_uint32_t(xdr, &spp->ssp_num_gss_handles);
  3662.  }
  3663.  #endif
  3664.  
  3665. @@ -511,7 +511,7 @@ static bool_t xdr_state_protect4_a(
  3666.  {
  3667.      bool_t result = TRUE;
  3668.  
  3669. -    if (!xdr_u_int32_t(xdr, (u_int32_t *)&spa->spa_how))
  3670. +    if (!xdr_uint32_t(xdr, (u_int32_t *)&spa->spa_how))
  3671.          return FALSE;
  3672.  
  3673.      switch (spa->spa_how)
  3674. @@ -567,7 +567,7 @@ static bool_t encode_op_exchange_id(
  3675.      if (!xdr_client_owner4(xdr, args->eia_clientowner))
  3676.          return FALSE;
  3677.  
  3678. -    if (!xdr_u_int32_t(xdr, &args->eia_flags))
  3679. +    if (!xdr_uint32_t(xdr, &args->eia_flags))
  3680.          return FALSE;
  3681.  
  3682.      if (!xdr_state_protect4_a(xdr, &args->eia_state_protect))
  3683. @@ -575,12 +575,12 @@ static bool_t encode_op_exchange_id(
  3684.  
  3685.      if (args->eia_client_impl_id)
  3686.      {
  3687. -        if (!xdr_u_int32_t(xdr, &one))
  3688. +        if (!xdr_uint32_t(xdr, &one))
  3689.              return FALSE;
  3690.          return xdr_nfs_impl_id4(xdr, args->eia_client_impl_id);
  3691.      }
  3692.      else
  3693. -        return xdr_u_int32_t(xdr, &zero);
  3694. +        return xdr_uint32_t(xdr, &zero);
  3695.  }
  3696.  
  3697.  #if 0
  3698. @@ -604,22 +604,22 @@ static bool_t decode_ssv_prot_info4(
  3699.      if (!decode_state_protect_ops4(xdr, &spi->spi_ops))
  3700.          return FALSE;
  3701.  
  3702. -    if (!xdr_u_int32_t(xdr, &spi->spi_hash_alg))
  3703. +    if (!xdr_uint32_t(xdr, &spi->spi_hash_alg))
  3704.          return FALSE;
  3705.  
  3706. -    if (!xdr_u_int32_t(xdr, &spi->spi_encr_alg))
  3707. +    if (!xdr_uint32_t(xdr, &spi->spi_encr_alg))
  3708.          return FALSE;
  3709.  
  3710. -    if (!xdr_u_int32_t(xdr, &spi->spi_ssv_len))
  3711. +    if (!xdr_uint32_t(xdr, &spi->spi_ssv_len))
  3712.          return FALSE;
  3713.  
  3714. -    if (!xdr_u_int32_t(xdr, &spi->spi_window))
  3715. +    if (!xdr_uint32_t(xdr, &spi->spi_window))
  3716.          return FALSE;
  3717.  
  3718.  /* TODO: spi->spi_handles */
  3719. -    return xdr_u_int32_t(xdr, 0);
  3720. +    return xdr_uint32_t(xdr, 0);
  3721.      /*
  3722. -    if (!xdr_u_int32_t(xdr, &spi->spi_handles.count))
  3723. +    if (!xdr_uint32_t(xdr, &spi->spi_handles.count))
  3724.          return FALSE;
  3725.  
  3726.      for (i = 0; i < spi->spi_handles.count; i++)
  3727. @@ -636,7 +636,7 @@ static bool_t xdr_state_protect4_r(
  3728.  {
  3729.      bool_t result = TRUE;
  3730.  
  3731. -    if (!xdr_u_int32_t(xdr, (uint32_t *)&spr->spr_how))
  3732. +    if (!xdr_uint32_t(xdr, (uint32_t *)&spr->spr_how))
  3733.          return FALSE;
  3734.  
  3735.      switch (spr->spr_how)
  3736. @@ -666,7 +666,7 @@ static bool_t xdr_server_owner4(
  3737.  {
  3738.      char *so_major_id = so->so_major_id;
  3739.  
  3740. -    if (!xdr_u_hyper(xdr, &so->so_minor_id))
  3741. +    if (!xdr_uint64_t(xdr, &so->so_minor_id))
  3742.          return FALSE;
  3743.  
  3744.      return xdr_bytes(xdr, (char **)&so_major_id,
  3745. @@ -683,19 +683,19 @@ static bool_t decode_op_exchange_id(
  3746.      if (unexpected_op(resop->op, OP_EXCHANGE_ID))
  3747.          return FALSE;
  3748.  
  3749. -    if (!xdr_u_int32_t(xdr, &res->status))
  3750. +    if (!xdr_uint32_t(xdr, &res->status))
  3751.          return FALSE;
  3752.  
  3753.      if (res->status != NFS4_OK)
  3754.          return TRUE;
  3755.  
  3756. -    if (!xdr_u_hyper(xdr, &res->clientid))
  3757. +    if (!xdr_uint64_t(xdr, &res->clientid))
  3758.          return FALSE;
  3759.  
  3760. -    if (!xdr_u_int32_t(xdr, &res->sequenceid))
  3761. +    if (!xdr_uint32_t(xdr, &res->sequenceid))
  3762.          return FALSE;
  3763.  
  3764. -    if (!xdr_u_int32_t(xdr, &res->flags))
  3765. +    if (!xdr_uint32_t(xdr, &res->flags))
  3766.          return FALSE;
  3767.  
  3768.      if (!xdr_state_protect4_r(xdr, &res->state_protect))
  3769. @@ -719,51 +719,51 @@ static bool_t xdr_channel_attrs4(
  3770.      uint32_t one = 1;
  3771.  
  3772.      /* count4 ca_headerpadsize */
  3773. -    if (!xdr_u_int32_t(xdr, &attrs->ca_headerpadsize))
  3774. +    if (!xdr_uint32_t(xdr, &attrs->ca_headerpadsize))
  3775.          return FALSE;
  3776.  
  3777.      /* count4 ca_maxrequestsize */
  3778. -    if (!xdr_u_int32_t(xdr, &attrs->ca_maxrequestsize))
  3779. +    if (!xdr_uint32_t(xdr, &attrs->ca_maxrequestsize))
  3780.          return FALSE;
  3781.  
  3782.      /* count4 ca_maxresponsesize */
  3783. -    if (!xdr_u_int32_t(xdr, &attrs->ca_maxresponsesize))
  3784. +    if (!xdr_uint32_t(xdr, &attrs->ca_maxresponsesize))
  3785.          return FALSE;
  3786.  
  3787.      /* count4 ca_maxresponsesize_cached */
  3788. -    if (!xdr_u_int32_t(xdr, &attrs->ca_maxresponsesize_cached))
  3789. +    if (!xdr_uint32_t(xdr, &attrs->ca_maxresponsesize_cached))
  3790.          return FALSE;
  3791.  
  3792.      /* count4 ca_maxoperations */
  3793. -    if (!xdr_u_int32_t(xdr, &attrs->ca_maxoperations))
  3794. +    if (!xdr_uint32_t(xdr, &attrs->ca_maxoperations))
  3795.          return FALSE;
  3796.  
  3797.      /* count4 ca_maxrequests */
  3798. -    if (!xdr_u_int32_t(xdr, &attrs->ca_maxrequests))
  3799. +    if (!xdr_uint32_t(xdr, &attrs->ca_maxrequests))
  3800.          return FALSE;
  3801.  
  3802.      if (xdr->x_op == XDR_ENCODE) {
  3803.          /* uint32_t ca_rdma_ird<1> */
  3804.          if (attrs->ca_rdma_ird)
  3805.          {
  3806. -            if (!xdr_u_int32_t(xdr, &one))
  3807. +            if (!xdr_uint32_t(xdr, &one))
  3808.                  return FALSE;
  3809. -            return xdr_u_int32_t(xdr, attrs->ca_rdma_ird);
  3810. +            return xdr_uint32_t(xdr, attrs->ca_rdma_ird);
  3811.          }
  3812.          else {
  3813. -            return xdr_u_int32_t(xdr, &zero);
  3814. +            return xdr_uint32_t(xdr, &zero);
  3815.          }
  3816.      }
  3817.      else if (xdr->x_op == XDR_DECODE) {
  3818.  #if 0
  3819.          u_int32_t count;
  3820.          /* uint32_t ca_rdma_ird<1> */
  3821. -        if (!xdr_u_int32_t(xdr, &count))
  3822. +        if (!xdr_uint32_t(xdr, &count))
  3823.              return FALSE;
  3824.          if (count > 1)
  3825.              return FALSE;
  3826.          if (count)
  3827. -            return xdr_u_int32_t(xdr, attrs->ca_rdma_ird);
  3828. +            return xdr_uint32_t(xdr, attrs->ca_rdma_ird);
  3829.          else
  3830.  #endif
  3831.              return TRUE;
  3832. @@ -781,18 +781,18 @@ static bool_t encode_backchannel_sec_parms(
  3833.  {
  3834.      uint32_t zero = 0;
  3835.  
  3836. -    if (!xdr_u_int32_t(xdr, &args->type))
  3837. +    if (!xdr_uint32_t(xdr, &args->type))
  3838.          return FALSE;
  3839.  
  3840.      switch (args->type)  {
  3841.      case AUTH_NONE: return TRUE;
  3842.      case AUTH_SYS:
  3843. -        if (!xdr_u_int32_t(xdr, &args->u.auth_sys.stamp))
  3844. +        if (!xdr_uint32_t(xdr, &args->u.auth_sys.stamp))
  3845.              return FALSE;
  3846.          if (!xdr_string(xdr, &args->u.auth_sys.machinename, NI_MAXHOST))
  3847.              return FALSE;
  3848. -        return xdr_u_int32_t(xdr, &zero) && xdr_u_int32_t(xdr, &zero) &&
  3849. -                xdr_u_int32_t(xdr, &zero);
  3850. +        return xdr_uint32_t(xdr, &zero) && xdr_uint32_t(xdr, &zero) &&
  3851. +                xdr_uint32_t(xdr, &zero);
  3852.      case RPCSEC_GSS:
  3853.      default:
  3854.          return FALSE;
  3855. @@ -811,15 +811,15 @@ static bool_t encode_op_create_session(
  3856.          return FALSE;
  3857.  
  3858.      /* clientid4 csa_clientid */
  3859. -    if (!xdr_u_hyper(xdr, &args->csa_clientid))
  3860. +    if (!xdr_uint64_t(xdr, &args->csa_clientid))
  3861.          return FALSE;
  3862.  
  3863.      /* sequenceid4 csa_sequence */
  3864. -    if (!xdr_u_int32_t(xdr, &args->csa_sequence))
  3865. +    if (!xdr_uint32_t(xdr, &args->csa_sequence))
  3866.          return FALSE;
  3867.  
  3868.      /* TODO: uint32_t csa_flags = 0 */
  3869. -    if (!xdr_u_int32_t(xdr, &args->csa_flags))
  3870. +    if (!xdr_uint32_t(xdr, &args->csa_flags))
  3871.          return FALSE;
  3872.  
  3873.      /* channel_attrs4 csa_fore_chan_attrs */
  3874. @@ -831,7 +831,7 @@ static bool_t encode_op_create_session(
  3875.          return FALSE;
  3876.  
  3877.      /* TODO: uint32_t csa_cb_program = 1234 */
  3878. -    if (!xdr_u_int32_t(xdr, &args->csa_cb_program))
  3879. +    if (!xdr_uint32_t(xdr, &args->csa_cb_program))
  3880.          return FALSE;
  3881.  
  3882.      return xdr_array(xdr, (char **)&cb_secparams, &cb_count,
  3883. @@ -848,7 +848,7 @@ static bool_t decode_op_create_session(
  3884.      if (unexpected_op(resop->op, OP_CREATE_SESSION))
  3885.          return FALSE;
  3886.  
  3887. -    if (!xdr_u_int32_t(xdr, &opstatus))
  3888. +    if (!xdr_uint32_t(xdr, &opstatus))
  3889.          return FALSE;
  3890.  
  3891.      if (opstatus != NFS4_OK)
  3892. @@ -858,11 +858,11 @@ static bool_t decode_op_create_session(
  3893.          return FALSE;
  3894.  
  3895.      /* sequenceid4 csr_sequence */
  3896. -    if (!xdr_u_int32_t(xdr, &res->csr_sequence))
  3897. +    if (!xdr_uint32_t(xdr, &res->csr_sequence))
  3898.          return FALSE;
  3899.  
  3900.      /* uint32_t csr_flags */
  3901. -    if (!xdr_u_int32_t(xdr, &res->csr_flags))
  3902. +    if (!xdr_uint32_t(xdr, &res->csr_flags))
  3903.          return FALSE;
  3904.  
  3905.      /* channel_attrs4 csr_fore_chan_attrs */
  3906. @@ -895,7 +895,7 @@ static bool_t encode_op_bind_conn_to_session(
  3907.      if (!xdr_enum(xdr, (enum_t *)&args->dir))
  3908.          return FALSE;
  3909.  
  3910. -    return xdr_u_int32_t(xdr, &zero); /* bctsa_use_conn_in_rdma_mode = false */
  3911. +    return xdr_uint32_t(xdr, &zero); /* bctsa_use_conn_in_rdma_mode = false */
  3912.  }
  3913.  
  3914.  static bool_t decode_op_bind_conn_to_session(
  3915. @@ -950,7 +950,7 @@ static bool_t decode_op_destroy_session(
  3916.      if (unexpected_op(resop->op, OP_DESTROY_SESSION))
  3917.          return FALSE;
  3918.  
  3919. -    return xdr_u_int32_t(xdr, &res->dsr_status);
  3920. +    return xdr_uint32_t(xdr, &res->dsr_status);
  3921.  }
  3922.  
  3923.  /*
  3924. @@ -965,7 +965,7 @@ static bool_t encode_op_destroy_clientid(
  3925.      if (unexpected_op(argop->op, OP_DESTROY_CLIENTID))
  3926.          return FALSE;
  3927.  
  3928. -    return xdr_u_hyper(xdr, &args->dca_clientid);
  3929. +    return xdr_uint64_t(xdr, &args->dca_clientid);
  3930.  }
  3931.  
  3932.  static bool_t decode_op_destroy_clientid(
  3933. @@ -977,7 +977,7 @@ static bool_t decode_op_destroy_clientid(
  3934.      if (unexpected_op(resop->op, OP_DESTROY_CLIENTID))
  3935.          return FALSE;
  3936.  
  3937. -    return xdr_u_int32_t(xdr, &res->dcr_status);
  3938. +    return xdr_uint32_t(xdr, &res->dcr_status);
  3939.  }
  3940.  
  3941.  
  3942. @@ -996,13 +996,13 @@ static bool_t encode_op_sequence(
  3943.      if (!xdr_opaque(xdr, (char *)args->sa_sessionid, NFS4_SESSIONID_SIZE))
  3944.          return FALSE;
  3945.  
  3946. -    if (!xdr_u_int32_t(xdr, &args->sa_sequenceid))
  3947. +    if (!xdr_uint32_t(xdr, &args->sa_sequenceid))
  3948.          return FALSE;
  3949.  
  3950. -    if (!xdr_u_int32_t(xdr, &args->sa_slotid))
  3951. +    if (!xdr_uint32_t(xdr, &args->sa_slotid))
  3952.          return FALSE;
  3953.  
  3954. -    if (!xdr_u_int32_t(xdr, &args->sa_highest_slotid))
  3955. +    if (!xdr_uint32_t(xdr, &args->sa_highest_slotid))
  3956.          return FALSE;
  3957.  
  3958.      return xdr_bool(xdr, &args->sa_cachethis);
  3959. @@ -1015,19 +1015,19 @@ static bool_t xdr_sequence_res_ok(
  3960.      if (!xdr_opaque(xdr, (char *)res->sr_sessionid, NFS4_SESSIONID_SIZE))
  3961.          return FALSE;
  3962.  
  3963. -    if (!xdr_u_int32_t(xdr, &res->sr_sequenceid))
  3964. +    if (!xdr_uint32_t(xdr, &res->sr_sequenceid))
  3965.          return FALSE;
  3966.  
  3967. -    if (!xdr_u_int32_t(xdr, &res->sr_slotid))
  3968. +    if (!xdr_uint32_t(xdr, &res->sr_slotid))
  3969.          return FALSE;
  3970.  
  3971. -    if (!xdr_u_int32_t(xdr, &res->sr_highest_slotid))
  3972. +    if (!xdr_uint32_t(xdr, &res->sr_highest_slotid))
  3973.          return FALSE;
  3974.  
  3975. -    if (!xdr_u_int32_t(xdr, &res->sr_target_highest_slotid))
  3976. +    if (!xdr_uint32_t(xdr, &res->sr_target_highest_slotid))
  3977.          return FALSE;
  3978.  
  3979. -    return xdr_u_int32_t(xdr, &res->sr_status_flags);
  3980. +    return xdr_uint32_t(xdr, &res->sr_status_flags);
  3981.  }
  3982.  
  3983.  static bool_t decode_op_sequence(
  3984. @@ -1039,7 +1039,7 @@ static bool_t decode_op_sequence(
  3985.      if (unexpected_op(resop->op, OP_SEQUENCE))
  3986.          return FALSE;
  3987.  
  3988. -    if (!xdr_u_int32_t(xdr, &res->sr_status))
  3989. +    if (!xdr_uint32_t(xdr, &res->sr_status))
  3990.          return FALSE;
  3991.  
  3992.      if (res->sr_status == NFS4_OK)
  3993. @@ -1102,7 +1102,7 @@ static bool_t decode_op_putfh(
  3994.      if (unexpected_op(resop->op, OP_PUTFH))
  3995.          return FALSE;
  3996.  
  3997. -    return xdr_u_int32_t(xdr, &res->status);
  3998. +    return xdr_uint32_t(xdr, &res->status);
  3999.  }
  4000.  
  4001.  
  4002. @@ -1128,7 +1128,7 @@ static bool_t decode_op_putpubfh(
  4003.      if (unexpected_op(resop->op, OP_PUTPUBFH))
  4004.          return FALSE;
  4005.  
  4006. -    return xdr_u_int32_t(xdr, &res->status);
  4007. +    return xdr_uint32_t(xdr, &res->status);
  4008.  }
  4009.  
  4010.  
  4011. @@ -1154,7 +1154,7 @@ static bool_t decode_op_putrootfh(
  4012.      if (unexpected_op(resop->op, OP_PUTROOTFH))
  4013.          return FALSE;
  4014.  
  4015. -    return xdr_u_int32_t(xdr, &res->status);
  4016. +    return xdr_uint32_t(xdr, &res->status);
  4017.  }
  4018.  
  4019.  
  4020. @@ -1181,7 +1181,7 @@ static bool_t decode_op_getfh(
  4021.      if (unexpected_op(resop->op, OP_GETFH))
  4022.          return FALSE;
  4023.  
  4024. -    if (!xdr_u_int32_t(xdr, &res->status))
  4025. +    if (!xdr_uint32_t(xdr, &res->status))
  4026.          return FALSE;
  4027.  
  4028.      if (res->status == NFS4_OK)
  4029. @@ -1215,7 +1215,7 @@ static bool_t decode_op_lookup(
  4030.      if (unexpected_op(resop->op, OP_LOOKUP))
  4031.          return FALSE;
  4032.  
  4033. -    return xdr_u_int32_t(xdr, &res->status);
  4034. +    return xdr_uint32_t(xdr, &res->status);
  4035.  }
  4036.  
  4037.  
  4038. @@ -1231,7 +1231,7 @@ static bool_t encode_op_access(
  4039.      if (unexpected_op(argop->op, OP_ACCESS))
  4040.          return FALSE;
  4041.  
  4042. -    return xdr_u_int32_t(xdr, &args->access);
  4043. +    return xdr_uint32_t(xdr, &args->access);
  4044.  }
  4045.  
  4046.  static bool_t decode_op_access(
  4047. @@ -1243,15 +1243,15 @@ static bool_t decode_op_access(
  4048.      if (unexpected_op(resop->op, OP_ACCESS))
  4049.          return FALSE;
  4050.  
  4051. -    if (!xdr_u_int32_t(xdr, &res->status))
  4052. +    if (!xdr_uint32_t(xdr, &res->status))
  4053.          return FALSE;
  4054.  
  4055.      if (res->status == NFS4_OK)
  4056.      {
  4057. -        if (!xdr_u_int32_t(xdr, &res->supported))
  4058. +        if (!xdr_uint32_t(xdr, &res->supported))
  4059.              return FALSE;
  4060.  
  4061. -        return xdr_u_int32_t(xdr, &res->access);
  4062. +        return xdr_uint32_t(xdr, &res->access);
  4063.      }
  4064.      return TRUE;
  4065.  }
  4066. @@ -1270,7 +1270,7 @@ static bool_t encode_op_close(
  4067.      if (unexpected_op(argop->op, OP_CLOSE))
  4068.          return FALSE;
  4069.  
  4070. -    if (!xdr_u_int32_t(xdr, &zero)) // This should be ignored by server
  4071. +    if (!xdr_uint32_t(xdr, &zero)) // This should be ignored by server
  4072.          return FALSE;
  4073.  
  4074.      return xdr_stateid4(xdr, &args->stateid->stateid);
  4075. @@ -1286,7 +1286,7 @@ static bool_t decode_op_close(
  4076.      if (unexpected_op(resop->op, OP_CLOSE))
  4077.          return FALSE;
  4078.  
  4079. -    if (!xdr_u_int32_t(xdr, &res->status))
  4080. +    if (!xdr_uint32_t(xdr, &res->status))
  4081.          return FALSE;
  4082.  
  4083.      if (res->status == NFS4_OK)
  4084. @@ -1308,10 +1308,10 @@ static bool_t encode_op_commit(
  4085.      if (unexpected_op(argop->op, OP_COMMIT))
  4086.          return FALSE;
  4087.  
  4088. -    if (!xdr_u_hyper(xdr, &args->offset))
  4089. +    if (!xdr_uint64_t(xdr, &args->offset))
  4090.          return FALSE;
  4091.  
  4092. -    return xdr_u_int32_t(xdr, &args->count);
  4093. +    return xdr_uint32_t(xdr, &args->count);
  4094.  }
  4095.  
  4096.  static bool_t decode_op_commit(
  4097. @@ -1323,7 +1323,7 @@ static bool_t decode_op_commit(
  4098.      if (unexpected_op(resop->op, OP_COMMIT))
  4099.          return FALSE;
  4100.  
  4101. -    if (!xdr_u_int32_t(xdr, &res->status))
  4102. +    if (!xdr_uint32_t(xdr, &res->status))
  4103.          return FALSE;
  4104.  
  4105.      if (res->status == NFS4_OK)
  4106. @@ -1343,7 +1343,7 @@ static bool_t encode_createtype4(
  4107.      bool_t result = TRUE;
  4108.      const char *linkdata;
  4109.  
  4110. -    if (!xdr_u_int32_t(xdr, &ct->type))
  4111. +    if (!xdr_uint32_t(xdr, &ct->type))
  4112.          return FALSE;
  4113.  
  4114.      switch (ct->type)
  4115. @@ -1355,9 +1355,9 @@ static bool_t encode_createtype4(
  4116.          break;
  4117.      case NF4BLK:
  4118.      case NF4CHR:
  4119. -        result = xdr_u_int32_t(xdr, &ct->u.devdata.specdata1);
  4120. +        result = xdr_uint32_t(xdr, &ct->u.devdata.specdata1);
  4121.          if (result == TRUE)
  4122. -            result = xdr_u_int32_t(xdr, &ct->u.devdata.specdata2);
  4123. +            result = xdr_uint32_t(xdr, &ct->u.devdata.specdata2);
  4124.          break;
  4125.      default:
  4126.          // Some types need no further action
  4127. @@ -1405,10 +1405,10 @@ static bool_t xdr_change_info4(
  4128.      if (!xdr_bool(xdr, &cinfo->atomic))
  4129.          return FALSE;
  4130.  
  4131. -    if (!xdr_u_hyper(xdr, &cinfo->before))
  4132. +    if (!xdr_uint64_t(xdr, &cinfo->before))
  4133.          return FALSE;
  4134.  
  4135. -    return xdr_u_hyper(xdr, &cinfo->after);
  4136. +    return xdr_uint64_t(xdr, &cinfo->after);
  4137.  }
  4138.  
  4139.  static bool_t decode_op_create(
  4140. @@ -1420,7 +1420,7 @@ static bool_t decode_op_create(
  4141.      if (unexpected_op(resop->op, OP_CREATE))
  4142.          return FALSE;
  4143.  
  4144. -    if (!xdr_u_int32_t(xdr, &res->status))
  4145. +    if (!xdr_uint32_t(xdr, &res->status))
  4146.          return FALSE;
  4147.  
  4148.      if (res->status == NFS4_OK)
  4149. @@ -1457,7 +1457,7 @@ static bool_t decode_op_link(
  4150.      if (unexpected_op(resop->op, OP_LINK))
  4151.          return FALSE;
  4152.  
  4153. -    if (!xdr_u_int32_t(xdr, &res->status))
  4154. +    if (!xdr_uint32_t(xdr, &res->status))
  4155.          return FALSE;
  4156.  
  4157.      if (res->status == NFS4_OK)
  4158. @@ -1485,13 +1485,13 @@ static bool_t xdr_locker4(
  4159.  
  4160.      if (locker->new_lock_owner) {
  4161.          /* open_to_lock_owner4 open_owner */
  4162. -        if (!xdr_u_int32_t(xdr, &locker->u.open_owner.open_seqid))
  4163. +        if (!xdr_uint32_t(xdr, &locker->u.open_owner.open_seqid))
  4164.              return FALSE;
  4165.  
  4166.          if (!xdr_stateid4(xdr, &locker->u.open_owner.open_stateid->stateid))
  4167.              return FALSE;
  4168.  
  4169. -        if (!xdr_u_int32_t(xdr, &locker->u.open_owner.lock_seqid))
  4170. +        if (!xdr_uint32_t(xdr, &locker->u.open_owner.lock_seqid))
  4171.              return FALSE;
  4172.  
  4173.          return xdr_state_owner4(xdr, locker->u.open_owner.lock_owner);
  4174. @@ -1500,7 +1500,7 @@ static bool_t xdr_locker4(
  4175.          if (!xdr_stateid4(xdr, &locker->u.lock_owner.lock_stateid->stateid))
  4176.              return FALSE;
  4177.  
  4178. -        return xdr_u_int32_t(xdr, &locker->u.lock_owner.lock_seqid);
  4179. +        return xdr_uint32_t(xdr, &locker->u.lock_owner.lock_seqid);
  4180.      }
  4181.  }
  4182.  
  4183. @@ -1513,16 +1513,16 @@ static bool_t encode_op_lock(
  4184.      if (unexpected_op(argop->op, OP_LOCK))
  4185.          return FALSE;
  4186.  
  4187. -    if (!xdr_u_int32_t(xdr, &args->locktype))
  4188. +    if (!xdr_uint32_t(xdr, &args->locktype))
  4189.          return FALSE;
  4190.  
  4191.      if (!xdr_bool(xdr, &args->reclaim))
  4192.          return FALSE;
  4193.  
  4194. -    if (!xdr_u_hyper(xdr, &args->offset))
  4195. +    if (!xdr_uint64_t(xdr, &args->offset))
  4196.          return FALSE;
  4197.  
  4198. -    if (!xdr_u_hyper(xdr, &args->length))
  4199. +    if (!xdr_uint64_t(xdr, &args->length))
  4200.          return FALSE;
  4201.  
  4202.      return xdr_locker4(xdr, &args->locker);
  4203. @@ -1532,13 +1532,13 @@ static bool_t decode_lock_res_denied(
  4204.      XDR *xdr,
  4205.      lock_res_denied *denied)
  4206.  {
  4207. -    if (!xdr_u_hyper(xdr, &denied->offset))
  4208. +    if (!xdr_uint64_t(xdr, &denied->offset))
  4209.          return FALSE;
  4210.  
  4211. -    if (!xdr_u_hyper(xdr, &denied->length))
  4212. +    if (!xdr_uint64_t(xdr, &denied->length))
  4213.          return FALSE;
  4214.  
  4215. -    if (!xdr_u_int32_t(xdr, &denied->locktype))
  4216. +    if (!xdr_uint32_t(xdr, &denied->locktype))
  4217.          return FALSE;
  4218.  
  4219.      return xdr_state_owner4(xdr, &denied->owner);
  4220. @@ -1553,7 +1553,7 @@ static bool_t decode_op_lock(
  4221.      if (unexpected_op(resop->op, OP_LOCK))
  4222.          return FALSE;
  4223.  
  4224. -    if (!xdr_u_int32_t(xdr, &res->status))
  4225. +    if (!xdr_uint32_t(xdr, &res->status))
  4226.          return FALSE;
  4227.  
  4228.      switch (res->status) {
  4229. @@ -1583,13 +1583,13 @@ static bool_t encode_op_lockt(
  4230.      if (unexpected_op(argop->op, OP_LOCKT))
  4231.          return FALSE;
  4232.  
  4233. -    if (!xdr_u_int32_t(xdr, &args->locktype))
  4234. +    if (!xdr_uint32_t(xdr, &args->locktype))
  4235.          return FALSE;
  4236.  
  4237. -    if (!xdr_u_hyper(xdr, &args->offset))
  4238. +    if (!xdr_uint64_t(xdr, &args->offset))
  4239.          return FALSE;
  4240.  
  4241. -    if (!xdr_u_hyper(xdr, &args->length))
  4242. +    if (!xdr_uint64_t(xdr, &args->length))
  4243.          return FALSE;
  4244.  
  4245.      return xdr_state_owner4(xdr, args->owner);
  4246. @@ -1604,7 +1604,7 @@ static bool_t decode_op_lockt(
  4247.      if (unexpected_op(resop->op, OP_LOCKT))
  4248.          return FALSE;
  4249.  
  4250. -    if (!xdr_u_int32_t(xdr, &res->status))
  4251. +    if (!xdr_uint32_t(xdr, &res->status))
  4252.          return FALSE;
  4253.  
  4254.      if (res->status == NFS4ERR_DENIED)
  4255. @@ -1626,19 +1626,19 @@ static bool_t encode_op_locku(
  4256.      if (unexpected_op(argop->op, OP_LOCKU))
  4257.          return FALSE;
  4258.  
  4259. -    if (!xdr_u_int32_t(xdr, &args->locktype))
  4260. +    if (!xdr_uint32_t(xdr, &args->locktype))
  4261.          return FALSE;
  4262.  
  4263. -    if (!xdr_u_int32_t(xdr, &args->seqid))
  4264. +    if (!xdr_uint32_t(xdr, &args->seqid))
  4265.          return FALSE;
  4266.  
  4267.      if (!xdr_stateid4(xdr, &args->lock_stateid->stateid))
  4268.          return FALSE;
  4269.  
  4270. -    if (!xdr_u_hyper(xdr, &args->offset))
  4271. +    if (!xdr_uint64_t(xdr, &args->offset))
  4272.          return FALSE;
  4273.  
  4274. -    return xdr_u_hyper(xdr, &args->length);
  4275. +    return xdr_uint64_t(xdr, &args->length);
  4276.  }
  4277.  
  4278.  static bool_t decode_op_locku(
  4279. @@ -1650,7 +1650,7 @@ static bool_t decode_op_locku(
  4280.      if (unexpected_op(resop->op, OP_LOCKU))
  4281.          return FALSE;
  4282.  
  4283. -    if (!xdr_u_int32_t(xdr, &res->status))
  4284. +    if (!xdr_uint32_t(xdr, &res->status))
  4285.          return FALSE;
  4286.  
  4287.      if (res->status == NFS4_OK)
  4288. @@ -1674,7 +1674,7 @@ static bool_t encode_op_delegpurge(
  4289.  
  4290.      /* The client SHOULD set the client field to zero,
  4291.       * and the server MUST ignore the clientid field. */
  4292. -    return xdr_u_int64_t(xdr, &zero);
  4293. +    return xdr_uint64_t(xdr, &zero);
  4294.  }
  4295.  
  4296.  static bool_t decode_op_delegpurge(
  4297. @@ -1686,7 +1686,7 @@ static bool_t decode_op_delegpurge(
  4298.      if (unexpected_op(resop->op, OP_DELEGPURGE))
  4299.          return FALSE;
  4300.  
  4301. -    return xdr_u_int32_t(xdr, &res->status);
  4302. +    return xdr_uint32_t(xdr, &res->status);
  4303.  }
  4304.  
  4305.  
  4306. @@ -1714,7 +1714,7 @@ static bool_t decode_op_delegreturn(
  4307.      if (unexpected_op(resop->op, OP_DELEGRETURN))
  4308.          return FALSE;
  4309.  
  4310. -    return xdr_u_int32_t(xdr, &res->status);
  4311. +    return xdr_uint32_t(xdr, &res->status);
  4312.  }
  4313.  
  4314.  
  4315. @@ -1744,15 +1744,15 @@ static bool_t decode_file_attrs(
  4316.                  return FALSE;
  4317.          }
  4318.          if (attrs->attrmask.arr[0] & FATTR4_WORD0_TYPE) {
  4319. -            if (!xdr_u_int32_t(xdr, &info->type))
  4320. +            if (!xdr_uint32_t(xdr, &info->type))
  4321.                  return FALSE;
  4322.          }
  4323.          if (attrs->attrmask.arr[0] & FATTR4_WORD0_CHANGE) {
  4324. -            if (!xdr_u_hyper(xdr, &info->change))
  4325. +            if (!xdr_uint64_t(xdr, &info->change))
  4326.                  return FALSE;
  4327.          }
  4328.          if (attrs->attrmask.arr[0] & FATTR4_WORD0_SIZE) {
  4329. -            if (!xdr_u_hyper(xdr, &info->size))
  4330. +            if (!xdr_uint64_t(xdr, &info->size))
  4331.                  return FALSE;
  4332.          }
  4333.          if (attrs->attrmask.arr[0] & FATTR4_WORD0_LINK_SUPPORT) {
  4334. @@ -1768,11 +1768,11 @@ static bool_t decode_file_attrs(
  4335.                  return FALSE;
  4336.          }
  4337.          if (attrs->attrmask.arr[0] & FATTR4_WORD0_LEASE_TIME) {
  4338. -            if (!xdr_u_int32_t(xdr, &info->lease_time))
  4339. +            if (!xdr_uint32_t(xdr, &info->lease_time))
  4340.                  return FALSE;
  4341.          }
  4342.          if (attrs->attrmask.arr[0] & FATTR4_WORD0_RDATTR_ERROR) {
  4343. -            if (!xdr_u_int32_t(xdr, &info->rdattr_error))
  4344. +            if (!xdr_uint32_t(xdr, &info->rdattr_error))
  4345.                  return FALSE;
  4346.          }
  4347.          if (attrs->attrmask.arr[0] & FATTR4_WORD0_ACL) {
  4348. @@ -1782,7 +1782,7 @@ static bool_t decode_file_attrs(
  4349.                  return FALSE;
  4350.          }
  4351.          if (attrs->attrmask.arr[0] & FATTR4_WORD0_ACLSUPPORT) {
  4352. -            if (!xdr_u_int32_t(xdr, &info->aclsupport))
  4353. +            if (!xdr_uint32_t(xdr, &info->aclsupport))
  4354.                  return FALSE;
  4355.          }
  4356.          if (attrs->attrmask.arr[0] & FATTR4_WORD0_ARCHIVE) {
  4357. @@ -1802,7 +1802,7 @@ static bool_t decode_file_attrs(
  4358.                  return FALSE;
  4359.          }
  4360.          if (attrs->attrmask.arr[0] & FATTR4_WORD0_FILEID) {
  4361. -            if (!xdr_u_hyper(xdr, &info->fileid))
  4362. +            if (!xdr_uint64_t(xdr, &info->fileid))
  4363.                  return FALSE;
  4364.          }
  4365.          if (attrs->attrmask.arr[0] & FATTR4_WORD0_FS_LOCATIONS) {
  4366. @@ -1814,21 +1814,21 @@ static bool_t decode_file_attrs(
  4367.                  return FALSE;
  4368.          }
  4369.          if (attrs->attrmask.arr[0] & FATTR4_WORD0_MAXREAD) {
  4370. -            if (!xdr_u_hyper(xdr, &info->maxread))
  4371. +            if (!xdr_uint64_t(xdr, &info->maxread))
  4372.                  return FALSE;
  4373.          }
  4374.          if (attrs->attrmask.arr[0] & FATTR4_WORD0_MAXWRITE) {
  4375. -            if (!xdr_u_hyper(xdr, &info->maxwrite))
  4376. +            if (!xdr_uint64_t(xdr, &info->maxwrite))
  4377.                  return FALSE;
  4378.          }
  4379.      }
  4380.      if (attrs->attrmask.count > 1) {
  4381.          if (attrs->attrmask.arr[1] & FATTR4_WORD1_MODE) {
  4382. -            if (!xdr_u_int32_t(xdr, &info->mode))
  4383. +            if (!xdr_uint32_t(xdr, &info->mode))
  4384.                  return FALSE;
  4385.          }
  4386.          if (attrs->attrmask.arr[1] & FATTR4_WORD1_NUMLINKS) {
  4387. -            if (!xdr_u_int32_t(xdr, &info->numlinks))
  4388. +            if (!xdr_uint32_t(xdr, &info->numlinks))
  4389.                  return FALSE;
  4390.          }
  4391.          if (attrs->attrmask.arr[1] & FATTR4_WORD1_OWNER) {
  4392. @@ -1864,19 +1864,19 @@ static bool_t decode_file_attrs(
  4393.              EASSERT(info->owner_group[0] != '\0');
  4394.          }
  4395.          if (attrs->attrmask.arr[1] & FATTR4_WORD1_SPACE_AVAIL) {
  4396. -            if (!xdr_u_hyper(xdr, &info->space_avail))
  4397. +            if (!xdr_uint64_t(xdr, &info->space_avail))
  4398.                  return FALSE;
  4399.          }
  4400.          if (attrs->attrmask.arr[1] & FATTR4_WORD1_SPACE_FREE) {
  4401. -            if (!xdr_u_hyper(xdr, &info->space_free))
  4402. +            if (!xdr_uint64_t(xdr, &info->space_free))
  4403.                  return FALSE;
  4404.          }
  4405.          if (attrs->attrmask.arr[1] & FATTR4_WORD1_SPACE_TOTAL) {
  4406. -            if (!xdr_u_hyper(xdr, &info->space_total))
  4407. +            if (!xdr_uint64_t(xdr, &info->space_total))
  4408.                  return FALSE;
  4409.          }
  4410.          if (attrs->attrmask.arr[1] & FATTR4_WORD1_SPACE_USED) {
  4411. -            if (!xdr_u_hyper(xdr, &info->space_used))
  4412. +            if (!xdr_uint64_t(xdr, &info->space_used))
  4413.                  return FALSE;
  4414.          }
  4415.          if (attrs->attrmask.arr[1] & FATTR4_WORD1_SYSTEM) {
  4416. @@ -1918,7 +1918,7 @@ static bool_t decode_file_attrs(
  4417.                  return FALSE;
  4418.          }
  4419.          if (attrs->attrmask.arr[2] & FATTR4_WORD2_CLONE_BLKSIZE) {
  4420. -            if (!xdr_u_int32_t(xdr, &info->clone_blksize))
  4421. +            if (!xdr_uint32_t(xdr, &info->clone_blksize))
  4422.                  return FALSE;
  4423.          }
  4424.      }
  4425. @@ -1934,7 +1934,7 @@ static bool_t decode_op_getattr(
  4426.      if (unexpected_op(resop->op, OP_GETATTR))
  4427.          return FALSE;
  4428.  
  4429. -    if (!xdr_u_int32_t(xdr, &res->status))
  4430. +    if (!xdr_uint32_t(xdr, &res->status))
  4431.          return FALSE;
  4432.  
  4433.      if (res->status == NFS4_OK)
  4434. @@ -1959,7 +1959,7 @@ static bool_t encode_createhow4(
  4435.  {
  4436.      bool_t result = TRUE;
  4437.  
  4438. -    if (!xdr_u_int32_t(xdr, &ch->mode))
  4439. +    if (!xdr_uint32_t(xdr, &ch->mode))
  4440.          return FALSE;
  4441.  
  4442.      switch (ch->mode)
  4443. @@ -1987,7 +1987,7 @@ static bool_t encode_openflag4(
  4444.  {
  4445.      bool_t result = TRUE;
  4446.  
  4447. -    if (!xdr_u_int32_t(xdr, &of->opentype))
  4448. +    if (!xdr_uint32_t(xdr, &of->opentype))
  4449.          return FALSE;
  4450.  
  4451.      switch (of->opentype)
  4452. @@ -2015,7 +2015,7 @@ static bool_t encode_open_claim4(
  4453.      XDR *xdr,
  4454.      open_claim4 *oc)
  4455.  {
  4456. -    if (!xdr_u_int32_t(xdr, &oc->claim))
  4457. +    if (!xdr_uint32_t(xdr, &oc->claim))
  4458.          return FALSE;
  4459.  
  4460.      switch (oc->claim)
  4461. @@ -2023,7 +2023,7 @@ static bool_t encode_open_claim4(
  4462.      case CLAIM_NULL:
  4463.          return encode_component(xdr, oc->u.null.filename);
  4464.      case CLAIM_PREVIOUS:
  4465. -        return xdr_u_int32_t(xdr, &oc->u.prev.delegate_type);
  4466. +        return xdr_uint32_t(xdr, &oc->u.prev.delegate_type);
  4467.      case CLAIM_FH:
  4468.          return TRUE; /* use current file handle */
  4469.      case CLAIM_DELEGATE_CUR:
  4470. @@ -2053,13 +2053,13 @@ static bool_t encode_op_open(
  4471.      if (unexpected_op(argop->op, OP_OPEN))
  4472.          return FALSE;
  4473.  
  4474. -    if (!xdr_u_int32_t(xdr, &args->seqid))
  4475. +    if (!xdr_uint32_t(xdr, &args->seqid))
  4476.          return FALSE;
  4477.  
  4478. -    if (!xdr_u_int32_t(xdr, &args->share_access))
  4479. +    if (!xdr_uint32_t(xdr, &args->share_access))
  4480.          return FALSE;
  4481.  
  4482. -    if (!xdr_u_int32_t(xdr, &args->share_deny))
  4483. +    if (!xdr_uint32_t(xdr, &args->share_deny))
  4484.          return FALSE;
  4485.  
  4486.      if (!xdr_state_owner4(xdr, args->owner))
  4487. @@ -2110,10 +2110,10 @@ static bool_t decode_modified_limit4(
  4488.  {
  4489.      uint32_t blocks, bytes_per_block;
  4490.  
  4491. -    if (!xdr_u_int32_t(xdr, &blocks))
  4492. +    if (!xdr_uint32_t(xdr, &blocks))
  4493.          return FALSE;
  4494.  
  4495. -    if (!xdr_u_int32_t(xdr, &bytes_per_block))
  4496. +    if (!xdr_uint32_t(xdr, &bytes_per_block))
  4497.          return FALSE;
  4498.  
  4499.      *filesize = (uint64_t)blocks * bytes_per_block;
  4500. @@ -2131,13 +2131,13 @@ static bool_t decode_space_limit4(
  4501.  {
  4502.      uint32_t limitby;
  4503.  
  4504. -    if (!xdr_u_int32_t(xdr, &limitby))
  4505. +    if (!xdr_uint32_t(xdr, &limitby))
  4506.          return FALSE;
  4507.  
  4508.      switch (limitby)
  4509.      {
  4510.      case NFS_LIMIT_SIZE:
  4511. -        return xdr_u_hyper(xdr, filesize);
  4512. +        return xdr_uint64_t(xdr, filesize);
  4513.      case NFS_LIMIT_BLOCKS:
  4514.          return decode_modified_limit4(xdr, filesize);
  4515.      default:
  4516. @@ -2174,7 +2174,7 @@ static bool_t decode_open_res_ok(
  4517.      if (!xdr_change_info4(xdr, &res->cinfo))
  4518.          return FALSE;
  4519.  
  4520. -    if (!xdr_u_int32_t(xdr, &res->rflags))
  4521. +    if (!xdr_uint32_t(xdr, &res->rflags))
  4522.          return FALSE;
  4523.  
  4524.      if (!xdr_bitmap4(xdr, &res->attrset))
  4525. @@ -2209,7 +2209,7 @@ static bool_t decode_op_open(
  4526.      if (unexpected_op(resop->op, OP_OPEN))
  4527.          return FALSE;
  4528.  
  4529. -    if (!xdr_u_int32_t(xdr, &res->status))
  4530. +    if (!xdr_uint32_t(xdr, &res->status))
  4531.          return FALSE;
  4532.  
  4533.      if (res->status == NFS4_OK)
  4534. @@ -2243,7 +2243,7 @@ static bool_t decode_op_openattr(
  4535.      if (unexpected_op(resop->op, OP_OPENATTR))
  4536.          return FALSE;
  4537.  
  4538. -    return xdr_u_int32_t(xdr, &res->status);
  4539. +    return xdr_uint32_t(xdr, &res->status);
  4540.  }
  4541.  
  4542.  
  4543. @@ -2262,10 +2262,10 @@ static bool_t encode_op_read(
  4544.      if (!xdr_stateid4(xdr, &args->stateid->stateid))
  4545.          return FALSE;
  4546.  
  4547. -    if (!xdr_u_hyper(xdr, &args->offset))
  4548. +    if (!xdr_uint64_t(xdr, &args->offset))
  4549.          return FALSE;
  4550.  
  4551. -    return xdr_u_int32_t(xdr, &args->count);
  4552. +    return xdr_uint32_t(xdr, &args->count);
  4553.  }
  4554.  
  4555.  static bool_t decode_read_res_ok(
  4556. @@ -2279,7 +2279,7 @@ static bool_t decode_read_res_ok(
  4557.      if (!xdr_bool(xdr, &res->eof))
  4558.          return FALSE;
  4559.  
  4560. -    if (!xdr_u_int32_t(xdr, &count)) {
  4561. +    if (!xdr_uint32_t(xdr, &count)) {
  4562.          DPRINTF(0, ("decode_read_res_ok: decoding 'count' failed\n"));
  4563.          return FALSE;
  4564.      }
  4565. @@ -2310,7 +2310,7 @@ static bool_t decode_op_read(
  4566.      if (unexpected_op(resop->op, OP_READ))
  4567.          return FALSE;
  4568.  
  4569. -    if (!xdr_u_int32_t(xdr, &res->status))
  4570. +    if (!xdr_uint32_t(xdr, &res->status))
  4571.          return FALSE;
  4572.  
  4573.      if (res->status == NFS4_OK)
  4574. @@ -2332,16 +2332,16 @@ static bool_t encode_op_readdir(
  4575.      if (unexpected_op(argop->op, OP_READDIR))
  4576.          return FALSE;
  4577.  
  4578. -    if (!xdr_u_hyper(xdr, &args->cookie.cookie))
  4579. +    if (!xdr_uint64_t(xdr, &args->cookie.cookie))
  4580.          return FALSE;
  4581.  
  4582.      if (!xdr_opaque(xdr, (char *)args->cookie.verf, NFS4_VERIFIER_SIZE))
  4583.          return FALSE;
  4584.  
  4585. -    if (!xdr_u_int32_t(xdr, &args->dircount))
  4586. +    if (!xdr_uint32_t(xdr, &args->dircount))
  4587.          return FALSE;
  4588.  
  4589. -    if (!xdr_u_int32_t(xdr, &args->maxcount))
  4590. +    if (!xdr_uint32_t(xdr, &args->maxcount))
  4591.          return FALSE;
  4592.  
  4593.      return xdr_bitmap4(xdr, args->attr_request);
  4594. @@ -2372,7 +2372,7 @@ static bool_t decode_readdir_entry(
  4595.      entry_len = (uint32_t)FIELD_OFFSET(nfs41_readdir_entry, name);
  4596.      attrs.attr_vals_len = NFS4_OPAQUE_LIMIT;
  4597.  
  4598. -    if (!xdr_u_hyper(xdr, &cookie))
  4599. +    if (!xdr_uint64_t(xdr, &cookie))
  4600.          return FALSE;
  4601.  
  4602.      if (!xdr_bytes(xdr, (char **)&nameptr, &name_len, NFS4_OPAQUE_LIMIT))
  4603. @@ -2464,7 +2464,7 @@ static bool_t decode_op_readdir(
  4604.      if (unexpected_op(resop->op, OP_READDIR))
  4605.          return FALSE;
  4606.  
  4607. -    if (!xdr_u_int32_t(xdr, &res->status))
  4608. +    if (!xdr_uint32_t(xdr, &res->status))
  4609.          return FALSE;
  4610.  
  4611.      if (res->status == NFS4_OK) {
  4612. @@ -2499,7 +2499,7 @@ static bool_t decode_op_readlink(
  4613.      if (unexpected_op(resop->op, OP_READLINK))
  4614.          return FALSE;
  4615.  
  4616. -    if (!xdr_u_int32_t(xdr, &res->status))
  4617. +    if (!xdr_uint32_t(xdr, &res->status))
  4618.          return FALSE;
  4619.  
  4620.      if (res->status == NFS4_OK) {
  4621. @@ -2535,7 +2535,7 @@ static bool_t decode_op_remove(
  4622.      if (unexpected_op(resop->op, OP_REMOVE))
  4623.          return FALSE;
  4624.  
  4625. -    if (!xdr_u_int32_t(xdr, &res->status))
  4626. +    if (!xdr_uint32_t(xdr, &res->status))
  4627.          return FALSE;
  4628.  
  4629.      if (res->status == NFS4_OK)
  4630. @@ -2572,7 +2572,7 @@ static bool_t decode_op_rename(
  4631.      if (unexpected_op(resop->op, OP_RENAME))
  4632.          return FALSE;
  4633.  
  4634. -    if (!xdr_u_int32_t(xdr, &res->status))
  4635. +    if (!xdr_uint32_t(xdr, &res->status))
  4636.          return FALSE;
  4637.  
  4638.      if (res->status == NFS4_OK)
  4639. @@ -2608,7 +2608,7 @@ static bool_t decode_op_restorefh(
  4640.      if (unexpected_op(resop->op, OP_RESTOREFH))
  4641.          return FALSE;
  4642.  
  4643. -    return xdr_u_int32_t(xdr, &res->status);
  4644. +    return xdr_uint32_t(xdr, &res->status);
  4645.  }
  4646.  
  4647.  
  4648. @@ -2635,7 +2635,7 @@ static bool_t decode_op_savefh(
  4649.      if (unexpected_op(resop->op, OP_SAVEFH))
  4650.          return FALSE;
  4651.  
  4652. -    return xdr_u_int32_t(xdr, &res->status);
  4653. +    return xdr_uint32_t(xdr, &res->status);
  4654.  }
  4655.  
  4656.  
  4657. @@ -2657,7 +2657,7 @@ static bool_t encode_file_attrs(
  4658.  
  4659.      if (info->attrmask.count > 0) {
  4660.          if (info->attrmask.arr[0] & FATTR4_WORD0_SIZE) {
  4661. -            if (!xdr_u_hyper(&localxdr, &info->size))
  4662. +            if (!xdr_uint64_t(&localxdr, &info->size))
  4663.                  return FALSE;
  4664.              attrs->attrmask.arr[0] |= FATTR4_WORD0_SIZE;
  4665.          }
  4666. @@ -2679,7 +2679,7 @@ static bool_t encode_file_attrs(
  4667.      }
  4668.      if (info->attrmask.count > 1) {
  4669.          if (info->attrmask.arr[1] & FATTR4_WORD1_MODE) {
  4670. -            if (!xdr_u_int32_t(&localxdr, &info->mode))
  4671. +            if (!xdr_uint32_t(&localxdr, &info->mode))
  4672.                  return FALSE;
  4673.              attrs->attrmask.arr[1] |= FATTR4_WORD1_MODE;
  4674.          }
  4675. @@ -2722,9 +2722,9 @@ static bool_t encode_file_attrs(
  4676.      }
  4677.      if (info->attrmask.count > 2) {
  4678.          if (info->attrmask.arr[2] & FATTR4_WORD2_MODE_SET_MASKED) {
  4679. -            if (!xdr_u_int32_t(&localxdr, &info->mode))
  4680. +            if (!xdr_uint32_t(&localxdr, &info->mode))
  4681.                  return FALSE;
  4682. -            if (!xdr_u_int32_t(&localxdr, &info->mode_mask))
  4683. +            if (!xdr_uint32_t(&localxdr, &info->mode_mask))
  4684.                  return FALSE;
  4685.              attrs->attrmask.arr[2] |= FATTR4_WORD2_MODE_SET_MASKED;
  4686.          }
  4687. @@ -2771,7 +2771,7 @@ static bool_t decode_op_setattr(
  4688.      if (unexpected_op(resop->op, OP_SETATTR))
  4689.          return FALSE;
  4690.  
  4691. -    if (!xdr_u_int32_t(xdr, &res->status))
  4692. +    if (!xdr_uint32_t(xdr, &res->status))
  4693.          return FALSE;
  4694.  
  4695.      if (res->status == NFS4_OK)
  4696. @@ -2793,14 +2793,14 @@ static bool_t encode_op_want_delegation(
  4697.      if (unexpected_op(argop->op, OP_WANT_DELEGATION))
  4698.          return FALSE;
  4699.  
  4700. -    if (!xdr_u_int32_t(xdr, &args->want))
  4701. +    if (!xdr_uint32_t(xdr, &args->want))
  4702.          return FALSE;
  4703.  
  4704. -    if (!xdr_u_int32_t(xdr, &args->claim->claim))
  4705. +    if (!xdr_uint32_t(xdr, &args->claim->claim))
  4706.          return FALSE;
  4707.  
  4708.      return args->claim->claim != CLAIM_PREVIOUS ||
  4709. -        xdr_u_int32_t(xdr, &args->claim->prev_delegate_type);
  4710. +        xdr_uint32_t(xdr, &args->claim->prev_delegate_type);
  4711.  }
  4712.  
  4713.  static bool_t decode_op_want_delegation(
  4714. @@ -2812,7 +2812,7 @@ static bool_t decode_op_want_delegation(
  4715.      if (unexpected_op(resop->op, OP_WANT_DELEGATION))
  4716.          return FALSE;
  4717.  
  4718. -    if (!xdr_u_int32_t(xdr, &res->status))
  4719. +    if (!xdr_uint32_t(xdr, &res->status))
  4720.          return FALSE;
  4721.  
  4722.      if (res->status)
  4723. @@ -2863,7 +2863,7 @@ static bool_t decode_op_free_stateid(
  4724.      if (unexpected_op(resop->op, OP_FREE_STATEID))
  4725.          return FALSE;
  4726.  
  4727. -    return xdr_u_int32_t(xdr, &res->status);
  4728. +    return xdr_uint32_t(xdr, &res->status);
  4729.  }
  4730.  
  4731.  
  4732. @@ -2892,12 +2892,12 @@ static bool_t decode_op_test_stateid(
  4733.      if (unexpected_op(resop->op, OP_TEST_STATEID))
  4734.          return FALSE;
  4735.  
  4736. -    if (!xdr_u_int32_t(xdr, &res->status))
  4737. +    if (!xdr_uint32_t(xdr, &res->status))
  4738.          return FALSE;
  4739.  
  4740.      if (res->status == NFS4_OK) {
  4741.          return xdr_array(xdr, (char**)&res->resok.status, &res->resok.count,
  4742. -            res->resok.count, sizeof(uint32_t), (xdrproc_t)xdr_u_int32_t);
  4743. +            res->resok.count, sizeof(uint32_t), (xdrproc_t)xdr_uint32_t);
  4744.      }
  4745.      return TRUE;
  4746.  }
  4747. @@ -2919,13 +2919,13 @@ static bool_t encode_op_write(
  4748.      if (!xdr_stateid4(xdr, &args->stateid->stateid))
  4749.          return FALSE;
  4750.  
  4751. -    if (!xdr_u_hyper(xdr, &args->offset))
  4752. +    if (!xdr_uint64_t(xdr, &args->offset))
  4753.          return FALSE;
  4754.  
  4755. -    if (!xdr_u_int32_t(xdr, &args->stable))
  4756. +    if (!xdr_uint32_t(xdr, &args->stable))
  4757.          return FALSE;
  4758.  
  4759. -    if (!xdr_u_int32_t(xdr, &args->data_len))
  4760. +    if (!xdr_uint32_t(xdr, &args->data_len))
  4761.          return FALSE;
  4762.  
  4763.      return xdr_opaque(xdr, (char *)data, args->data_len);
  4764. @@ -2945,7 +2945,7 @@ static bool_t xdr_write_res_ok(
  4765.      XDR *xdr,
  4766.      nfs41_write_res_ok *res)
  4767.  {
  4768. -    if (!xdr_u_int32_t(xdr, &res->count))
  4769. +    if (!xdr_uint32_t(xdr, &res->count))
  4770.          return FALSE;
  4771.  
  4772.      return xdr_write_verf(xdr, res->verf);
  4773. @@ -2960,7 +2960,7 @@ static bool_t decode_op_write(
  4774.      if (unexpected_op(resop->op, OP_WRITE))
  4775.          return FALSE;
  4776.  
  4777. -    if (!xdr_u_int32_t(xdr, &res->status))
  4778. +    if (!xdr_uint32_t(xdr, &res->status))
  4779.          return FALSE;
  4780.  
  4781.      if (res->status == NFS4_OK)
  4782. @@ -2969,20 +2969,20 @@ static bool_t decode_op_write(
  4783.      return TRUE;
  4784.  }
  4785.  
  4786. -/*
  4787. +/*
  4788.   * OP_SECINFO_NO_NAME
  4789.   */
  4790.  static bool_t xdr_secinfo(
  4791.      XDR *xdr,
  4792.      nfs41_secinfo_info *secinfo)
  4793.  {
  4794. -    if (!xdr_u_int32_t(xdr, &secinfo->sec_flavor))
  4795. +    if (!xdr_uint32_t(xdr, &secinfo->sec_flavor))
  4796.          return FALSE;
  4797.      if (secinfo->sec_flavor == RPCSEC_GSS) {
  4798.          char *p = secinfo->oid;
  4799.          if (!xdr_bytes(xdr, (char **)&p, &secinfo->oid_len, MAX_OID_LEN))
  4800.              return FALSE;
  4801. -        if (!xdr_u_int32_t(xdr, &secinfo->qop))
  4802. +        if (!xdr_uint32_t(xdr, &secinfo->qop))
  4803.              return FALSE;
  4804.          if (!xdr_enum(xdr, (enum_t *)&secinfo->type))
  4805.              return FALSE;
  4806. @@ -3014,7 +3014,7 @@ static bool_t decode_op_secinfo_noname(
  4807.      if (unexpected_op(resop->op, OP_SECINFO_NO_NAME))
  4808.          return FALSE;
  4809.  
  4810. -    if (!xdr_u_int32_t(xdr, &res->status))
  4811. +    if (!xdr_uint32_t(xdr, &res->status))
  4812.          return FALSE;
  4813.  
  4814.      if (res->status == NFS4_OK)
  4815. @@ -3024,7 +3024,7 @@ static bool_t decode_op_secinfo_noname(
  4816.      return TRUE;
  4817.  }
  4818.  
  4819. -/*
  4820. +/*
  4821.   * OP_SECINFO
  4822.   */
  4823.  static bool_t encode_op_secinfo(
  4824. @@ -3052,7 +3052,7 @@ static bool_t decode_op_secinfo(
  4825.      if (unexpected_op(resop->op, OP_SECINFO))
  4826.          return FALSE;
  4827.  
  4828. -    if (!xdr_u_int32_t(xdr, &res->status))
  4829. +    if (!xdr_uint32_t(xdr, &res->status))
  4830.          return FALSE;
  4831.  
  4832.      if (res->status == NFS4_OK)
  4833. @@ -3079,7 +3079,7 @@ static bool_t encode_op_getdeviceinfo(
  4834.      if (!xdr_enum(xdr, (enum_t *)&args->layout_type))
  4835.          return FALSE;
  4836.  
  4837. -    if (!xdr_u_int32_t(xdr, &args->maxcount))
  4838. +    if (!xdr_uint32_t(xdr, &args->maxcount))
  4839.          return FALSE;
  4840.  
  4841.      return xdr_bitmap4(xdr, &args->notify_types);
  4842. @@ -3091,7 +3091,7 @@ static bool_t xdr_stripe_indices(
  4843.  {
  4844.      uint32_t i, count;
  4845.  
  4846. -    if (!xdr_u_int32_t(xdr, &count))
  4847. +    if (!xdr_uint32_t(xdr, &count))
  4848.          return FALSE;
  4849.  
  4850.      if (count && count != indices->count) {
  4851. @@ -3103,9 +3103,9 @@ static bool_t xdr_stripe_indices(
  4852.          ZeroMemory(indices->arr, count * sizeof(uint32_t));
  4853.          indices->count = count;
  4854.      }
  4855. -    
  4856. +
  4857.      for (i = 0; i < indices->count; i++) {
  4858. -        if (!xdr_u_int32_t(xdr, &indices->arr[i]))
  4859. +        if (!xdr_uint32_t(xdr, &indices->arr[i]))
  4860.              return FALSE;
  4861.      }
  4862.      return TRUE;
  4863. @@ -3153,7 +3153,7 @@ static bool_t xdr_multi_addr(
  4864.      netaddr4 dummy, *dest;
  4865.      uint32_t i;
  4866.  
  4867. -    if (!xdr_u_int32_t(xdr, &list->count))
  4868. +    if (!xdr_uint32_t(xdr, &list->count))
  4869.          return FALSE;
  4870.  
  4871.      for (i = 0; i < list->count; i++) {
  4872. @@ -3172,7 +3172,7 @@ static bool_t xdr_data_server_list(
  4873.  {
  4874.      uint32_t i, count;
  4875.  
  4876. -    if (!xdr_u_int32_t(xdr, &count))
  4877. +    if (!xdr_uint32_t(xdr, &count))
  4878.          return FALSE;
  4879.  
  4880.      if (count && count != servers->count) {
  4881. @@ -3183,7 +3183,7 @@ static bool_t xdr_data_server_list(
  4882.              servers->arr[i].client = NULL;
  4883.  
  4884.          tmp = realloc(servers->arr, count * sizeof(pnfs_data_server));
  4885. -        if (tmp == NULL)
  4886. +        if (tmp == NULL)
  4887.              return FALSE;
  4888.          servers->arr = tmp;
  4889.          ZeroMemory(servers->arr, count * sizeof(pnfs_data_server));
  4890. @@ -3221,7 +3221,7 @@ static bool_t decode_getdeviceinfo_ok(
  4891.      if (res_ok->device->device.type != PNFS_LAYOUTTYPE_FILE)
  4892.          return FALSE;
  4893.  
  4894. -    if (!xdr_u_int32_t(xdr, &len_ignored))
  4895. +    if (!xdr_uint32_t(xdr, &len_ignored))
  4896.          return FALSE;
  4897.  
  4898.      if (!xdr_file_device(xdr, res_ok->device))
  4899. @@ -3239,7 +3239,7 @@ static bool_t decode_op_getdeviceinfo(
  4900.      if (unexpected_op(resop->op, OP_GETDEVICEINFO))
  4901.          return FALSE;
  4902.  
  4903. -    if (!xdr_u_int32_t(xdr, (uint32_t *)&res->status))
  4904. +    if (!xdr_uint32_t(xdr, (uint32_t *)&res->status))
  4905.          return FALSE;
  4906.  
  4907.      switch (res->status) {
  4908. @@ -3249,7 +3249,7 @@ static bool_t decode_op_getdeviceinfo(
  4909.      case NFS4ERR_TOOSMALL:
  4910.          {
  4911.              uint32_t ignored;
  4912. -            return xdr_u_int32_t(xdr, &ignored);
  4913. +            return xdr_uint32_t(xdr, &ignored);
  4914.          }
  4915.          break;
  4916.      default:
  4917. @@ -3277,10 +3277,10 @@ static bool_t encode_op_layoutcommit(
  4918.      if (unexpected_op(argop->op, OP_LAYOUTCOMMIT))
  4919.          return FALSE;
  4920.  
  4921. -    if (!xdr_u_hyper(xdr, &args->offset))
  4922. +    if (!xdr_uint64_t(xdr, &args->offset))
  4923.          return FALSE;
  4924.  
  4925. -    if (!xdr_u_hyper(xdr, &args->length))
  4926. +    if (!xdr_uint64_t(xdr, &args->length))
  4927.          return FALSE;
  4928.  
  4929.      if (!xdr_bool(xdr, &false_bool)) /* loca_reclaim = 0 */
  4930. @@ -3294,7 +3294,7 @@ static bool_t encode_op_layoutcommit(
  4931.          if (!xdr_bool(xdr, &true_bool))
  4932.              return FALSE;
  4933.  
  4934. -        if (!xdr_u_hyper(xdr, args->new_offset))
  4935. +        if (!xdr_uint64_t(xdr, args->new_offset))
  4936.              return FALSE;
  4937.      } else {
  4938.          if (!xdr_bool(xdr, &false_bool))
  4939. @@ -3317,7 +3317,7 @@ static bool_t encode_op_layoutcommit(
  4940.      if (!xdr_enum(xdr, &pnfs_layout))
  4941.          return FALSE;
  4942.  
  4943. -    return xdr_u_int32_t(xdr, &zero);
  4944. +    return xdr_uint32_t(xdr, &zero);
  4945.  }
  4946.  
  4947.  static bool_t decode_op_layoutcommit(
  4948. @@ -3329,7 +3329,7 @@ static bool_t decode_op_layoutcommit(
  4949.      if (unexpected_op(resop->op, OP_LAYOUTCOMMIT))
  4950.          return FALSE;
  4951.  
  4952. -    if (!xdr_u_int32_t(xdr, &res->status))
  4953. +    if (!xdr_uint32_t(xdr, &res->status))
  4954.          return FALSE;
  4955.  
  4956.      if (res->status == NFS4_OK) {
  4957. @@ -3337,7 +3337,7 @@ static bool_t decode_op_layoutcommit(
  4958.              return FALSE;
  4959.  
  4960.          if (res->has_new_size)
  4961. -            if (!xdr_u_hyper(xdr, &res->new_size))
  4962. +            if (!xdr_uint64_t(xdr, &res->new_size))
  4963.                  return FALSE;
  4964.      }
  4965.      return TRUE;
  4966. @@ -3358,25 +3358,25 @@ static bool_t encode_op_layoutget(
  4967.      if (!xdr_bool(xdr, &args->signal_layout_avail))
  4968.          return FALSE;
  4969.  
  4970. -    if (!xdr_u_int32_t(xdr, (u_int32_t *)&args->layout_type))
  4971. +    if (!xdr_uint32_t(xdr, (u_int32_t *)&args->layout_type))
  4972.          return FALSE;
  4973.  
  4974. -    if (!xdr_u_int32_t(xdr, (u_int32_t *)&args->iomode))
  4975. +    if (!xdr_uint32_t(xdr, (u_int32_t *)&args->iomode))
  4976.          return FALSE;
  4977.  
  4978. -    if (!xdr_u_hyper(xdr, &args->offset))
  4979. +    if (!xdr_uint64_t(xdr, &args->offset))
  4980.          return FALSE;
  4981.  
  4982. -    if (!xdr_u_hyper(xdr, &args->length))
  4983. +    if (!xdr_uint64_t(xdr, &args->length))
  4984.          return FALSE;
  4985.  
  4986. -    if (!xdr_u_hyper(xdr, &args->minlength))
  4987. +    if (!xdr_uint64_t(xdr, &args->minlength))
  4988.          return FALSE;
  4989.  
  4990.      if (!xdr_stateid4(xdr, &args->stateid->stateid))
  4991.          return FALSE;
  4992.  
  4993. -    return xdr_u_int32_t(xdr, &args->maxcount);
  4994. +    return xdr_uint32_t(xdr, &args->maxcount);
  4995.  }
  4996.  
  4997.  static bool_t decode_file_layout_handles(
  4998. @@ -3385,7 +3385,7 @@ static bool_t decode_file_layout_handles(
  4999.  {
  5000.      uint32_t i, count;
  5001.  
  5002. -    if (!xdr_u_int32_t(xdr, &count))
  5003. +    if (!xdr_uint32_t(xdr, &count))
  5004.          return FALSE;
  5005.  
  5006.      if (count && count != handles->count) {
  5007. @@ -3397,7 +3397,7 @@ static bool_t decode_file_layout_handles(
  5008.          ZeroMemory(handles->arr, count * sizeof(nfs41_path_fh));
  5009.          handles->count = count;
  5010.      }
  5011. -    
  5012. +
  5013.      for (i = 0; i < handles->count; i++) {
  5014.          if (!xdr_fh(xdr, &handles->arr[i].fh))
  5015.              return FALSE;
  5016. @@ -3413,7 +3413,7 @@ static bool_t decode_file_layout(
  5017.      pnfs_file_layout *layout;
  5018.      u_int32_t len_ignored;
  5019.  
  5020. -    if (!xdr_u_int32_t(xdr, &len_ignored))
  5021. +    if (!xdr_uint32_t(xdr, &len_ignored))
  5022.          return FALSE;
  5023.  
  5024.      layout = calloc(1, sizeof(pnfs_file_layout));
  5025. @@ -3429,13 +3429,13 @@ static bool_t decode_file_layout(
  5026.      if (!xdr_opaque(xdr, (char *)layout->deviceid, PNFS_DEVICEID_SIZE))
  5027.          goto out_error;
  5028.  
  5029. -    if (!xdr_u_int32_t(xdr, &layout->util))
  5030. +    if (!xdr_uint32_t(xdr, &layout->util))
  5031.          goto out_error;
  5032.  
  5033. -    if (!xdr_u_int32_t(xdr, &layout->first_index))
  5034. +    if (!xdr_uint32_t(xdr, &layout->first_index))
  5035.          goto out_error;
  5036.  
  5037. -    if (!xdr_u_hyper(xdr, &layout->pattern_offset))
  5038. +    if (!xdr_uint64_t(xdr, &layout->pattern_offset))
  5039.          goto out_error;
  5040.  
  5041.      if (!decode_file_layout_handles(xdr, &layout->filehandles))
  5042. @@ -3455,10 +3455,10 @@ static bool_t decode_layout(
  5043.  {
  5044.      pnfs_layout layout;
  5045.  
  5046. -    if (!xdr_u_hyper(xdr, &layout.offset))
  5047. +    if (!xdr_uint64_t(xdr, &layout.offset))
  5048.          return FALSE;
  5049.  
  5050. -    if (!xdr_u_hyper(xdr, &layout.length))
  5051. +    if (!xdr_uint64_t(xdr, &layout.length))
  5052.          return FALSE;
  5053.  
  5054.      if (!xdr_enum(xdr, (enum_t *)&layout.iomode))
  5055. @@ -3490,7 +3490,7 @@ static bool_t decode_layout_res_ok(
  5056.      if (!xdr_stateid4(xdr, &res->stateid))
  5057.          return FALSE;
  5058.  
  5059. -    if (!xdr_u_int32_t(xdr, &res->count))
  5060. +    if (!xdr_uint32_t(xdr, &res->count))
  5061.          return FALSE;
  5062.  
  5063.      for (i = 0; i < res->count; i++)
  5064. @@ -3508,7 +3508,7 @@ static bool_t decode_op_layoutget(
  5065.      if (unexpected_op(resop->op, OP_LAYOUTGET))
  5066.          return FALSE;
  5067.  
  5068. -    if (!xdr_u_int32_t(xdr, (uint32_t *)&res->status))
  5069. +    if (!xdr_uint32_t(xdr, (uint32_t *)&res->status))
  5070.          return FALSE;
  5071.  
  5072.      switch (res->status) {
  5073. @@ -3552,16 +3552,16 @@ static bool_t encode_op_layoutreturn(
  5074.      if (args->return_type == PNFS_RETURN_FILE) {
  5075.          u_int32_t zero = 0;
  5076.  
  5077. -        if (!xdr_u_hyper(xdr, &args->offset))
  5078. +        if (!xdr_uint64_t(xdr, &args->offset))
  5079.              return FALSE;
  5080.  
  5081. -        if (!xdr_u_hyper(xdr, &args->length))
  5082. +        if (!xdr_uint64_t(xdr, &args->length))
  5083.              return FALSE;
  5084.  
  5085.          if (!xdr_stateid4(xdr, args->stateid))
  5086.              return FALSE;
  5087.  
  5088. -        return xdr_u_int32_t(xdr, &zero); /* size of lrf_body is 0 */
  5089. +        return xdr_uint32_t(xdr, &zero); /* size of lrf_body is 0 */
  5090.      } else {
  5091.          eprintf("'%s': layout type (%d) is not PNFS_RETURN_FILE!\n",
  5092.              "encode_op_layoutreturn", args->return_type);
  5093. @@ -3578,7 +3578,7 @@ static bool_t decode_op_layoutreturn(
  5094.      if (unexpected_op(resop->op, OP_LAYOUTRETURN))
  5095.          return FALSE;
  5096.  
  5097. -    if (!xdr_u_int32_t(xdr, (uint32_t *)&res->status))
  5098. +    if (!xdr_uint32_t(xdr, (uint32_t *)&res->status))
  5099.          return FALSE;
  5100.  
  5101.      if (res->status == NFS4_OK) {
  5102. @@ -3709,10 +3709,10 @@ bool_t nfs_encode_compound(
  5103.      if (!xdr_bytes(xdr, (char **)&tag, &args->tag_len, NFS4_OPAQUE_LIMIT))
  5104.          return FALSE;
  5105.  
  5106. -    if (!xdr_u_int32_t(xdr, &args->minorversion))
  5107. +    if (!xdr_uint32_t(xdr, &args->minorversion))
  5108.          return FALSE;
  5109.  
  5110. -    if (!xdr_u_int32_t(xdr, &args->argarray_count))
  5111. +    if (!xdr_uint32_t(xdr, &args->argarray_count))
  5112.          return FALSE;
  5113.  
  5114.      for (i = 0; i < args->argarray_count; i++)
  5115. @@ -3721,7 +3721,7 @@ bool_t nfs_encode_compound(
  5116.          if (entry == NULL || entry->encode == NULL)
  5117.              return FALSE;
  5118.  
  5119. -        if (!xdr_u_int32_t(xdr, &args->argarray[i].op))
  5120. +        if (!xdr_uint32_t(xdr, &args->argarray[i].op))
  5121.              return FALSE;
  5122.          if (!entry->encode(xdr, &args->argarray[i]))
  5123.              return FALSE;
  5124. @@ -3738,14 +3738,14 @@ bool_t nfs_decode_compound(
  5125.      const op_table_entry *entry;
  5126.      unsigned char *tag = res->tag;
  5127.  
  5128. -    if (!xdr_u_int32_t(xdr, &res->status))
  5129. +    if (!xdr_uint32_t(xdr, &res->status))
  5130.          return FALSE;
  5131.  
  5132.      if (!xdr_bytes(xdr, (char **)&tag, &res->tag_len, NFS4_OPAQUE_LIMIT))
  5133.          return FALSE;
  5134.  
  5135.      expected_count = res->resarray_count;
  5136. -    if (!xdr_u_int32_t(xdr, &res->resarray_count))
  5137. +    if (!xdr_uint32_t(xdr, &res->resarray_count))
  5138.          return FALSE;
  5139.  
  5140.      /* validate the number of operations against what we sent */
  5141. @@ -3765,7 +3765,7 @@ bool_t nfs_decode_compound(
  5142.      for (i = 0; i < res->resarray_count; i++)
  5143.      {
  5144.          expected_op = res->resarray[i].op;
  5145. -        if (!xdr_u_int32_t(xdr, &res->resarray[i].op))
  5146. +        if (!xdr_uint32_t(xdr, &res->resarray[i].op))
  5147.              return FALSE;
  5148.  
  5149.          /* validate each operation number against what we sent */
  5150. diff --git a/daemon/nfs42_xdr.c b/daemon/nfs42_xdr.c
  5151. index 1e9c731..e3da651 100644
  5152. --- a/daemon/nfs42_xdr.c
  5153. +++ b/daemon/nfs42_xdr.c
  5154. @@ -55,10 +55,10 @@ bool_t encode_op_allocate(
  5155.      if (!xdr_stateid4(xdr, &args->stateid->stateid))
  5156.          return FALSE;
  5157.  
  5158. -    if (!xdr_u_hyper(xdr, &args->offset))
  5159. +    if (!xdr_uint64_t(xdr, &args->offset))
  5160.          return FALSE;
  5161.  
  5162. -    return xdr_u_hyper(xdr, &args->length);
  5163. +    return xdr_uint64_t(xdr, &args->length);
  5164.  }
  5165.  
  5166.  
  5167. @@ -71,7 +71,7 @@ bool_t decode_op_allocate(
  5168.      if (unexpected_op(resop->op, OP_ALLOCATE))
  5169.          return FALSE;
  5170.  
  5171. -    if (!xdr_u_int32_t(xdr, &res->status))
  5172. +    if (!xdr_uint32_t(xdr, &res->status))
  5173.          return FALSE;
  5174.  
  5175.      return TRUE;
  5176. @@ -92,10 +92,10 @@ bool_t encode_op_deallocate(
  5177.      if (!xdr_stateid4(xdr, &args->stateid->stateid))
  5178.          return FALSE;
  5179.  
  5180. -    if (!xdr_u_hyper(xdr, &args->offset))
  5181. +    if (!xdr_uint64_t(xdr, &args->offset))
  5182.          return FALSE;
  5183.  
  5184. -    return xdr_u_hyper(xdr, &args->length);
  5185. +    return xdr_uint64_t(xdr, &args->length);
  5186.  }
  5187.  
  5188.  
  5189. @@ -108,7 +108,7 @@ bool_t decode_op_deallocate(
  5190.      if (unexpected_op(resop->op, OP_DEALLOCATE))
  5191.          return FALSE;
  5192.  
  5193. -    if (!xdr_u_int32_t(xdr, &res->status))
  5194. +    if (!xdr_uint32_t(xdr, &res->status))
  5195.          return FALSE;
  5196.  
  5197.      return TRUE;
  5198. @@ -130,10 +130,10 @@ bool_t encode_op_read_plus(
  5199.      if (!xdr_stateid4(xdr, &args->stateid->stateid))
  5200.          return FALSE;
  5201.  
  5202. -    if (!xdr_u_hyper(xdr, &args->offset))
  5203. +    if (!xdr_uint64_t(xdr, &args->offset))
  5204.          return FALSE;
  5205.  
  5206. -    return xdr_u_int32_t(xdr, &args->count);
  5207. +    return xdr_uint32_t(xdr, &args->count);
  5208.  }
  5209.  
  5210.  static bool_t decode_read_plus_res_ok(
  5211. @@ -148,7 +148,7 @@ static bool_t decode_read_plus_res_ok(
  5212.          return FALSE;
  5213.      }
  5214.  
  5215. -    if (!xdr_u_int32_t(xdr, &res->count)) {
  5216. +    if (!xdr_uint32_t(xdr, &res->count)) {
  5217.          DPRINTF(0, ("decode count failed\n"));
  5218.          return FALSE;
  5219.      }
  5220. @@ -167,7 +167,7 @@ static bool_t decode_read_plus_res_ok(
  5221.      uint32_t i, co;
  5222.  
  5223.      for (i = 0 ; i < res->count ; i++) {
  5224. -        if (!xdr_u_int32_t(xdr, &co)) {
  5225. +        if (!xdr_uint32_t(xdr, &co)) {
  5226.              DPRINTF(0, ("i=%d, decode co failed\n", (int)i));
  5227.              return FALSE;
  5228.          }
  5229. @@ -179,12 +179,12 @@ static bool_t decode_read_plus_res_ok(
  5230.                  DPRINTF(2,
  5231.                      ("i=%d, 'NFS4_CONTENT_DATA' content\n", (int)i));
  5232.  
  5233. -                if (!xdr_u_hyper(xdr, &contents[i].u.data.offset)) {
  5234. +                if (!xdr_uint64_t(xdr, &contents[i].u.data.offset)) {
  5235.                      DPRINTF(0,
  5236.                          ("i=%d, decoding 'offset' failed\n", (int)i));
  5237.                      return FALSE;
  5238.                  }
  5239. -                if (!xdr_u_int32_t(xdr, &contents[i].u.data.count)) {
  5240. +                if (!xdr_uint32_t(xdr, &contents[i].u.data.count)) {
  5241.                      DPRINTF(0,
  5242.                          ("i=%d, decoding 'count' failed\n", (int)i));
  5243.                      return FALSE;
  5244. @@ -215,9 +215,9 @@ static bool_t decode_read_plus_res_ok(
  5245.  
  5246.                  DPRINTF(2,
  5247.                      ("i=%d, 'NFS4_CONTENT_HOLE' content\n", (int)i));
  5248. -                if (!xdr_u_hyper(xdr, &contents[i].u.hole.offset))
  5249. +                if (!xdr_uint64_t(xdr, &contents[i].u.hole.offset))
  5250.                      return FALSE;
  5251. -                if (!xdr_u_hyper(xdr, &contents[i].u.hole.length))
  5252. +                if (!xdr_uint64_t(xdr, &contents[i].u.hole.length))
  5253.                      return FALSE;
  5254.  
  5255.  
  5256. @@ -266,7 +266,7 @@ bool_t decode_op_read_plus(
  5257.      if (unexpected_op(resop->op, OP_READ_PLUS))
  5258.          return FALSE;
  5259.  
  5260. -    if (!xdr_u_int32_t(xdr, &res->status))
  5261. +    if (!xdr_uint32_t(xdr, &res->status))
  5262.          return FALSE;
  5263.  
  5264.      if (res->status == NFS4_OK)
  5265. @@ -290,13 +290,13 @@ bool_t encode_op_seek(
  5266.      if (!xdr_stateid4(xdr, &args->stateid->stateid))
  5267.          return FALSE;
  5268.  
  5269. -    if (!xdr_u_hyper(xdr, &args->offset))
  5270. +    if (!xdr_uint64_t(xdr, &args->offset))
  5271.          return FALSE;
  5272.  
  5273.      uint32_t args_what = args->what;
  5274.      EASSERT((args_what == NFS4_CONTENT_DATA) ||
  5275.          (args_what == NFS4_CONTENT_HOLE));
  5276. -    return xdr_u_int32_t(xdr, &args_what);
  5277. +    return xdr_uint32_t(xdr, &args_what);
  5278.  }
  5279.  
  5280.  static bool_t decode_seek_res_ok(
  5281. @@ -308,7 +308,7 @@ static bool_t decode_seek_res_ok(
  5282.          return FALSE;
  5283.      }
  5284.  
  5285. -    if (!xdr_u_hyper(xdr, &res->offset)) {
  5286. +    if (!xdr_uint64_t(xdr, &res->offset)) {
  5287.          return FALSE;
  5288.      }
  5289.  
  5290. @@ -324,7 +324,7 @@ bool_t decode_op_seek(
  5291.      if (unexpected_op(resop->op, OP_SEEK))
  5292.          return FALSE;
  5293.  
  5294. -    if (!xdr_u_int32_t(xdr, &res->status))
  5295. +    if (!xdr_uint32_t(xdr, &res->status))
  5296.          return FALSE;
  5297.  
  5298.      if (res->status == NFS4_OK)
  5299. @@ -351,13 +351,13 @@ bool_t encode_op_clone(
  5300.      if (!xdr_stateid4(xdr, &args->dst_stateid->stateid))
  5301.          return FALSE;
  5302.  
  5303. -    if (!xdr_u_hyper(xdr, &args->src_offset))
  5304. +    if (!xdr_uint64_t(xdr, &args->src_offset))
  5305.          return FALSE;
  5306.  
  5307. -    if (!xdr_u_hyper(xdr, &args->dst_offset))
  5308. +    if (!xdr_uint64_t(xdr, &args->dst_offset))
  5309.          return FALSE;
  5310.  
  5311. -    return xdr_u_hyper(xdr, &args->count);
  5312. +    return xdr_uint64_t(xdr, &args->count);
  5313.  }
  5314.  
  5315.  bool_t decode_op_clone(
  5316. @@ -369,7 +369,7 @@ bool_t decode_op_clone(
  5317.      if (unexpected_op(resop->op, OP_CLONE))
  5318.          return FALSE;
  5319.  
  5320. -    if (!xdr_u_int32_t(xdr, &res->status))
  5321. +    if (!xdr_uint32_t(xdr, &res->status))
  5322.          return FALSE;
  5323.  
  5324.      return TRUE;
  5325. diff --git a/libtirpc/libtirpc/libtirpc.def b/libtirpc/libtirpc/libtirpc.def
  5326. index ca28582..15aab8d 100644
  5327. --- a/libtirpc/libtirpc/libtirpc.def
  5328. +++ b/libtirpc/libtirpc/libtirpc.def
  5329. @@ -60,6 +60,10 @@ xdr_float
  5330.  xdr_free
  5331.  xdr_hyper
  5332.  xdr_int
  5333. +xdr_int8_t
  5334. +xdr_int16_t
  5335. +xdr_int32_t
  5336. +xdr_int64_t
  5337.  xdr_long
  5338.  xdr_netobj
  5339.  xdr_opaque
  5340. @@ -71,14 +75,22 @@ xdr_pointer
  5341.  xdr_reference
  5342.  xdr_replymsg
  5343.  xdr_short
  5344. +xdr_sizeof
  5345.  xdr_string
  5346.  xdr_u_char
  5347.  xdr_u_hyper
  5348.  xdr_u_int
  5349. +xdr_u_int8_t
  5350.  xdr_u_int32_t
  5351.  xdr_u_int64_t
  5352.  xdr_u_long
  5353.  xdr_u_short
  5354. +xdr_uint8_t
  5355. +xdr_uint16_t
  5356. +xdr_uint32_t
  5357. +xdr_uint64_t
  5358. +xdr_quad_t
  5359. +xdr_u_quad_t
  5360.  xdr_union
  5361.  xdr_vector
  5362.  xdr_void
  5363. diff --git a/libtirpc/src/xdr.c b/libtirpc/src/xdr.c
  5364. index 46c1b34..0b9b97d 100644
  5365. --- a/libtirpc/src/xdr.c
  5366. +++ b/libtirpc/src/xdr.c
  5367. @@ -26,7 +26,6 @@
  5368.   * POSSIBILITY OF SUCH DAMAGE.
  5369.   */
  5370.  
  5371. -//#include <sys/cdefs.h>
  5372.  
  5373.  /*
  5374.   * xdr.c, Generic XDR routines implementation.
  5375. @@ -44,14 +43,10 @@
  5376.  #include <stdlib.h>
  5377.  #include <string.h>
  5378.  
  5379. -#ifdef _WIN32 // CVE-2017-8779
  5380.  #include <rpc/rpc.h>
  5381. -#endif
  5382.  #include <rpc/types.h>
  5383.  #include <rpc/xdr.h>
  5384. -#ifdef _WIN32 // CVE-2017-8779
  5385.  #include <rpc/rpc_com.h>
  5386. -#endif
  5387.  
  5388.  typedef quad_t          longlong_t;     /* ANSI long long type */
  5389.  typedef u_quad_t        u_longlong_t;   /* ANSI unsigned long long type */
  5390. @@ -61,9 +56,6 @@ typedef u_quad_t        u_longlong_t;   /* ANSI unsigned long long type */
  5391.   */
  5392.  #define XDR_FALSE      ((long) 0)
  5393.  #define XDR_TRUE       ((long) 1)
  5394. -#ifndef _WIN32 // CVE-2017-8779
  5395. -#define LASTUNSIGNED   ((u_int) 0-1)
  5396. -#endif
  5397.  
  5398.  /*
  5399.   * for unit alignment
  5400. @@ -263,6 +255,18 @@ xdr_u_int32_t(xdrs, u_int32_p)
  5401.  }
  5402.  
  5403.  
  5404. +/*
  5405. + * XDR unsigned 32-bit integers
  5406. + */
  5407. +bool_t
  5408. +xdr_uint32_t(xdrs, uint32_p)
  5409. +       XDR *xdrs;
  5410. +       uint32_t *uint32_p;
  5411. +{
  5412. +       return (xdr_u_int32_t(xdrs, (u_int32_t *)uint32_p));
  5413. +}
  5414. +
  5415. +
  5416.  /*
  5417.   * XDR short integers
  5418.   */
  5419. @@ -385,6 +389,92 @@ xdr_u_int16_t(xdrs, u_int16_p)
  5420.  }
  5421.  
  5422.  
  5423. +/*
  5424. + * XDR unsigned 16-bit integers
  5425. + */
  5426. +bool_t
  5427. +xdr_uint16_t(xdrs, uint16_p)
  5428. +       XDR *xdrs;
  5429. +       uint16_t *uint16_p;
  5430. +{
  5431. +       return (xdr_u_int16_t(xdrs, (u_int16_t *)uint16_p));
  5432. +}
  5433. +
  5434. +
  5435. +/*
  5436. + * XDR 8-bit integers
  5437. + */
  5438. +bool_t
  5439. +xdr_int8_t(xdrs, int8_p)
  5440. +       XDR *xdrs;
  5441. +       int8_t *int8_p;
  5442. +{
  5443. +       long l;
  5444. +
  5445. +       switch (xdrs->x_op) {
  5446. +
  5447. +       case XDR_ENCODE:
  5448. +               l = (long) *int8_p;
  5449. +               return (XDR_PUTLONG(xdrs, &l));
  5450. +
  5451. +       case XDR_DECODE:
  5452. +               if (!XDR_GETLONG(xdrs, &l)) {
  5453. +                       return (FALSE);
  5454. +               }
  5455. +               *int8_p = (int8_t) l;
  5456. +               return (TRUE);
  5457. +
  5458. +       case XDR_FREE:
  5459. +               return (TRUE);
  5460. +       }
  5461. +       /* NOTREACHED */
  5462. +       return (FALSE);
  5463. +}
  5464. +
  5465. +
  5466. +/*
  5467. + * XDR unsigned 8-bit integers
  5468. + */
  5469. +bool_t
  5470. +xdr_u_int8_t(xdrs, uint8_p)
  5471. +       XDR *xdrs;
  5472. +       uint8_t *uint8_p;
  5473. +{
  5474. +       u_long l;
  5475. +
  5476. +       switch (xdrs->x_op) {
  5477. +
  5478. +       case XDR_ENCODE:
  5479. +               l = (u_long) *uint8_p;
  5480. +               return (XDR_PUTLONG(xdrs, (long *)&l));
  5481. +
  5482. +       case XDR_DECODE:
  5483. +               if (!XDR_GETLONG(xdrs, (long *)&l)) {
  5484. +                       return (FALSE);
  5485. +               }
  5486. +               *uint8_p = (uint8_t) l;
  5487. +               return (TRUE);
  5488. +
  5489. +       case XDR_FREE:
  5490. +               return (TRUE);
  5491. +       }
  5492. +       /* NOTREACHED */
  5493. +       return (FALSE);
  5494. +}
  5495. +
  5496. +
  5497. +/*
  5498. + * XDR unsigned 8-bit integers
  5499. + */
  5500. +bool_t
  5501. +xdr_uint8_t(xdrs, uint8_p)
  5502. +       XDR *xdrs;
  5503. +       uint8_t *uint8_p;
  5504. +{
  5505. +       return (xdr_u_int8_t(xdrs, (uint8_t *)uint8_p));
  5506. +}
  5507. +
  5508. +
  5509.  /*
  5510.   * XDR a char
  5511.   */
  5512. @@ -461,16 +551,16 @@ xdr_enum(xdrs, ep)
  5513.  {
  5514.         enum sizecheck { SIZEVAL };     /* used to find the size of an enum */
  5515.  
  5516. -       /*
  5517. -        * enums are treated as ints
  5518. -        */
  5519. -
  5520. -
  5521.  #ifdef _WIN32
  5522.  #pragma warning( push )
  5523. -/* Disable "warning C4127: conditional expression is constant" */
  5524. +/*
  5525. + * warning C4127: conditional expression is constant
  5526. + */
  5527.  #pragma warning (disable : 4127)
  5528. -#endif
  5529. +#endif /* _WIN32 */
  5530. +       /*
  5531. +        * enums are treated as ints
  5532. +        */
  5533.         /* LINTED */ if (sizeof (enum sizecheck) == sizeof (long)) {
  5534.                 return (xdr_long(xdrs, (long *)(void *)ep));
  5535.         } else /* LINTED */ if (sizeof (enum sizecheck) == sizeof (int)) {
  5536. @@ -482,7 +572,7 @@ xdr_enum(xdrs, ep)
  5537.         }
  5538.  #ifdef _WIN32
  5539.  #pragma warning( pop )
  5540. -#endif
  5541. +#endif /* _WIN32 */
  5542.  }
  5543.  
  5544.  /*
  5545. @@ -551,9 +641,7 @@ xdr_bytes(xdrs, cpp, sizep, maxsize)
  5546.  {
  5547.         char *sp = *cpp;  /* sp is the actual string pointer */
  5548.         u_int nodesize;
  5549. -#ifdef _WIN32 // CVE-2017-8779
  5550.         bool_t ret, allocated = FALSE;
  5551. -#endif
  5552.  
  5553.         /*
  5554.          * first deal with the length since xdr bytes are counted
  5555. @@ -577,9 +665,7 @@ xdr_bytes(xdrs, cpp, sizep, maxsize)
  5556.                 }
  5557.                 if (sp == NULL) {
  5558.                         *cpp = sp = mem_alloc(nodesize);
  5559. -#ifdef _WIN32 // CVE-2017-8779
  5560.                         allocated = TRUE;
  5561. -#endif
  5562.                 }
  5563.                 if (sp == NULL) {
  5564.                         warnx("xdr_bytes: out of memory");
  5565. @@ -588,9 +674,6 @@ xdr_bytes(xdrs, cpp, sizep, maxsize)
  5566.                 /* FALLTHROUGH */
  5567.  
  5568.         case XDR_ENCODE:
  5569. -#ifndef _WIN32 // CVE-2017-8779
  5570. -               return (xdr_opaque(xdrs, sp, nodesize));
  5571. -#else
  5572.                 ret = xdr_opaque(xdrs, sp, nodesize);
  5573.                 if ((xdrs->x_op == XDR_DECODE) && (ret == FALSE)) {
  5574.                         if (allocated == TRUE) {
  5575. @@ -599,7 +682,6 @@ xdr_bytes(xdrs, cpp, sizep, maxsize)
  5576.                         }
  5577.                 }
  5578.                 return (ret);
  5579. -#endif
  5580.  
  5581.         case XDR_FREE:
  5582.                 if (sp != NULL) {
  5583. @@ -693,9 +775,7 @@ xdr_string(xdrs, cpp, maxsize)
  5584.         char *sp = *cpp;  /* sp is the actual string pointer */
  5585.         u_int size;
  5586.         u_int nodesize;
  5587. -#ifdef _WIN32 // CVE-2017-8779
  5588.         bool_t ret, allocated = FALSE;
  5589. -#endif
  5590.  
  5591.         /*
  5592.          * first deal with the length since xdr strings are counted-strings
  5593. @@ -735,15 +815,10 @@ xdr_string(xdrs, cpp, maxsize)
  5594.         switch (xdrs->x_op) {
  5595.  
  5596.         case XDR_DECODE:
  5597. -#ifndef _WIN32 // CVE-2017-8779
  5598. -               if (sp == NULL)
  5599. -                       *cpp = sp = mem_alloc(nodesize);
  5600. -#else
  5601.                 if (sp == NULL) {
  5602.                         *cpp = sp = mem_alloc(nodesize);
  5603.                         allocated = TRUE;
  5604.                 }
  5605. -#endif
  5606.                 if (sp == NULL) {
  5607.                         warnx("xdr_string: out of memory");
  5608.                         return (FALSE);
  5609. @@ -752,9 +827,6 @@ xdr_string(xdrs, cpp, maxsize)
  5610.                 /* FALLTHROUGH */
  5611.  
  5612.         case XDR_ENCODE:
  5613. -#ifndef _WIN32 // CVE-2017-8779
  5614. -               return (xdr_opaque(xdrs, sp, size));
  5615. -#else
  5616.                 ret = xdr_opaque(xdrs, sp, size);
  5617.                 if ((xdrs->x_op == XDR_DECODE) && (ret == FALSE)) {
  5618.                         if (allocated == TRUE) {
  5619. @@ -763,7 +835,6 @@ xdr_string(xdrs, cpp, maxsize)
  5620.                         }
  5621.                 }
  5622.                 return (ret);
  5623. -#endif
  5624.  
  5625.         case XDR_FREE:
  5626.                 mem_free(sp, nodesize);
  5627. @@ -774,8 +845,8 @@ xdr_string(xdrs, cpp, maxsize)
  5628.         return (FALSE);
  5629.  }
  5630.  
  5631. -/*
  5632. - * Wrapper for xdr_string that can be called directly from
  5633. +/*
  5634. + * Wrapper for xdr_string that can be called directly from
  5635.   * routines like clnt_call
  5636.   */
  5637.  bool_t
  5638. @@ -783,11 +854,7 @@ xdr_wrapstring(xdrs, cpp)
  5639.         XDR *xdrs;
  5640.         char **cpp;
  5641.  {
  5642. -#ifdef _WIN32 // CVE-2017-8779
  5643.         return xdr_string(xdrs, cpp, RPC_MAXDATASIZE);
  5644. -#else
  5645. -       return xdr_string(xdrs, cpp, LASTUNSIGNED);
  5646. -#endif
  5647.  }
  5648.  
  5649.  /*
  5650. @@ -821,7 +888,8 @@ xdr_int64_t(xdrs, llp)
  5651.                 if (XDR_GETLONG(xdrs, (long *)&ul[1]) == FALSE)
  5652.                         return (FALSE);
  5653.                 *llp = (int64_t)
  5654. -                   (((u_int64_t)ul[0] << 32) | ((u_int64_t)ul[1]));
  5655. +                   (((u_int64_t)ul[0] << 32) |
  5656. +                    ((u_int64_t)(ul[1]) & 0xffffffff));
  5657.                 return (TRUE);
  5658.         case XDR_FREE:
  5659.                 return (TRUE);
  5660. @@ -854,7 +922,8 @@ xdr_u_int64_t(xdrs, ullp)
  5661.                 if (XDR_GETLONG(xdrs, (long *)&ul[1]) == FALSE)
  5662.                         return (FALSE);
  5663.                 *ullp = (u_int64_t)
  5664. -                   (((u_int64_t)ul[0] << 32) | ((u_int64_t)ul[1]));
  5665. +                   (((u_int64_t)ul[0] << 32) |
  5666. +                    ((u_int64_t)(ul[1]) & 0xffffffff));
  5667.                 return (TRUE);
  5668.         case XDR_FREE:
  5669.                 return (TRUE);
  5670. @@ -864,6 +933,18 @@ xdr_u_int64_t(xdrs, ullp)
  5671.  }
  5672.  
  5673.  
  5674. +/*
  5675. + * XDR unsigned 64-bit integers
  5676. + */
  5677. +bool_t
  5678. +xdr_uint64_t(xdrs, ullp)
  5679. +       XDR *xdrs;
  5680. +       uint64_t *ullp;
  5681. +{
  5682. +       return (xdr_u_int64_t(xdrs, (u_int64_t *)ullp));
  5683. +}
  5684. +
  5685. +
  5686.  /*
  5687.   * XDR hypers
  5688.   */
  5689. @@ -930,3 +1011,26 @@ xdr_u_longlong_t(xdrs, ullp)
  5690.          */
  5691.         return (xdr_u_int64_t(xdrs, (u_int64_t *)ullp));
  5692.  }
  5693. +
  5694. +/*
  5695. + * XDR quad_t
  5696. + */
  5697. +bool_t
  5698. +xdr_quad_t(xdrs, llp)
  5699. +       XDR *xdrs;
  5700. +       int64_t *llp;
  5701. +{
  5702. +       return (xdr_int64_t(xdrs, (int64_t *)llp));
  5703. +}
  5704. +
  5705. +
  5706. +/*
  5707. + * XDR u_quad_t
  5708. + */
  5709. +bool_t
  5710. +xdr_u_quad_t(xdrs, ullp)
  5711. +       XDR *xdrs;
  5712. +       u_int64_t *ullp;
  5713. +{
  5714. +       return (xdr_u_int64_t(xdrs, (u_int64_t *)ullp));
  5715. +}
  5716. diff --git a/libtirpc/tirpc/rpc/types.h b/libtirpc/tirpc/rpc/types.h
  5717. index afb0a53..8abdfab 100644
  5718. --- a/libtirpc/tirpc/rpc/types.h
  5719. +++ b/libtirpc/tirpc/rpc/types.h
  5720. @@ -33,10 +33,12 @@
  5721.   */
  5722.  
  5723.  /* NFSv4.1 client for Windows
  5724. - * Copyright (C) 2012 The Regents of the University of Michigan
  5725. + * Copyright (C) 2012 The Regents of the University of Michigan
  5726. + * Copyright (C) 2024-2025 Roland Mainz <roland.mainz@nrubsig.org>
  5727.   *
  5728.   * Olga Kornievskaia <aglo@umich.edu>
  5729.   * Casey Bodley <cbodley@umich.edu>
  5730. + * Roland Mainz <roland.mainz@nrubsig.org>
  5731.   *
  5732.   * This library is free software; you can redistribute it and/or modify it
  5733.   * under the terms of the GNU Lesser General Public License as published by
  5734. @@ -60,13 +62,20 @@
  5735.  #define _TIRPC_TYPES_H
  5736.  
  5737.  #include <sys/types.h>
  5738. -//#include <sys/_null.h>
  5739. +#ifndef _WIN32
  5740. +#include <sys/_null.h>
  5741. +#endif /* !_WIN32 */
  5742.  
  5743. +#ifdef _WIN32
  5744.  // Windows mappings of data types
  5745.  // Fixed size things
  5746. -typedef INT16      int16_t;
  5747. +typedef signed char int8_t;
  5748. +typedef signed short int16_t;
  5749.  typedef INT32      int32_t;
  5750.  typedef INT64      int64_t;
  5751. +typedef unsigned char uint8_t;
  5752. +typedef unsigned char u_int8_t;
  5753. +typedef UINT16   uint16_t;
  5754.  typedef UINT16   u_int16_t;
  5755.  typedef UINT32   u_int32_t;
  5756.  typedef UINT32  uint32_t;
  5757. @@ -88,7 +97,7 @@ typedef DWORD    pid_t;
  5758.  
  5759.  //typedef SIZE_T  size_t;  //This is causing a "benign redefinition error"
  5760.  typedef SSIZE_T ssize_t;
  5761. -// End of Windows...
  5762. +#endif /* _WIN32 */
  5763.  
  5764.  typedef int32_t bool_t;
  5765.  typedef int32_t enum_t;
  5766. @@ -150,7 +159,7 @@ struct t_bind {
  5767.   * not use.
  5768.   */
  5769.  struct __rpc_sockinfo {
  5770. -       ADDRESS_FAMILY si_af;
  5771. +       ADDRESS_FAMILY si_af;
  5772.         int si_proto;
  5773.         int si_socktype;
  5774.         int si_alen;
  5775. diff --git a/libtirpc/tirpc/rpc/xdr.h b/libtirpc/tirpc/rpc/xdr.h
  5776. index 42bfb57..39782d7 100644
  5777. --- a/libtirpc/tirpc/rpc/xdr.h
  5778. +++ b/libtirpc/tirpc/rpc/xdr.h
  5779. @@ -295,12 +295,20 @@ extern bool_t     xdr_long(XDR *, long *);
  5780.  extern bool_t  xdr_u_long(XDR *, u_long *);
  5781.  extern bool_t  xdr_short(XDR *, short *);
  5782.  extern bool_t  xdr_u_short(XDR *, u_short *);
  5783. +extern bool_t  xdr_int8_t(XDR *, int8_t *);
  5784. +extern bool_t  xdr_u_int8_t(XDR *, uint8_t *);
  5785. +extern bool_t  xdr_uint8_t(XDR *, uint8_t *);
  5786.  extern bool_t  xdr_int16_t(XDR *, int16_t *);
  5787.  extern bool_t  xdr_u_int16_t(XDR *, u_int16_t *);
  5788. +extern bool_t  xdr_uint16_t(XDR *, uint16_t *);
  5789.  extern bool_t  xdr_int32_t(XDR *, int32_t *);
  5790.  extern bool_t  xdr_u_int32_t(XDR *, u_int32_t *);
  5791. +extern bool_t  xdr_uint32_t(XDR *, uint32_t *);
  5792.  extern bool_t  xdr_int64_t(XDR *, int64_t *);
  5793.  extern bool_t  xdr_u_int64_t(XDR *, u_int64_t *);
  5794. +extern bool_t  xdr_uint64_t(XDR *, uint64_t *);
  5795. +extern bool_t  xdr_quad_t(XDR *, int64_t *);
  5796. +extern bool_t  xdr_u_quad_t(XDR *, u_int64_t *);
  5797.  extern bool_t  xdr_bool(XDR *, bool_t *);
  5798.  extern bool_t  xdr_enum(XDR *, enum_t *);
  5799.  extern bool_t  xdr_array(XDR *, char **, u_int *, u_int, u_int, xdrproc_t);
  5800. @@ -322,6 +330,7 @@ extern bool_t       xdr_hyper(XDR *, quad_t *);
  5801.  extern bool_t  xdr_u_hyper(XDR *, u_quad_t *);
  5802.  extern bool_t  xdr_longlong_t(XDR *, quad_t *);
  5803.  extern bool_t  xdr_u_longlong_t(XDR *, u_quad_t *);
  5804. +extern u_long  xdr_sizeof(xdrproc_t, void *);
  5805.  __END_DECLS
  5806.  
  5807.  /*
  5808. --
  5809. 2.45.1
  5810.  
  5811. From 3b9c4a13f2a480036920c45ce9111619d589cc09 Mon Sep 17 00:00:00 2001
  5812. From: Roland Mainz <roland.mainz@nrubsig.org>
  5813. Date: Fri, 30 May 2025 15:06:27 +0200
  5814. Subject: [PATCH 3/5] daemon: Add |nfs41_fsid_cmp()| to compare two
  5815.  |nfs41_fsid| vars
  5816.  
  5817. Add |nfs41_fsid_cmp()| to compare two |nfs41_fsid| vars
  5818.  
  5819. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  5820. ---
  5821. daemon/fsctl.c |  3 +--
  5822.  daemon/util.h  | 16 ++++++++++++++++
  5823.  2 files changed, 17 insertions(+), 2 deletions(-)
  5824.  
  5825. diff --git a/daemon/fsctl.c b/daemon/fsctl.c
  5826. index 200ae9d..b5de6b4 100644
  5827. --- a/daemon/fsctl.c
  5828. +++ b/daemon/fsctl.c
  5829. @@ -743,8 +743,7 @@ int handle_duplicatedata(void *daemon_context,
  5830.       * Check whether source and destination files are on the same
  5831.       * filesystem
  5832.       */
  5833. -    if (memcmp(&src_file_fsid, &info.fsid,
  5834. -        sizeof(src_file_fsid)) != 0) {
  5835. +    if (nfs41_fsid_cmp(&src_file_fsid, &info.fsid) != 0) {
  5836.          DPRINTF(DDLVL,
  5837.              ("handle_duplicatedata: "
  5838.              "src_file_fsid(major=%llu,minor=%llu) != "
  5839. diff --git a/daemon/util.h b/daemon/util.h
  5840. index fa01c7e..b6e35c1 100644
  5841. --- a/daemon/util.h
  5842. +++ b/daemon/util.h
  5843. @@ -180,6 +180,22 @@ static __inline int stateid4_cmp(
  5844.          return memcmp(s1->other, s2->other, NFS4_STATEID_OTHER);
  5845.  }
  5846.  
  5847. +static __inline int nfs41_fsid_cmp(
  5848. +    IN const nfs41_fsid *restrict s1,
  5849. +    IN const nfs41_fsid *restrict s2)
  5850. +{
  5851. +    if (s1->major > s2->major)
  5852. +        return 1;
  5853. +    else if (s1->major < s2->major)
  5854. +        return -1;
  5855. +    else if (s1->minor > s2->minor)
  5856. +        return 1;
  5857. +    else if (s1->minor < s2->minor)
  5858. +        return -1;
  5859. +    else
  5860. +        return 0;
  5861. +}
  5862. +
  5863.  static __inline void open_delegation4_cpy(
  5864.      OUT open_delegation4 *restrict dst,
  5865.      IN  const open_delegation4 *restrict src)
  5866. --
  5867. 2.45.1
  5868.  
  5869. From c875fa7ed9f7a18b0a39c001004d21ea44f0a5d6 Mon Sep 17 00:00:00 2001
  5870. From: Roland Mainz <roland.mainz@nrubsig.org>
  5871. Date: Fri, 30 May 2025 15:55:45 +0200
  5872. Subject: [PATCH 4/5] build.vc19,daemon: Move fileinfoutil defines&co into new
  5873.  fileinfoutil.h
  5874.  
  5875. Move fileinfoutil defines&co into new fileinfoutil.h
  5876.  
  5877. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  5878. ---
  5879. build.vc19/nfsd/nfsd.vcxproj         |  1 +
  5880.  build.vc19/nfsd/nfsd.vcxproj.filters |  3 ++
  5881.  daemon/delegation.c                  |  4 +-
  5882.  daemon/fileinfoutil.c                |  1 +
  5883.  daemon/fileinfoutil.h                | 79 ++++++++++++++++++++++++++++
  5884.  daemon/getattr.c                     |  1 +
  5885.  daemon/lookup.c                      |  1 +
  5886.  daemon/open.c                        |  1 +
  5887.  daemon/readdir.c                     |  1 +
  5888.  daemon/util.h                        | 46 ----------------
  5889.  10 files changed, 91 insertions(+), 47 deletions(-)
  5890.  create mode 100644 daemon/fileinfoutil.h
  5891.  
  5892. diff --git a/build.vc19/nfsd/nfsd.vcxproj b/build.vc19/nfsd/nfsd.vcxproj
  5893. index 85ab083..d5ae5a1 100644
  5894. --- a/build.vc19/nfsd/nfsd.vcxproj
  5895. +++ b/build.vc19/nfsd/nfsd.vcxproj
  5896. @@ -331,6 +331,7 @@
  5897.      <ClInclude Include="..\..\daemon\cpvparser1.h" />
  5898.      <ClInclude Include="..\..\daemon\daemon_debug.h" />
  5899.      <ClInclude Include="..\..\daemon\delegation.h" />
  5900. +    <ClInclude Include="..\..\daemon\fileinfoutil.h" />
  5901.      <ClInclude Include="..\..\daemon\idmap.h" />
  5902.      <ClInclude Include="..\..\daemon\list.h" />
  5903.      <ClInclude Include="..\..\daemon\name_cache.h" />
  5904. diff --git a/build.vc19/nfsd/nfsd.vcxproj.filters b/build.vc19/nfsd/nfsd.vcxproj.filters
  5905. index c642442..d444636 100644
  5906. --- a/build.vc19/nfsd/nfsd.vcxproj.filters
  5907. +++ b/build.vc19/nfsd/nfsd.vcxproj.filters
  5908. @@ -158,6 +158,9 @@
  5909.      <ClInclude Include="..\..\daemon\delegation.h">
  5910.        <Filter>Header Files</Filter>
  5911.      </ClInclude>
  5912. +    <ClInclude Include="..\..\daemon\fileinfoutil.h">
  5913. +      <Filter>Header Files</Filter>
  5914. +    </ClInclude>
  5915.      <ClInclude Include="..\..\include\from_kernel.h">
  5916.        <Filter>Header Files</Filter>
  5917.      </ClInclude>
  5918. diff --git a/daemon/delegation.c b/daemon/delegation.c
  5919. index 57e1342..352a4f7 100644
  5920. --- a/daemon/delegation.c
  5921. +++ b/daemon/delegation.c
  5922. @@ -1,5 +1,6 @@
  5923.  /* NFSv4.1 client for Windows
  5924. - * Copyright (C) 2012 The Regents of the University of Michigan
  5925. + * Copyright (C) 2012 The Regents of the University of Michigan
  5926. + * Copyright (C) 2023-2025 Roland Mainz <roland.mainz@nrubsig.org>
  5927.   *
  5928.   * Olga Kornievskaia <aglo@umich.edu>
  5929.   * Casey Bodley <cbodley@umich.edu>
  5930. @@ -23,6 +24,7 @@
  5931.  #include "delegation.h"
  5932.  #include "nfs41_ops.h"
  5933.  #include "name_cache.h"
  5934. +#include "fileinfoutil.h"
  5935.  #include "util.h"
  5936.  #include "daemon_debug.h"
  5937.  
  5938. diff --git a/daemon/fileinfoutil.c b/daemon/fileinfoutil.c
  5939. index 644d235..f907b38 100644
  5940. --- a/daemon/fileinfoutil.c
  5941. +++ b/daemon/fileinfoutil.c
  5942. @@ -29,6 +29,7 @@
  5943.  #include "nfs41_build_features.h"
  5944.  #include "daemon_debug.h"
  5945.  #include "nfs41_daemon.h"
  5946. +#include "fileinfoutil.h"
  5947.  #include "util.h"
  5948.  #include "nfs41_ops.h"
  5949.  #include "nfs41_driver.h" /* for |FILE_INFO_TIME_NOT_SET| */
  5950. diff --git a/daemon/fileinfoutil.h b/daemon/fileinfoutil.h
  5951. new file mode 100644
  5952. index 0000000..63b8117
  5953. --- /dev/null
  5954. +++ b/daemon/fileinfoutil.h
  5955. @@ -0,0 +1,79 @@
  5956. +/* NFSv4.1 client for Windows
  5957. + * Copyright (C) 2024-2025 Roland Mainz <roland.mainz@nrubsig.org>
  5958. + *
  5959. + * Roland Mainz <roland.mainz@nrubsig.org>
  5960. + *
  5961. + * This library is free software; you can redistribute it and/or modify it
  5962. + * under the terms of the GNU Lesser General Public License as published by
  5963. + * the Free Software Foundation; either version 2.1 of the License, or (at
  5964. + * your option) any later version.
  5965. + *
  5966. + * This library is distributed in the hope that it will be useful, but
  5967. + * without any warranty; without even the implied warranty of merchantability
  5968. + * or fitness for a particular purpose.  See the GNU Lesser General Public
  5969. + * License for more details.
  5970. + *
  5971. + * You should have received a copy of the GNU Lesser General Public License
  5972. + * along with this library; if not, write to the Free Software Foundation,
  5973. + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  5974. + */
  5975. +
  5976. +#ifndef __NFS41_DAEMON_FILEINFOUTIL_H__
  5977. +#define __NFS41_DAEMON_FILEINFOUTIL_H__ 1
  5978. +
  5979. +#include <stdlib.h>
  5980. +#include <stdbool.h>
  5981. +
  5982. +#include "nfs41_build_features.h"
  5983. +#include "nfs41_types.h"
  5984. +#include "from_kernel.h"
  5985. +
  5986. +typedef struct _FILE_ID_128 FILE_ID_128, *PFILE_ID_128;
  5987. +typedef struct __nfs41_superblock nfs41_superblock;
  5988. +typedef struct __nfs41_open_state nfs41_open_state;
  5989. +
  5990. +void nfs41_file_info_to_FILE_ID_128(
  5991. +    IN const nfs41_file_info *restrict info,
  5992. +    OUT FILE_ID_128 *restrict out_fid128);
  5993. +ULONG nfs_file_info_to_attributes(
  5994. +    IN const nfs41_superblock *restrict superblock,
  5995. +    IN const nfs41_file_info *restrict info);
  5996. +void nfs_to_basic_info(
  5997. +    IN const char *restrict name,
  5998. +    IN const nfs41_superblock *restrict superblock,
  5999. +    IN const nfs41_file_info *restrict info,
  6000. +    OUT PFILE_BASIC_INFO restrict basic_out);
  6001. +void nfs_to_standard_info(
  6002. +    IN const nfs41_superblock *restrict superblock,
  6003. +    IN const nfs41_file_info *restrict info,
  6004. +    OUT PFILE_STANDARD_INFO restrict std_out);
  6005. +void nfs_to_network_openinfo(
  6006. +    IN const char *restrict name,
  6007. +    IN const nfs41_superblock *restrict superblock,
  6008. +    IN const nfs41_file_info *restrict info,
  6009. +    OUT PFILE_NETWORK_OPEN_INFORMATION restrict std_out);
  6010. +void nfs_to_remote_protocol_info(
  6011. +    IN nfs41_open_state *state,
  6012. +    OUT PFILE_REMOTE_PROTOCOL_INFORMATION restrict rpi_out);
  6013. +#ifdef NFS41_DRIVER_WSL_SUPPORT
  6014. +void nfs_to_stat_info(
  6015. +    IN const char *restrict name,
  6016. +    IN const nfs41_superblock *restrict superblock,
  6017. +    IN const nfs41_file_info *restrict info,
  6018. +    OUT PFILE_STAT_INFORMATION restrict stat_out);
  6019. +void nfs_to_stat_lx_info(
  6020. +    IN void *daemon_context,
  6021. +    IN const char *restrict name,
  6022. +    IN const nfs41_superblock *restrict superblock,
  6023. +    IN const nfs41_file_info *restrict info,
  6024. +    OUT PFILE_STAT_LX_INFORMATION restrict stat_lx_out);
  6025. +#endif /* NFS41_DRIVER_WSL_SUPPORT */
  6026. +
  6027. +/* Copy |info->symlink_dir| */
  6028. +#define NFS41FILEINFOCPY_COPY_SYMLINK_DIR (1 << 0)
  6029. +void nfs41_file_info_cpy(
  6030. +    OUT nfs41_file_info *restrict dest,
  6031. +    IN const nfs41_file_info *restrict src,
  6032. +    IN int flags);
  6033. +
  6034. +#endif /* !__NFS41_DAEMON_FILEINFOUTIL_H__ */
  6035. diff --git a/daemon/getattr.c b/daemon/getattr.c
  6036. index c9a0904..6d2b89e 100644
  6037. --- a/daemon/getattr.c
  6038. +++ b/daemon/getattr.c
  6039. @@ -30,6 +30,7 @@
  6040.  #include "name_cache.h"
  6041.  #include "nfs41_driver.h" /* only for |NFS41_SYSOP_FILE_QUERY*| */
  6042.  #include "upcall.h"
  6043. +#include "fileinfoutil.h"
  6044.  #include "daemon_debug.h"
  6045.  
  6046.  
  6047. diff --git a/daemon/lookup.c b/daemon/lookup.c
  6048. index be88a09..66188b1 100644
  6049. --- a/daemon/lookup.c
  6050. +++ b/daemon/lookup.c
  6051. @@ -28,6 +28,7 @@
  6052.  #include "nfs41_compound.h"
  6053.  #include "nfs41_ops.h"
  6054.  #include "name_cache.h"
  6055. +#include "fileinfoutil.h"
  6056.  #include "util.h"
  6057.  #include "daemon_debug.h"
  6058.  
  6059. diff --git a/daemon/open.c b/daemon/open.c
  6060. index 00b67e3..682d04d 100644
  6061. --- a/daemon/open.c
  6062. +++ b/daemon/open.c
  6063. @@ -33,6 +33,7 @@
  6064.  #include "from_kernel.h"
  6065.  #include "daemon_debug.h"
  6066.  #include "upcall.h"
  6067. +#include "fileinfoutil.h"
  6068.  #include "util.h"
  6069.  #include "idmap.h"
  6070.  #include "accesstoken.h"
  6071. diff --git a/daemon/readdir.c b/daemon/readdir.c
  6072. index 7110a2f..f3ec443 100644
  6073. --- a/daemon/readdir.c
  6074. +++ b/daemon/readdir.c
  6075. @@ -33,6 +33,7 @@
  6076.  #include "nfs41_ops.h"
  6077.  #include "daemon_debug.h"
  6078.  #include "upcall.h"
  6079. +#include "fileinfoutil.h"
  6080.  #include "util.h"
  6081.  
  6082.  
  6083. diff --git a/daemon/util.h b/daemon/util.h
  6084. index b6e35c1..30db100 100644
  6085. --- a/daemon/util.h
  6086. +++ b/daemon/util.h
  6087. @@ -203,52 +203,6 @@ static __inline void open_delegation4_cpy(
  6088.      (void)memcpy(dst, src, sizeof(open_delegation4));
  6089.  }
  6090.  
  6091. -typedef struct _FILE_ID_128 FILE_ID_128, *PFILE_ID_128;
  6092. -void nfs41_file_info_to_FILE_ID_128(
  6093. -    IN const nfs41_file_info *restrict info,
  6094. -    OUT FILE_ID_128 *restrict out_fid128);
  6095. -ULONG nfs_file_info_to_attributes(
  6096. -    IN const nfs41_superblock *restrict superblock,
  6097. -    IN const nfs41_file_info *restrict info);
  6098. -void nfs_to_basic_info(
  6099. -    IN const char *restrict name,
  6100. -    IN const nfs41_superblock *restrict superblock,
  6101. -    IN const nfs41_file_info *restrict info,
  6102. -    OUT PFILE_BASIC_INFO restrict basic_out);
  6103. -void nfs_to_standard_info(
  6104. -    IN const nfs41_superblock *restrict superblock,
  6105. -    IN const nfs41_file_info *restrict info,
  6106. -    OUT PFILE_STANDARD_INFO restrict std_out);
  6107. -void nfs_to_network_openinfo(
  6108. -    IN const char *restrict name,
  6109. -    IN const nfs41_superblock *restrict superblock,
  6110. -    IN const nfs41_file_info *restrict info,
  6111. -    OUT PFILE_NETWORK_OPEN_INFORMATION restrict std_out);
  6112. -typedef struct __nfs41_open_state nfs41_open_state;
  6113. -void nfs_to_remote_protocol_info(
  6114. -    IN nfs41_open_state *state,
  6115. -    OUT PFILE_REMOTE_PROTOCOL_INFORMATION restrict rpi_out);
  6116. -#ifdef NFS41_DRIVER_WSL_SUPPORT
  6117. -void nfs_to_stat_info(
  6118. -    IN const char *restrict name,
  6119. -    IN const nfs41_superblock *restrict superblock,
  6120. -    IN const nfs41_file_info *restrict info,
  6121. -    OUT PFILE_STAT_INFORMATION restrict stat_out);
  6122. -void nfs_to_stat_lx_info(
  6123. -    IN void *daemon_context,
  6124. -    IN const char *restrict name,
  6125. -    IN const nfs41_superblock *restrict superblock,
  6126. -    IN const nfs41_file_info *restrict info,
  6127. -    OUT PFILE_STAT_LX_INFORMATION restrict stat_lx_out);
  6128. -#endif /* NFS41_DRIVER_WSL_SUPPORT */
  6129. -
  6130. -/* Copy |info->symlink_dir| */
  6131. -#define NFS41FILEINFOCPY_COPY_SYMLINK_DIR (1 << 0)
  6132. -void nfs41_file_info_cpy(
  6133. -    OUT nfs41_file_info *restrict dest,
  6134. -    IN const nfs41_file_info *restrict src,
  6135. -    IN int flags);
  6136. -
  6137.  /* http://msdn.microsoft.com/en-us/library/ms724290%28VS.85%29.aspx:
  6138.   * A file time is a 64-bit value that represents the number of
  6139.   * 100-nanosecond intervals that have elapsed since 12:00 A.M.
  6140. --
  6141. 2.45.1
  6142.  
  6143. From 65932391d7577fa8b0628155b8835d7d0530c49f Mon Sep 17 00:00:00 2001
  6144. From: Dan Shelton <dan.f.shelton@gmail.com>
  6145. Date: Fri, 30 May 2025 16:18:14 +0200
  6146. Subject: [PATCH 5/5] daemon: Fix ARM64 "Arithmetic overflow: Using operator
  6147.  '+' on a 4 byte value and then casting the result to a 8 byte value."
  6148.  warnings
  6149.  
  6150. Fix ARM64 "Arithmetic overflow: Using operator '+' on a 4 byte value and
  6151. then casting the result to a 8 byte value." warnings.
  6152.  
  6153. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  6154. ---
  6155. daemon/acl.c | 6 +++---
  6156.  1 file changed, 3 insertions(+), 3 deletions(-)
  6157.  
  6158. diff --git a/daemon/acl.c b/daemon/acl.c
  6159. index 0d90bc2..ecf6156 100644
  6160. --- a/daemon/acl.c
  6161. +++ b/daemon/acl.c
  6162. @@ -1121,14 +1121,14 @@ add_domain:
  6163.  
  6164.  #ifdef NFS41_DRIVER_WS2022_HACKS
  6165.      /* Fixup |domain| for Windows Sever 2022 NFSv4.1 server */
  6166. -    if ((!strncmp(who_out, "Users@", who_size+1)) ||
  6167. -        (!strncmp(who_out, "Administrators@", who_size+1))) {
  6168. +    if ((!strncmp(who_out, "Users@", (size_t)who_size+1)) ||
  6169. +        (!strncmp(who_out, "Administrators@", (size_t)who_size+1))) {
  6170.          domain = "BUILTIN";
  6171.          DPRINTF(1,
  6172.              ("map_sid2nfs4ace_who: Fixup '%.*s' domain='%s'\n",
  6173.              (int)who_size+1, who_out, domain));
  6174.      }
  6175. -    else if (!strncmp(who_out, "SYSTEM@", who_size+1)) {
  6176. +    else if (!strncmp(who_out, "SYSTEM@", (size_t)who_size+1)) {
  6177.          domain = "NT AUTHORITY";
  6178.          DPRINTF(1,
  6179.              ("map_sid2nfs4ace_who: Fixup '%.*s' domain='%s'\n",
  6180. --
  6181. 2.45.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