- From 7185a9a957a2908872e2bcc9328f241f74edeae5 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 30 May 2025 14:18:55 +0200
- Subject: [PATCH 1/5] README.md,README.html,cygwin,docs: Convert and merge
- various READMEs into one DocBook document
- Convert and merge various READMEs into one DocBook/XML document,
- which is then used to generate the MD and HTML output
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- README.html | 174 ------
- README.md | 1046 ++++++++++++++++++++++++++++++----
- cygwin/Makefile | 40 +-
- cygwin/README.bintarball.txt | 685 ----------------------
- cygwin/README.txt | 150 -----
- docs/README.xml | 963 +++++++++++++++++++++++++++++++
- 6 files changed, 1936 insertions(+), 1122 deletions(-)
- delete mode 100644 README.html
- delete mode 100644 cygwin/README.bintarball.txt
- delete mode 100644 cygwin/README.txt
- create mode 100644 docs/README.xml
- diff --git a/README.html b/README.html
- deleted file mode 100644
- index b62af39..0000000
- --- a/README.html
- +++ /dev/null
- @@ -1,174 +0,0 @@
- -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- -<html xmlns="http://www.w3.org/1999/xhtml">
- -<head>
- - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- - <title>Windows NFS 4.2 Client Instructions</title>
- - <link rel="stylesheet" title="CITI Default" href="http://www.citi.umich.edu/format/citi.css" type="text/css"/>
- - <link rel="icon" href="http://www.citi.umich.edu/images/citilogo-16x16.png" type="image/png"/>
- - <link rel="shortcut icon" href="http://www.citi.umich.edu/images/citilogo-16x16.png" type="image/png"/>
- - <style type="text/css">
- - /*<![CDATA[*/
- - body { min-width: 600px; background-color: #DDDDFF; font-family: serif; }
- - #page { padding: 0 12px 0 12px; }
- - #content { margin: 12px 0 12px 0; padding: 8px; background-color: #FFFFFF; border: 1px solid #88A; }
- - #index { padding-right: 12px; float: right; background-color: #FFFFFF; border: 1px solid #88A; }
- - a { color: #0282b4; }
- - a:hover { color: #0244b4; }
- - h1 { font-size: 2em; text-align: center; background: none; }
- - h2 { margin: 24px 0 8px 0; font-variant: small-caps; border-bottom: 1px dashed #88A; }
- - h3 { margin-left: 8px; }
- - /*]]>*/
- - </style>
- -</head>
- -<body>
- -<div id="page">
- -<h1>Windows NFS 4.2 Client Instructions</h1>
- -<div id="content">
- -<div id="index">
- -<ol>
- - <li><a href="#build">Building from Source</a></li>
- - <li><a href="#install">Installing Binaries</a></li>
- - <li><a href="#dfs">Disable the DFS Client</a></li>
- - <li><a href="#ldap">Ldap Configuration</a></li>
- - <li><a href="#startup">Starting the Client</a></li>
- - <li><a href="#mount">Mounting</a></li>
- - <li><a href="#cthon">Connectation</a></li>
- - <li><a href="#issues">Known Issues</a></li>
- -</ol>
- -</div>
- -<h2>1. <a name="build">Building from Source</a></h2>
- -<h3>Requirements</h3>
- -<ul>
- - <li>Windows Vista, Windows Server 2008 R2, or Windows 7 (Windows XP and previous versions are not supported)</li>
- - <li>Microsoft Visual Studio 2010</li>
- - <li>Windows Driver Development Kit (WinDDK 6000 or later)</li>
- - <li>ms-nfs41-client source code:
- - <br/><code>> git clone git://citi.umich.edu/projects/ms-nfs41-client.git</code></li>
- -</ul>
- -<h3>Building the rpc library and nfs client daemon</h3>
- -<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>
- -<ol>
- - <li>Open Windows Explorer and navigate to <strong>ms-nfs41-client\build.vc10</strong>.</li>
- - <li>Make a copy of <strong>env.props.example</strong>, and rename it to <strong>env.props</strong>.</li>
- - <li>Open <strong>env.props</strong> in a text editor, and verify that the value in <code><WDKPATH>C:\WinDDK\7600.16385.0</WDKPATH></code> points to your WinDDK installation.</li>
- - <li>Open the solution file <strong>ms-nfs41-client.sln</strong> in Visual Studio 2010.</li>
- - <li>Select the desired configuration and platform (accessible via Build->Configuration Manager).</li>
- - <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>
- -</ol>
- -<h3>Building the driver and utilities</h3>
- -<ol>
- - <li>From the Start menu, open the WinDDK 'Checked Build Environment' for the target platform.</li>
- - <li>Change directory to <strong>ms-nfs41-client</strong> and type <code>build</code>. All projects should build without errors.</li>
- -</ol>
- -<h3>Signing the driver</h3>
- -<ol>
- - <li>Open a WinDDK 'Checked Build Environment' as Administrator in this directory (right click and 'Run as administrator').</li>
- - <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>):
- - <br/><code>> makecert /pe /ss PrivateCertStore /n CN=nfs41_driver nfs41_driver.cer</code></li>
- - <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>):
- - <br/><code>> signtool sign /v /s PrivateCertStore /n nfs41_driver /t http://timestamp.verisign.com/scripts/timestamp.dll path\to\nfs41_driver.sys</code></li>
- -</ol>
- -<h2>2. <a name="install">Installing Binaries</a></h2>
- -<h3>Requirements</h3>
- -<ul>
- - <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>
- - <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>
- - <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>
- -</ul>
- -<h3>Instructions</h3>
- -<ol>
- - <li>Copy or extract all ms-nfs41-client binaries and configuration files into a directory that's convenient for testing.</li>
- - <li>Run <strong>vcredist_x*.exe</strong> to install the Visual C++ Redistributable Libraries.</li>
- - <li>Double-click on <strong>nfs41_driver.cer</strong> and select 'Install Certificate', then place it in the 'Trusted Root Certificate Authorities' store.</li>
- - <li>Open a command prompt as Administrator in this directory.</li>
- - <li>Install the driver and update the registry:
- - <br/><code>> install.bat</code></li>
- - <li>Copy configuration files:
- - <br/><code>> mkdir C:\etc</code>
- - <br/><code>> copy etc_netconfig C:\etc\netconfig</code>
- - <br/><code>> copy ms-nfs41-idmap.conf C:\etc\</code></li>
- - <li>Allow windows to load test-signed drivers:
- - <br/><code>> bcdedit /set testsigning on</code></li>
- - <li>Reboot.</li>
- -</ol>
- -<h2>3. <a name="dfs">Disable the DFS Client</a></h2>
- -<ul>
- - <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>
- -</ul>
- -<h3>Instructions</h3>
- -<ol>
- - <li>Open <strong>regedit.exe</strong> and navigate to <code>HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Mup</code>.</li>
- - <li>Add a DWORD value named <code>DisableDfs</code> with a value of 1.</li>
- -</ol>
- -<h2>4. <a name="ldap">Ldap Configuration</a></h2>
- -<h3>Requirements:</h3>
- -<ul>
- - <li><strong>C:\etc\ms-nfs41-idmap.conf</strong> from <a href="#install">Installation</a> step 7.</li>
- -</ul>
- -<h3>Instructions</h3>
- -<ol>
- - <li>Open <strong>C:\etc\ms-nfs41-idmap.conf</strong> in a text editor.</li>
- - <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>
- -</ol>
- -<h2>5. <a name="startup">Starting the Client</a></h2>
- -<ul>
- - <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>> nfsd.exe -install</code>.</li>
- -</ul>
- -<h3>Instructions</h3>
- -<ol>
- - <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.
- - <br/>Usage:
- - <br/><code>> nfsd.exe -d <debug level> [--noldap]</code>
- - <ul>
- - <li><code><debug level></code> determines the log verbosity (1, 2, 3 or 0 to disable)</li>
- - <li><code>--noldap</code> disables id mapping and uses a default uid=666 and gid=777</li>
- - <li><code>--uid, --gid</code> changes the default uid/gid when no mapping is available (must be nonzero)</li>
- - </ul></li>
- -</ol>
- -<h2>6. <a name="mount">Mounting</a></h2>
- -<h3>Instructions</h3>
- -<ol>
- - <li>From a Windows command prompt run <strong>nfs_mount.exe</strong> to mount a share:
- - <br/><code>> nfs_mount.exe Z: <server_name>:\</code></li>
- - <li>To specify the security flavor, add the 'sec=' mount option with sys, krb5, krb5i, or krb5p:
- - <br/><code>> nfs_mount.exe -o sec=<flavor> Z: <server_name>:\</code></li>
- - <li>You can later unmount with:
- - <br/><code>> nfs_mount.exe -d Z</code></li>
- -</ol>
- -<h2>7. <a name="cthon">Connectathon</a></h2>
- -<h3>Requirements</h3>
- -<ul>
- - <li><a href="http://www.cygwin.com" title="www.cygwin.com">Cygwin</a>, including packages gcc-core, make, time, tirpc, git</li>
- - <li><a href="http://www.connectathon.org/nfstests.html" title="www.connectathon.org">Connectathon Test Suite</a></li>
- - <li>ms-nfs41-client source code (patches for connectathon are located in <strong>ms-nfs41-client\tests</strong>)</li>
- -</ul>
- -<h3>Instructions</h3>
- -<ol>
- - <li>Extract <strong>nfstests.zip</strong> into a directory that's convenient for testing (i.e. <strong>cthon04</strong>).</li>
- - <li>Open a Cygwin shell, and change directory to <strong>cthon04</strong>.</li>
- - <li>Create a git repository to track changes:
- - <br/><code>> git init</code>
- - <br/><code>> git add *</code>
- - <br/><code>> git commit -m "files from nfstests.zip"</code></li>
- - <li>Apply all cthon patches:
- - <br/><code>> git am /path/to/ms-nfs41-client/tests/*.patch</code></li>
- - <li>Build the tests:
- - <br/><code>> make</code></li>
- - <li>Run the test suite on a mounted directory:
- - <br/><code>> ./runtests -a -t z:/testdir</code></li>
- -</ol>
- -<h2>8. <a name="issues">Known Issues</a></h2>
- -<ul>
- - <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>
- - <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>
- - <li>If nfsd.exe is restarted while a drive is mapped, that drive needs to be remounted before further use.</li>
- - <li>Symbolic links are not supported in Cygwin. Connectathon's basic test8 and special test nfsidem have been commented out.</li>
- - <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>
- - <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>
- -</ul>
- -<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>
- -</div>
- -</div>
- -</body>
- -</html>
- \ No newline at end of file
- diff --git a/README.md b/README.md
- index 71b0448..72144eb 100644
- --- a/README.md
- +++ b/README.md
- @@ -1,149 +1,981 @@
- +---
- +title: Windows NFS 4.2 FileSystem Client Instructions
- +---
- -# Windows NFS 4.2 Client Instructions
- +- [What is this ?](#what-is-this)
- +- [Features](#features)
- +- [Requirements](#requirements)
- +- [Installation](#installation)
- + - [Download and install Cygwin (if not installed
- + yet)](#download-install-cygwin)
- + - [Download and install MSYS2/64bit
- + \[OPTIONAL\]](#download-install-msys2)
- + - [Download "ms-nfs41-client" installation
- + tarball](#download-msnfs41client-tarball)
- + - [Installation (as "Administrator")](#installation-via-cygwin)
- + - [Deinstallation](#deinstallation)
- +- [Usage](#usage)
- + - [Preparing the NFS server](#prep_nfs_server)
- + - [NFS server config](#nfs_server_config)
- + - [User/group accounts on the NFS server](#nfs_server_accounts)
- + - [Starting the NFS client daemon](#starting_nfs_daemon)
- + - [Run as Windows Service](#run_as_windows_service)
- + - [Manual starting the daemon](#manual_start)
- + - [Mounting and using NFS filesystems](#mounting_and_using)
- + - [Basic usage](#basic_usage)
- + - [Global/System-wide mounts](#global-system-wide-mounts)
- + - [WSL usage](#wsl-usage)
- +- [Notes](#notes)
- +- [Known issues](#known-issues)
- +- [Troubleshooting && finding
- + bugs/debugging](#troubleshooting-debugging)
- +- [Development](#development)
- + - [Source code](#source-code)
- + - [Building ms-nfs41-client](#building_msnfs41client)
- + - [Building ms-nfs41-client using
- + Cygwin+Makefile](#building-cygwin-makefile)
- + - [Testing](#testing)
- +- [Mailing list](#mailinglist)
- -1. [Building from Source](#build)
- -2. [Installing Binaries](#install)
- -3. [Disable the DFS Client](#dfs)
- -4. [Ldap Configuration](#ldap)
- -5. [Starting the Client](#startup)
- -6. [Mounting](#mount)
- -7. [Connectation](#cthon)
- -8. [Known Issues](#issues)
- +# What is this ?
- +NFSv4.2/NFSv4.1 filesystem driver for Windows 10/11 & Windows Server
- +2019+2022
- -## 1\. <a name="build">Building from Source</a>
- +# Features
- -### Requirements
- +- Full NFSv4.2/NFSv4.1 protocol support
- -* Windows Vista, Windows Server 2008 R2, or Windows 7 (Windows XP and previous versions are not supported)
- -* Microsoft Visual Studio 2010
- -* Windows Driver Development Kit (WinDDK 6000 or later)
- -* ms-nfs41-client source code:
- - `> https://github.com/kofemann/ms-nfs41-client.git`
- +- idmapper (mapping usernames and uid/gid values between server and
- + client)
- -### Building the rpc library and nfs client daemon
- +- Support for custom ports (NFSv4 defaults to TCP port 2049, this client
- + can use different ports per mount)
- -* WinDDK does not include the ldap library, so we build the rpc library and nfs client daemon with Visual Studio 2010.
- +- Support for `nfs://`-URLs
- -1. Open Windows Explorer and navigate to **ms-nfs41-client\build.vc10**.
- -2. Make a copy of **env.props.example**, and rename it to **env.props**.
- -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.
- -4. Open the solution file **ms-nfs41-client.sln** in Visual Studio 2010.
- -5. Select the desired configuration and platform (accessible via Build->Configuration Manager).
- -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\**.
- + - Why? `nfs://`-URLs are cross-platform, portable and
- + Character-Encoding independent descriptions of NFSv4 server
- + resources (exports).
- -### Building the driver and utilities
- + - including custom ports and raw IPv6 addresses
- -1. From the Start menu, open the WinDDK 'Checked Build Environment' for the target platform.
- -2. Change directory to **ms-nfs41-client** and type `build`. All projects should build without errors.
- + - `nfs://`-URL conversion utility (`/usr/bin/nfsurlconv`) to convert
- + URLs, including non-ASCII/Unicode characters in mount path
- -### Signing the driver
- +- Support ssh forwarding, e.g., mounting NFSv4 filesystems via ssh
- + tunnel
- -1. Open a WinDDK 'Checked Build Environment' as Administrator in this directory (right click and 'Run as administrator').
- -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")):
- - `> makecert /pe /ss PrivateCertStore /n CN=nfs41_driver nfs41_driver.cer`
- -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")):
- - `> signtool sign /v /s PrivateCertStore /n nfs41_driver /t http://timestamp.verisign.com/scripts/timestamp.dll path\to\nfs41_driver.sys`
- +- Support for long paths (up to 4096 bytes), no Windows MAXPATH limit
- -## 2\. <a name="install">Installing Binaries</a>
- +- Unicode support
- -### Requirements
- + - File names can use any Unicode character supported by the NFS
- + server's filesystem.
- -* ms-nfs41-client binaries: **nfs41_driver.sys**, **nfs41_np.dll**, **libtirpc.dll**, **nfs_install.exe**, **nfsd.exe**, **nfs_mount.exe**
- -* ms-nfs41-client configuration files: **nfs41_driver.cer**, **nfs41rdr.inf**, **install.bat**, **uninstall.bat**, **etc_netconfig**, **ms-nfs41-idmap.conf**
- -* 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.
- + - `nfs://`-URLs can be used to mount filesystems with non-ASCII
- + characters in the mount path, independent of current locale.
- -### Instructions
- +- UNC paths
- -1. Copy or extract all ms-nfs41-client binaries and configuration files into a directory that's convenient for testing.
- -2. Run **vcredist_x*.exe** to install the Visual C++ Redistributable Libraries.
- -3. Double-click on **nfs41_driver.cer** and select 'Install Certificate', then place it in the 'Trusted Root Certificate Authorities' store.
- -4. Open a command prompt as Administrator in this directory.
- -5. Install the driver and update the registry:
- - `> install.bat`
- -6. Copy configuration files:
- - `> mkdir C:\etc`
- - `> copy etc_netconfig C:\etc\netconfig`
- - `> copy ms-nfs41-idmap.conf C:\etc\`
- -7. Allow windows to load test-signed drivers:
- - `> bcdedit /set testsigning on`
- -8. Reboot.
- + - Mounting UNC paths without DOS drive letter
- -## 3\. <a name="dfs">Disable the DFS Client</a>
- + - IPv6 support in UNC paths
- -* 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.
- + - `/sbin/nfs_mount` prints UNC paths in Win32+Cygwin/MSYS2 formats
- -### Instructions
- + - Cygwin/MSYS2 bash+ksh93 support UNC paths, e.g.,
- + `cd //derfwnb4966@2049/nfs4/bigdisk/mysqldb4/`
- -1. Open **regedit.exe** and navigate to `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Mup`.
- -2. Add a DWORD value named `DisableDfs` with a value of 1.
- + - Symlinks on NFS can redirect to other filesystems via UNC syntax and
- + work with Cygwin, MSYS2, cmd.exe, powershell etc., e.g.:
- -## 4\. <a name="ldap">Ldap Configuration</a>
- + mklink /D symlnk1_to_h_tmp \\lab17@2049\nfs4\export\home\rsm\tmp
- -### Requirements:
- +- WSL support
- -* **C:\etc\ms-nfs41-idmap.conf** from [Installation](#install) step 7.
- + - Mount Windows NFSv4.2 shares via drive letter or UNC path in WSL via
- + `mount -t drvfs`
- -### Instructions
- + - Supports NFS owner/group to WSL uid/gid mapping
- -1. Open **C:\etc\ms-nfs41-idmap.conf** in a text editor.
- -2. Uncomment the `ldap_hostname` and `ldap_base` lines, and configure as appropriate to match your ldap server configuration (we'll add suggestions later).
- +- IPv6 support
- -## 5\. <a name="startup">Starting the Client</a>
- + - IPv6 address within '\[', '\]' (will be converted to
- + \*.ipv6-literal.net)
- -* 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:
- - `> nfsd.exe -install`.
- +- Windows ACLs \<---\> NFSv4 ACL translation
- -### Instructions
- + - Win32 `C:\Windows\system32\icacls.exe`
- -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.
- - Usage:
- - `> nfsd.exe -d <debug level> [--noldap]`
- - * `<debug level>` determines the log verbosity (1, 2, 3 or 0 to disable)
- - * `--noldap` disables id mapping and uses a default uid=666 and gid=777
- - * `--uid, --gid` changes the default uid/gid when no mapping is available (must be nonzero)
- + - Cygwin `/usr/bin/setfacl`+`/usr/bin/getfacl`
- -## 6\. <a name="mount">Mounting</a>
- + - Windows Explorer ACL dialog
- -### Instructions
- +- Sparse file support
- -1. From a Windows command prompt run **nfs_mount.exe** to mount a share:
- - `> nfs_mount.exe Z: <server_name>:\`
- -2. To specify the security flavor, add the 'sec=' mount option with sys, krb5, krb5i, or krb5p:
- - `> nfs_mount.exe -o sec=<flavor> Z: <server_name>:\`
- -3. You can later unmount with:
- - `> nfs_mount.exe -d Z`
- + - Requires NFSv4.2 server which supports the NFSv4.2 operations
- + "ALLOCATE", "DEALLOCATE", "SEEK", and the
- + `|FATTR4_WORD1_SPACE_USED|` attribute.
- -## 7\. <a name="cthon">Connectathon</a>
- + - Full Win32 sparse file API support, including creation, punching
- + holes, enumeration of hole&data ranges etc.
- -### Requirements
- + - Supports Win32 APIs `|FSCTL_QUERY_ALLOCATED_RANGES|`,
- + `|FSCTL_SET_SPARSE|`, `|FSCTL_SET_ZERO_DATA|`; and
- + `|NfsV3Attributes.used|` EA
- -* [Cygwin](http://www.cygwin.com "www.cygwin.com"), including packages gcc-core, make, time, tirpc, git
- -* [Connectathon Test Suite](https://git.linux-nfs.org/?p=steved/cthon04.git;a=summary "git.linux-nfs.org")
- -* ms-nfs41-client source code (patches for connectathon are located in **ms-nfs41-client\tests**)
- + - Cygwin sparse file support requires \>= Cygwin 3.6 to support
- + POSIX-1.2024 `|lseek(...,SEEK_HOLE/SEEK_DATA,...)|`, which is needed
- + for coreutils `/usr/bin/fallocate` and
- + `$ /usr/bin/cp --sparse=auto src dest #`
- -### Instructions
- + - `/cygdrive/c/Windows/system32/fsutil sparse queryrange myfile.dat`
- + 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)
- -1. Extract **nfstests.zip** into a directory that's convenient for testing (i.e. **cthon04**).
- -2. Open a Cygwin shell, and change directory to **cthon04**.
- -3. Create a git repository to track changes:
- - `> git init`
- - `> git add *`
- - `> git commit -m "files from nfstests.zip"`
- -4. Apply all cthon patches:
- - `> git am /path/to/ms-nfs41-client/tests/*.patch`
- -5. Build the tests:
- - `> make`
- -6. Run the test suite on a mounted directory:
- - `> ./runtests -a -t z:/testdir`
- + - `/cygdrive/c/Windows/system32/xcopy /sparse` can be used to copy
- + sparse files. Requires on Win11 \>= 22H2 because it relies on
- + `|CopyFile2()|` flag `|COPY_FILE_ENABLE_SPARSE_COPY|`.
- -## 8\. <a name="issues">Known Issues</a>
- +- Block cloning support
- -* krb5p security with AES keys do not work against the linux server, as it does not support gss krb5 v2 tokens with rotated data.
- -* 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.
- -* If nfsd.exe is restarted while a drive is mapped, that drive needs to be remounted before further use.
- -* Symbolic links are not supported in Cygwin. Connectathon's basic test8 and special test nfsidem have been commented out.
- -* Does not allow renaming a file on top of an existing open file. Connectathon's special test op_ren has been commented out.
- -* 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.
- + - Implemented via Win32 `|FSCTL_DUPLICATE_EXTENTS_TO_FILE|` to clone
- + file blocks from src to dst within the same filesystem.
- -Please direct any questions to [ms-nfs41-client-devel@lists.sourceforge.net](mailto:ms-nfs41-client-devel@lists.sourceforge.net).
- + - 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)
- +
- + - Sparse files are correctly cloned, including all hole and data
- + ranges
- +
- + - `/usr/bin/winclonefile.exe` can be used to clone a file
- +
- + - Windows 11 `|CopyFile2()|` API uses
- + `|FSCTL_DUPLICATE_EXTENTS_TO_FILE|` by default
- +
- + - Windows 11 tools like xcopy.exe, robocopy etc. all use
- + `|CopyFile2()|`, and therefore file cloning by default
- +
- +- Symlink reparse and translation support
- +
- + - Translates Win32/NT symlink syntax (e.g.
- + `$ mklink /D ... Y:\tmp\ #`) to NFS/POSIX syntax (e.g.
- + "`/cygdrive/y/tmp/`") and back
- +
- + - Translates Cygwin `/cygdrive/<devletter>` symlinks on NFS to Win32
- + `<devletter>:\` and back
- +
- + - Pass-through for NFS `/dev-Symlinks` (e.g. `/dev/null`) to Cygwin
- +
- + - Interoperability for symlinks between Cygwin, powershell, cmd.exe
- + and other POSIX-compatible NFSv4.2/NFSv4.1 clients.
- +
- +- Support for NFSv4 public mounts (i.e., use the NFSv4 public file
- + handle lookup protocol via `$ nfs_mount -o public ... #`)
- +
- +- Support for NFSv4 referrals
- +
- + - See Linux `export(5) refer=` option, `nfsref(5)` or
- + <https://docs.oracle.com/cd/E86824_01/html/E54764/nfsref-1m.html>
- +
- +- SFU/Cygwin/MSYS2 support, including:
- +
- + - POSIX uid/gid+mode
- +
- + - Backwards compatibility to Microsoft's NFSv3 driver
- +
- + - Cygwin ACLs, e.g., `setfacl`/`getfacl`
- +
- + - Cygwin/MSYS2 symlinks
- +
- +- Custom primary group support
- +
- + - Supports primary group changes in the calling process/thread (via
- + `|SetTokenInformation(..., TokenPrimaryGroup,...)|`), 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.
- +
- + - `newgrp(1)`/`sg(1)`-style "winsg" utility to run cmd.exe with
- + different primary group, e.g.,
- + `$ winsg [-] -g group [-c command | /C command] #`
- +
- +- Software compatibility:
- +
- + - Any NFSv4.2/NFSv4.1 server (Linux, Solaris, Illumos, FreeBSD, nfs4j,
- + ...)
- +
- + - All tools from Cygwin/MSYS2/MinGW
- +
- + - Visual Studio
- +
- + - VMware Workstation (can use VMs hosted on NFSv4.2/NFSv4.1
- + filesystem)
- +
- +# Requirements
- +
- +- Windows 10 (32bit or 64bit), Windows 11 or Windows Server 2019+2022
- +
- +- Cygwin:
- +
- + - Cygwin versions:
- +
- + - 64bit: \>= 3.5.7, recommended \>= 3.6.1
- +
- + - 32bit: \>= 3.3.6
- +
- + - Packages (required):
- +
- + - `cygwin`
- +
- + - `cygrunsrv`
- +
- + - `cygutils`
- +
- + - `cygutils-extra`
- +
- + - `libiconv`
- +
- + - `libiconv2`
- +
- + - `procps-ng`
- +
- + - `util-linux`
- +
- + - Packages (optional, recommended, required to build ms-nf41-client):
- +
- + - `bison`
- +
- + - `cygport`
- +
- + - `cygwin-devel`
- +
- + - `clang`
- +
- + - `dos2unix`
- +
- + - `pax`
- +
- + - `pbzip2`
- +
- + - `libnfs-utils` (for `/usr/bin/nfs-ls`)
- +
- + - `libiconv-devel`
- +
- + - `make`
- +
- + - `bmake`
- +
- + - `git`
- +
- + - `gcc-core`
- +
- + - `gcc-g++`
- +
- + - `gdb`
- +
- + - `mingw64-i686-clang`
- +
- + - `mingw64-x86_64-clang`
- +
- + - `unzip`
- +
- + - `time`
- +
- + - `docbook-utils`
- +
- + - `docbook-xml45`
- +
- + - `docbook-xsl`
- +
- + - `docbook-xsl-ns`
- +
- + - `libxslt`
- +
- + - `w3m`
- +
- + - Packages (only-CI):
- +
- + - \# required packages, but part of Cygwin default installation
- +
- + - \# listed here for CI package list ONLY
- +
- + - `bash`
- +
- + - `bzip2`
- +
- + - `coreutils`
- +
- + - `getent`
- +
- + - `grep`
- +
- + - `hostname`
- +
- + - `less`
- +
- + - `sed`
- +
- + - `tar`
- +
- + - `wget`
- +
- +- MSYS2 (64bit, optional):
- +
- + - Packages (recommended):
- +
- + - `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`
- +
- +# Installation
- +
- +## Download and install Cygwin (if not installed yet)
- +
- +Windows 32bit-vs.-64bit can be tested from Windows `cmd.exe` console:
- +
- +Run this command:
- +
- + echo %PROCESSOR_ARCHITECTURE%
- +
- +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.
- +
- +Cygwin 64bit can be installed like this:
- +
- +**Install Cygwin 64bit on Windows 64bit with packages required by
- +"ms-nfs41-client" (Windows NFSv4.2 client):**
- +
- +1. Create subdir
- +
- + mkdir download
- + cd download
- +
- +2. Get installer from <https://cygwin.com/setup-x86_64.exe>
- +
- + curl --remote-name "https://www.cygwin.com/setup-x86_64.exe"
- +
- +3. Run installer with these arguments:
- +
- + 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
- +
- +Cygwin 32bit can be installed like this:
- +
- +**Install Cygwin 32bit on Windows 32bit with packages required by
- +"ms-nfs41-client" (Windows NFSv4.2 client):**
- +
- +1. Create subdir
- +
- + mkdir download
- + cd download
- +
- +2. Get installer from <https://www.cygwin.com/setup-x86.exe>
- +
- + curl --remote-name "https://www.cygwin.com/setup-x86.exe"
- +
- +3. Run installer with these arguments:
- +
- + 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
- +
- +## Download and install MSYS2/64bit \[OPTIONAL\]
- +
- +1. Download & install from Cygwin
- +
- + mkdir -p download && cd download
- + wget 'https://github.com/msys2/msys2-installer/releases/download/2025-02-21/msys2-x86_64-20250221.exe'
- + chmod a+x 'msys2-x86_64-20250221'
- + ./msys2-x86_64-20250221 --default-answer --root 'C:\msys64' install
- +
- +2. Install extra packages:
- +
- + Start MSYS2 UCRT mintty and execute this:
- +
- + 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
- +
- +## Download "ms-nfs41-client" installation tarball
- +
- +(from a Cygwin terminal)
- +
- + $ mkdir -p ~/download
- + $ cd ~/download
- + $ wget 'http://www.nrubsig.org/people/gisburn/work/msnfs41client/releases/testing/${bintarball.base_filename}.tar.bz2'
- + $ openssl sha256 "${bintarball.base_filename}.tar.bz2"
- + SHA2-256(${bintarball.base_filename}.tar.bz2)= ${bintarball.archive_sha256hash}
- +
- +## Installation (as "Administrator")
- +
- + $ (cd / && tar -xf ~/download/${bintarball.base_filename}.tar.bz2 )
- + $ /sbin/msnfs41client install
- + <REBOOT>
- +
- +## Deinstallation
- +
- + $ (set -o xtrace ; cd / && tar -tf ~/download/${bintarball.base_filename}.tar.bz2 | while read i ; do [[ -f "$i" ]] && rm "$i" ; done)
- + <REBOOT>
- +
- +# Usage
- +
- +## Preparing the NFS server
- +
- +### NFS server config
- +
- +- Make sure the NFS client can access the NFS server
- +
- +- The NFS server should send owner and owner_group information as
- + user@domain and group@domain, and not as numeric uid/gid information
- +
- +### User/group accounts on the NFS server
- +
- +It is required that all Windows users and groups used by the Windows NFS
- +client have user/group accounts on the server side.
- +
- +If no central user&group management between NFS server and NFS clients
- +exists the `/sbin/cygwinaccount2nfs4account` script can be used to
- +manually create matching `/etc/group` and `/etc/passwd` entries on the
- +NFS server side.
- +
- +## Starting the NFS client daemon
- +
- +### Run as Windows Service
- +
- +- Start NFSv4 client daemon as Windows service (requires "Administrator"
- + account):
- +
- + $ sc start ms-nfs41-client-service
- +
- +- Notes:
- +
- + - requires "Administrator" account, and one nfsd client daemon is used
- + for all users on a machine.
- +
- + - The "ms-nfs41-client-service" service is installed by default as
- + "disabled" and therefore always requires a "manual" start (e.g.,
- + `$ sc start ms-nfs41-client-service #`)
- +
- + - DOS devices are virtualised per LSA Logon, so each Logon needs to do
- + a separate `nfs_mount.exe` to mount a NFSv4 share. The exception are
- + mounts created by user "SYSTEM", such mounts are available to all
- + users/logons. (see `PsExec` or function "su_system" in
- + `msnfs41client.bash` how to run a process as user "SYSTEM")
- +
- + - `nfsd_debug.exe` will run as user "SYSTEM", but will do user
- + impersonation for each request
- +
- + - stopping the service will NOT unmount filesystems, and due to a bug
- + a reboot is required to restart and mount any NFSv4 filesystems
- + again
- +
- +- Administration:
- +
- + - Follow new log messages:
- +
- + $ tail -f '/var/log/ms-nfs41-client-service.log'
- +
- + - Query service status:
- +
- + $ sc queryex ms-nfs41-client-service
- +
- + - Query service config:
- +
- + $ sc qc ms-nfs41-client-service
- +
- + - Start service automatically:
- +
- + (`nfsd_debug.exe` will be started automagically, but mounts are not
- + restored):
- +
- + $ sc config ms-nfs41-client-service start=auto
- +
- + - Start service manually (default):
- +
- + $ sc config ms-nfs41-client-service start=disabled
- +
- +### Manual starting the daemon
- +
- +Run the NFSv4 client daemon manually:
- +
- +- run this preferably as "Administrator", but this is not a requirement
- +
- +- requires separate terminal
- +
- +<!-- -->
- +
- + $ /sbin/msnfs41client run_daemon
- +
- +## Mounting and using NFS filesystems
- +
- +### Basic usage
- +
- +Mount a filesystem to drive N: and use it
- +
- + $ /sbin/nfs_mount -o rw N 10.49.202.230:/net_tmpfs2
- + Successfully mounted '10.49.202.230@2049' to drive 'N:'
- + $ cd /cygdrive/n/
- + $ ls -la
- + total 4
- + drwxrwxrwt 5 Unix_User+0 Unix_Group+0 100 Dec 7 14:17 .
- + dr-xr-xr-x 1 roland_mainz Kein 0 Dec 14 13:48 ..
- + drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 80 Dec 12 16:24 10492030
- + drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 60 Dec 13 17:58 directory_t
- + drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 60 Dec 7 11:01 test2
- +
- +Unmount filesystem:
- +
- + $ cd ~ && /sbin/nfs_umount N:
- + # OR
- + $ cd ~
- + $ net use N: /delete
- +
- +Mount a filesystem WITHOUT a dos drive assigned and use it via UNC path
- +
- + $ /sbin/nfs_mount -o rw 10.49.202.230:/net_tmpfs2
- + Successfully mounted '10.49.202.230@2049' to drive '\0.49.202.230@2049\nfs4\net_tmpfs2'
- + $ cygpath -u '\0.49.202.230@2049\nfs4\net_tmpfs2'
- + //10.49.202.230@2049/nfs4/net_tmpfs2
- + $ cd '//10.49.202.230@2049/nfs4/net_tmpfs2'
- + $ ls -la
- + total 4
- + drwxrwxrwt 5 Unix_User+0 Unix_Group+0 100 Dec 7 14:17 .
- + dr-xr-xr-x 1 roland_mainz Kein 0 Dec 14 13:48 ..
- + drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 80 Dec 12 16:24 10492030
- + drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 60 Dec 13 17:58 directory_t
- + drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 60 Dec 7 11:01 test2
- +
- +Unmount filesystem:
- +
- + $ cd ~ && /sbin/nfs_umount '\0.49.202.230@2049\nfs4\net_tmpfs2'
- + # OR
- + $ cd ~
- + $ net use '\0.49.202.230@2049\nfs4\net_tmpfs2' /delete
- +
- +List mounted NFSv4.2 filesystems:
- +
- + $ /sbin/nfs_mount
- +
- +### Global/System-wide mounts
- +
- +Mounts created by user "SYSTEM" are usable by all users in a system.
- +Example usage:
- +
- + # Create a file /etc/fstab.msnfs41client, which list the mounts
- + # which should be available system-wide
- + $ cat /etc/fstab.msnfs41client
- + nfs://[fe80::21b:1bff:fec3:7713]//bigdisk V nfs rw 0 0
- + # run "ms-nfs41-client-globalmountall-service", which runs
- + # /sbin/mountall_msnfs41client as user "SYSTEM" to read
- + # /etc/fstab.msnfs41client and mount the matching filesystems
- + sc start ms-nfs41-client-globalmountall-service
- +
- +BUG: "ms-nfs41-client-globalmountall-service" currently does not wait
- +until `nfsd*.exe` is available for accepting mounts.
- +
- +### WSL usage
- +
- +Example 1: Mount Windows NFSv4.2 share via Windows drive letter
- +
- +Mount NFSv4.2 share in Windows to drive letter 'N':
- +
- + $ /sbin/nfs_mount -o rw 'N' nfs://10.49.202.230//bigdisk
- + Successfully mounted '10.49.202.230@2049' to drive 'N:'
- +
- +Within WSL mount drive letter 'N' to `/mnt/n`
- +
- + $ sudo bash
- + $ mkdir /mnt/n
- + $ mount -t drvfs N: /mnt/n
- +
- +Example 2: Mount Windows NFSv4.2 share via UNC path:
- +
- +Mount NFSv4.2 share in Windows
- +
- + $ /sbin/nfs_mount -o rw nfs://10.49.202.230//bigdisk
- + Successfully mounted '10.49.202.230@2049' to drive '\0.49.202.230@2049\nfs4\bigdisk'
- +
- +Within WSL mount UNC path returned by `/sbin/nfs_mount`
- +
- + $ sudo bash
- + $ mkdir /mnt/bigdisk
- + $ mount -t drvfs '\0.49.202.230@2049\nfs4\bigdisk' /mnt/bigdisk
- +
- +**Known issues with WSL:**
- +
- +- Softlinks do not work yet
- +
- +- Creating a hard link returns "Invalid Argument", maybe drvfs
- + limitation
- +
- +- Not all POSIX file types (e.g. block devices) etc. are supported
- +
- +# Notes
- +
- +- Idmapping (including uid/gid mapping) between NFSv4 client and NFSv4
- + server works via `/lib/msnfs41client/cygwin_idmapper.ksh`, which
- + either uses builtin static data, or `/usr/bin/getent passwd` and
- + `/usr/bin/getent group`. As `getent` 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.
- +
- +- UNC paths are supported, after successful mounting `/sbin/nfs_mount`
- + will list the paths in Cygwin/MSYS2 UNC format.
- +
- +- 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.
- +
- +- Workflow for `nfs://`-URLs:
- +
- + - Create `nfs://`-URLs with `nfsurlconv`, read `$ nfsurlconv --man #`
- + for usage
- +
- + - pass URL to `nfs_mount.exe` like this:
- + `$ nfs_mount -o sec=sys,rw 'L' nfs://derfwnb4966_ipv4//bigdisk #`
- +
- +- Cygwin/MSYS2 symlinks are supported, but might require
- + `$ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1 #`.
- + This includes symlinks to UNC paths, e.g., as Administrator
- + `$ cmd /c 'mklink /d c:\home\rmainz \\derfwpc5131_ipv6@2049\nfs4\export\home2\rmainz' #`
- + and then `$ cd /cygdrive/c/home/rmainz/ #` should work
- +
- +- performance: All binaries are built without any optimisation, so the
- + filesystem is much slower than it could be.
- +
- +- bad performance due to Windows Defender AntiVirus:
- +
- + - Option 1: disable Windows defender realtime monitoring (requires
- + Administrator shell)
- +
- + powershell -Command 'Set-MpPreference -DisableRealtimeMonitoring 1'
- +
- + - Option 2: Add "`nfsd.exe`", "`nfsd_debug.exe`", "`ksh93.exe`",
- + "`bash.exe`", "`git.exe`" and other offending commands to the
- + process name whitelist.
- +
- +- performance: Use `vmxnet3` in VMware to improve performance
- +
- +- ACLs are supported via the normal Windows ACL tools, but on Linux
- + require the `nfs4_getfacl`/`nfs4_setfacl` utilities to see the data.
- +
- + **Example 1** (assuming that Windows, Linux NFSv4 client and NFSv4
- + server have a user "siegfried_wulsch"):
- +
- + - On Windows on a NFSv4 filesystem:
- +
- + $ icacls myhorribledata.txt /grant "siegfried_wulsch:WD" #
- +
- + - On Linux NFSv4 clients you will then see this:
- +
- + $ nfs4_getfacl myhorribledata.txt
- + A::OWNER@:rwatTcCy
- + A::siegfried_wulsch@global.loc:rwatcy
- + A::GROUP@:rtcy
- + A::EVERYONE@:rtcy
- +
- + **Example 2** (assuming that Windows, Linux NFSv4 client and NFSv4
- + server have a group "cygwingrp2"):
- +
- + - On Windows on a NFSv4 filesystem:
- +
- + $ icacls myhorribledata.txt /grant "cygwingrp2:(WDAC)" /t /c #
- +
- + - On Linux NFSv4 clients you will then see this:
- +
- + $ nfs4_getfacl myhorribledata.txt
- + A::OWNER@:rwatTcCy
- + A::GROUP@:rtcy
- + A:g:cygwingrp2@global.loc:rtcy
- + A::EVERYONE@:rtcy
- +
- +- `nfs_mount.exe` 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
- + \< 1024. If `nfsd.exe`/`nfsd_debug.exe` 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 `/etc/exports` and on Solaris/Illumos
- + using export option "resvport" (see `nfs(5)`).
- +
- +- Accessing mounts from a VMware/QEMU/VirtualBox VM using NAT requires
- + the the "insecure" export option in `/etc/exports` and on
- + Solaris/Illumos using export option "resvport" (see `nfs(5)`), as the
- + NFSv4 client source TCP port will be \>= 1024.
- +
- +- Install: Adding Windows accounts+groups to the NFSv4 server:
- + `ms-nfs41-client` comes with `/sbin/cygwinaccount2nfs4account` 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.
- +
- +- `nfs_mount -o sec=none ... #` works with Solaris 11.4 nfsd, but might
- + require Linux kernel commit
- + <https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git/patch/?id=bb4f07f2409c26c01e97e6f9b432545f353e3b66>
- + ("nfsd: Fix NFSD_MAY_BYPASS_GSS and NFSD_MAY_BYPASS_GSS_ON_ROOT") to
- + work.
- +
- +# Known issues
- +
- +- The kernel driver ("`nfs41_driver.sys`") does not yet have a
- + cryptographic signature for SecureBoot - which means it will only work
- + if SecureBoot is turned off (otherwise
- + `$ /sbin/msnfs41client install #` will FAIL!)
- +
- +- If `nfsd_debug.exe` crashes or gets killed, the only safe way to run
- + it again requires a reboot
- +
- +- LDAP support does not work yet
- +
- +- Attribute caching is too aggressive
- +
- +- Caching in the kernel does not always work. For example
- + `$ tail -f ... #` does not not see new data. Workaround: Use GNU
- + tail'S `$ tail --follow=name ... #` Working theory is that this is
- + related to FCB caching, see `|FCB_STATE_FILESIZECACHEING_ENABLED|`, as
- + the `nfs41_driver.sys` kernel module does not see the `|stat()|`
- + syscalls. But `$ tail -f ... #` always works for a moment if something
- + else opens the same file.
- +
- +- Unmounting and then mounting the same filesystem causes issues as the
- + name cache in `nfsd*.exe` is not flushed on unmount, including
- + leftover delegations.
- +
- +- `krb5p` security with AES keys do not work against the linux server,
- + as it does not support gss krb5 v2 tokens with rotated data.
- +
- +- 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.
- +
- +- If `nfsd.exe` is restarted while a drive is mapped, that drive needs
- + to be remounted before further use.
- +
- +- Does not allow renaming a file on top of an existing open file.
- + Connectathon's special test `op_ren` has been commented out.
- +
- +- File access timestamps might be wrong for delegations.
- +
- +- Extended attributes are supported with some limitations:
- +
- + - a\) the server must support NFS 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`.
- +
- +- Win10/32bit-only: `$ net use H: /delete #` does not work, use
- + `$ nfs_umount 'H'` instead \#
- +
- +- Windows event log can list errors like "MUP 0xc0000222"
- + (`|STATUS_LOST_WRITEBEHIND_DATA|`) in case the disk on the NFSv4
- + server is full and outstanding writes from a memory-mapped file fail.
- + Example:
- +
- + {Fehler beim verzoegerten Schreibvorgang} Nicht alle Daten fuer die
- + Datei "\\34.159.25.153@2049\nfs4\export\nfs4export\gcc\lto-dump.exe"
- + konnten gespeichert werden. Daten gingen verloren.
- + Dieser Fehler wurde von dem Server zurueckgegeben, auf dem sich die
- + Datei befindet. Versuchen Sie, die Datei woanders zu speichern.
- +
- +# Troubleshooting && finding bugs/debugging
- +
- +- `nfsd_debug.exe` has the `-d` option to set a level for debug output.
- + Edit `/sbin/msnfs41client` to set the `"-d"` option.
- +
- +- The "msnfs41client" script has the option "`watch_kernel_debuglog`" to
- + get the debug output of the kernel module.
- +
- + Run as Administrator: `$ /sbin/msnfs41client watch_kernel_debuglog #`
- +
- + Currently requires DebugView
- + (<https://learn.microsoft.com/en-gb/sysinternals/downloads/debugview>)
- + to be installed.
- +
- +- Watching network traffic:
- +
- + - Use `$ /sbin/msnfs41client watch_nfs_traffic #` to watch the NFS
- + network traffic
- +
- + - WireShark has a command line tool called "`tshark`", 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"):
- +
- + $ nfsv4port=2049 ; /cygdrive/c/Program\ Files/Wireshark/tshark \
- + -f "port $nfsv4port" -d "tcp.port==${nfsv4port},rpc" -i Ethernet0
- +
- + - If you are running inside a VMware VM on a Linux host it might
- + require `$ chmod a+rw /dev/vmnet0 #` on VMware host, so that the VM
- + can use "Promiscuous Mode".
- +
- +# Development
- +
- +## Source code
- +
- +Source code can be obtained from
- +<https://github.com/kofemann/ms-nfs41-client> or as git bundle from
- +`/usr/src/msnfs41client/msnfs41client_git.bundle`
- +
- +## Building ms-nfs41-client
- +
- +### Building ms-nfs41-client using Cygwin+Makefile
- +
- +#### Required Software
- +
- +- **Option 1:** Windows 10 with Visual Studio 2019
- +
- + - Start Visual Studio 2019 installer and import the installer config
- + file `ms-nfs41-client/build.vc19/ms-nfs41-client_vs2019.vsconfig`,
- + and then install Visual Studio.
- +
- + > [!NOTE]
- + > 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.
- +
- + - WDK for Windows 10, version 2004, from
- + <https://go.microsoft.com/fwlink/?linkid=2128854>
- +
- + - Cygwin 64bit \>= 3.5.0 (see
- + `ms-nfs41-clientcygwin/README.bintarball.txt` for Cygwin 32bit and
- + 64bit installation instructions)
- +
- + - PanDoc document converter, from
- + <https://github.com/jgm/pandoc/releases/download/3.7.0.1/pandoc-3.7.0.1-windows-x86_64.msi>
- +
- +- **Option 2:** Windows 10/11 with Visual Studio 2022
- +
- + - Start Visual Studio 2022 installer and import the installer config
- + file `ms-nfs41-client/build.vc19/ms-nfs41-client_vs2022.vsconfig`,
- + and then install Visual Studio.
- +
- + > [!NOTE]
- + > 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.
- +
- + - WDK for Windows 11, version 1591, from
- + <https://go.microsoft.com/fwlink/?linkid=2286137>
- +
- + - Cygwin 64bit \>= 3.5.0 (see
- + `ms-nfs41-clientcygwin/README.bintarball.txt` for Cygwin 32bit and
- + 64bit installation instructions)
- +
- + - PanDoc document converter, from
- + <https://github.com/jgm/pandoc/releases/download/3.7.0.1/pandoc-3.7.0.1-windows-x86_64.msi>
- +
- +#### Build the Project
- +
- +- **Using Visual Studio 2019+Cygwin command line (bash/ksh93):**
- +
- + # this creates a 32bit+kernel+64bit-kernel build for Windows 10+11
- + export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/:$PATH"
- + git clone https://github.com/kofemann/ms-nfs41-client.git
- + cd ms-nfs41-client
- + cd cygwin
- + make build
- + make installdest
- + make bintarball
- +
- +- **Using Visual Studio 2022+Cygwin command line (bash/ksh93):**
- +
- + # this creates a 64bit-kernel only build for Windows 11
- + export PATH="/cygdrive/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/:$PATH"
- + git clone https://github.com/kofemann/ms-nfs41-client.git
- + cd ms-nfs41-client
- + # "retarget" VS platform toolset to "v143"
- + # ("v142" should remain the default when comitting)
- + sed -i -E 's/<PlatformToolset>v142<\/PlatformToolset>/<PlatformToolset>v143<\/PlatformToolset>/g' $(find 'build.vc19' -name \*.vcxproj)
- + cd cygwin
- + make build64
- + make installdest64
- + make bintarball64
- +
- +> [!NOTE]
- +> `make installdest` or `make installdest64` can fail on SMB/NFSv4.1
- +> filesystems with a "link.exe" crash. The workaround is to disable
- +> incremental linking before building, e.g., do:
- +>
- +> cd ms-nfs41-client
- +> sed -i -E 's/<LinkIncremental>true<\/LinkIncremental>/<LinkIncremental>false<\/LinkIncremental>/g' $(find build.vc19 -name \*.vcxproj)
- +>
- +> This Visual Studio bug is tracked as
- +> <https://developercommunity.visualstudio.com/t/Visual-Studio-link.exe-crashes-on-networ/10735424>
- +> ("Visual Studio link.exe crashes on network filesystem").
- +
- +### Testing
- +
- +See `tests/manual_testing.txt`
- +
- +# Mailing list
- +
- +Please direct any questions to
- +<ms-nfs41-client-devel@lists.sourceforge.net> (list
- +[archive](https://sourceforge.net/p/ms-nfs41-client/mailman/ms-nfs41-client-devel/))
- +
- +\#EOF.
- diff --git a/cygwin/Makefile b/cygwin/Makefile
- index f2aadb4..c390347 100644
- --- a/cygwin/Makefile
- +++ b/cygwin/Makefile
- @@ -154,7 +154,7 @@ installdest64: \
- # in parallel
- installdest: installdest_util installdest32 .WAIT installdest64
- -bintarball: installdest
- +bintarball: installdest $(PROJECT_BASEDIR_DIR)/README.txt $(PROJECT_BASEDIR_DIR)/README.md
- set -o errexit ; set -o xtrace ; \
- base_filename="msnfs41client_cygwin_64bit32bit_binaries_$$(date +%Y%m%d_%Hh%Mm)_git$$(git rev-parse --short HEAD)" ; \
- ( \
- @@ -167,7 +167,7 @@ bintarball: installdest
- | \
- bzip2 -9 >"$${base_filename}.tar.bz2" ; \
- archive_sha256hash="$$(openssl sha256 -r "$${base_filename}.tar.bz2" | while read a dummy ; do printf "%s\n" "$$a" ; done)" ; \
- - sed -E <"../cygwin/README.bintarball.txt" \
- + sed -E <"../README.txt" \
- -e "s/\\$$\{bintarball.base_filename\}/$${base_filename}/g" \
- -e "s/\\$$\{bintarball.archive_sha256hash\}/$${archive_sha256hash}/g" >"$${base_filename}.readme" \
- ) ; \
- @@ -176,7 +176,7 @@ bintarball: installdest
- ls -l "$(DESTDIR)/$${base_filename}.readme"
- sync
- -bintarball32: installdest32
- +bintarball32: installdest32 $(PROJECT_BASEDIR_DIR)/README.txt $(PROJECT_BASEDIR_DIR)/README.md
- set -o errexit ; set -o xtrace ; \
- base_filename="msnfs41client_cygwin_32bit_binaries_$$(date +%Y%m%d_%Hh%Mm)_git$$(git rev-parse --short HEAD)" ; \
- ( \
- @@ -188,7 +188,7 @@ bintarball32: installdest32
- | \
- bzip2 -9 >"$${base_filename}.tar.bz2" ; \
- archive_sha256hash="$$(openssl sha256 -r "$${base_filename}.tar.bz2" | while read a dummy ; do printf "%s\n" "$$a" ; done)" ; \
- - sed -E <"../cygwin/README.bintarball.txt" \
- + sed -E <"../README.txt" \
- -e "s/\\$$\{bintarball.base_filename\}/$${base_filename}/g" \
- -e "s/\\$$\{bintarball.archive_sha256hash\}/$${archive_sha256hash}/g" >"$${base_filename}.readme" \
- ) ; \
- @@ -197,7 +197,7 @@ bintarball32: installdest32
- ls -l "$(DESTDIR)/$${base_filename}.readme"
- sync
- -bintarball64: installdest64
- +bintarball64: installdest64 $(PROJECT_BASEDIR_DIR)/README.txt $(PROJECT_BASEDIR_DIR)/README.md
- set -o errexit ; set -o xtrace ; \
- base_filename="msnfs41client_cygwin_64bit_binaries_$$(date +%Y%m%d_%Hh%Mm)_git$$(git rev-parse --short HEAD)" ; \
- ( \
- @@ -209,7 +209,7 @@ bintarball64: installdest64
- | \
- bzip2 -9 >"$${base_filename}.tar.bz2" ; \
- archive_sha256hash="$$(openssl sha256 -r "$${base_filename}.tar.bz2" | while read a dummy ; do printf "%s\n" "$$a" ; done)" ; \
- - sed -E <"../cygwin/README.bintarball.txt" \
- + sed -E <"../README.txt" \
- -e "s/\\$$\{bintarball.base_filename\}/$${base_filename}/g" \
- -e "s/\\$$\{bintarball.archive_sha256hash\}/$${archive_sha256hash}/g" >"$${base_filename}.readme" \
- ) ; \
- @@ -218,6 +218,34 @@ bintarball64: installdest64
- ls -l "$(DESTDIR)/$${base_filename}.readme"
- sync
- +$(PROJECT_BASEDIR_DIR)/README.html: $(PROJECT_BASEDIR_DIR)/docs/README.xml
- + xsltproc \
- + -xinclude \
- + -o "$(PROJECT_BASEDIR_DIR)/README.html" \
- + /usr/share/sgml/docbook/xsl-ns-stylesheets/xhtml-1_1/docbook.xsl \
- + $(PROJECT_BASEDIR_DIR)/docs/README.xml
- +
- +# README.md rule is not part of the default build as Cygwin does not have a pandoc package
- +$(PROJECT_BASEDIR_DIR)/README.md: $(PROJECT_BASEDIR_DIR)/docs/README.xml
- + pandoc \
- + -f docbook \
- + -t gfm \
- + --table-of-contents=true \
- + -s "$$(cygpath -w "$(PROJECT_BASEDIR_DIR)/docs/README.xml")" \
- + -o "$$(cygpath -w "$(PROJECT_BASEDIR_DIR)/README.md")"
- + # make sure we always use UNIX line endings
- + dos2unix "$(PROJECT_BASEDIR_DIR)/README.md"
- + # Remove bogus -x flag set by Windows PanDoc
- + chmod a-x "$(PROJECT_BASEDIR_DIR)/README.md"
- +
- +$(PROJECT_BASEDIR_DIR)/README.txt: $(PROJECT_BASEDIR_DIR)/README.html
- + w3m \
- + -O UTF8 \
- + -graph \
- + -cols 80 \
- + -dump \
- + "README.html" >"$(PROJECT_BASEDIR_DIR)/README.txt"
- +
- #
- # clean destdir/, but only if nfsd*.exe does not use it right now
- #
- diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
- deleted file mode 100644
- index 160df6f..0000000
- --- a/cygwin/README.bintarball.txt
- +++ /dev/null
- @@ -1,685 +0,0 @@
- -###
- -### msnfs41client Cygwin binary tarball README
- -###
- -
- -##
- -## WARNING: ALPHA VERSION, ONLY SUITABLE FOR BUG HUNTING!!
- -##
- -
- -
- -#
- -# 1. What is this ?
- -#
- -NFSv4.2/NFSv4.1 filesystem driver for Windows 10/11&Windows Server 2019+2022
- -
- -
- -#
- -# 2. Features:
- -#
- -- Full NFSv4.2/NFSv4.1 protocol support
- -
- -- idmapper (mapping usernames and uid/gid values between server and
- - client)
- -
- -- Support for custom ports (NFSv4 defaults to TCP port 2049, this
- - client can use different ports per mount)
- -
- -- Support for nfs://-URLs
- - * Why ? nfs://-URLs are cross-platform, portable and
- - Character-Encoding independent descriptions of NFSv4 server
- - resources (exports).
- - - including custom ports and raw IPv6 addresses
- - - nfs://-URL conversion utility (/usr/bin/nfsurlconv) to convert
- - URLs, including non-ASCII/Unicode characters in mount path
- -
- -- Support ssh forwarding, e.g. mounting NFSv4 filesystems via ssh
- - tunnel
- -
- -- Support for long paths (up to 4096 bytes), no Windows MAXPATH limit
- -
- -- Unicode support
- - - File names can use any Unicode character supported by
- - the NFS server's filesystem.
- - - nfs://-URLs can be used to mount filesystems with non-ASCII
- - characters in the mount path, independent of current locale.
- -
- -- UNC paths
- - - Mounting UNC paths without DOS drive letter
- - - IPv6 support in UNC paths
- - - /sbin/nfs_mount prints UNC paths in Win32+Cygwin/MSYS2 formats
- - - Cygwin/MSYS2 bash+ksh93 support UNC paths, e.g.
- - cd //derfwnb4966@2049/nfs4/bigdisk/mysqldb4/
- - - Symlinks on NFS can redirect to other filesystems via UNC
- - syntax and work with Cygwin, MSYS2, cmd.exe, powershell etc.,
- - e.g.:
- - mklink /D symlnk1_to_h_tmp \\lab17@2049\nfs4\export\home\rsm\tmp
- -
- -- WSL support
- - - Mount Windows NFSv4.2 shares via drive letter or UNC path
- - in WSL via mount -t drvfs
- - - Supports NFS owner/group to WSL uid/gid mapping
- -
- -- IPv6 support
- - - IPv6 address within '[', ']'
- - (will be converted to *.ipv6-literal.net)
- -
- -- Windows ACLs <---> NFSv4 ACL translation
- - - Win32 C:\Windows\system32\icacls.exe
- - - Cygwin /usr/bin/setfacl+/usr/bin/getfacl
- - - Windows Explorer ACL dialog
- -
- -- Sparse file support
- - - Requires NFSv4.2 server which supports the NFSv4.2
- - operations "ALLOCATE", "DEALLOCATE", "SEEK", and the
- - |FATTR4_WORD1_SPACE_USED| attribute.
- - - Full Win32 sparse file API support, including creation,
- - punching holes, enumeration of hole&data ranges etc.
- - - Supports Win32 APIs |FSCTL_QUERY_ALLOCATED_RANGES|,
- - |FSCTL_SET_SPARSE|, |FSCTL_SET_ZERO_DATA|; and
- - |NfsV3Attributes.used| EA
- - - Cygwin sparse file support requires >= Cygwin 3.6 to support
- - POSIX-1.2024 |lseek(...,SEEK_HOLE/SEEK_DATA,...)|, which is
- - needed for coreutils /usr/bin/fallocate and
- - $ /usr/bin/cp --sparse=auto src dest #
- - - /cygdrive/c/Windows/system32/fsutil sparse queryrange myfile.dat
- - 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)
- - - /cygdrive/c/Windows/system32/xcopy /sparse can be
- - used to copy sparse files.
- - Requires on Win11 >= 22H2 because it relies on |CopyFile2()|
- - flag |COPY_FILE_ENABLE_SPARSE_COPY|.
- -
- -- Block cloning support
- - - Implmenented via Win32 |FSCTL_DUPLICATE_EXTENTS_TO_FILE| to
- - clone file blocks from src to dst within the same
- - filesystem.
- - - 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)
- - - Sparse files are correctly cloned, including all hole and data
- - ranges
- - - /usr/bin/winclonefile.exe can be used to clone a file
- - - Windows 11 |CopyFile2()| API uses
- - |FSCTL_DUPLICATE_EXTENTS_TO_FILE| by default
- - - Windows 11 tools like xcopy.exe, robocopy etc. all use
- - |CopyFile2()|, and therefore file cloning by default
- -
- -- Symlink reparse and translation support
- - - Translates Win32/NT symlink syntax (e.g.
- - $ mklink /D ... Y:\tmp\ #) to NFS/POSIX syntax (e.g.
- - "/cygdrive/y/tmp/") and back
- - - Translates Cygwin /cygdrive/<devletter> symlinks on NFS to
- - Win32 <devletter>:\ and back
- - - Pass-through for NFS /dev-Symlinks (e.g. /dev/null) to Cygwin
- - - Interoperability for symlinks between Cygwin, powershell,
- - cmd.exe and other POSIX-compatible NFSv4.2/NFSv4.1 clients.
- -
- -- Support for NFSv4 public mounts (i.e. use the NFSv4 public file handle
- - lookup protocol via $ nfs_mount -o public ... #)
- -
- -- Support for NFSv4 referrals
- - - See Linux export(5) refer= option, nfsref(5) or
- - https://docs.oracle.com/cd/E86824_01/html/E54764/nfsref-1m.html
- -
- -- SFU/Cygwin/MSYS2 support, including:
- - - POSIX uid/gid+mode
- - - Backwards compatibility to Microsoft's NFSv3 driver
- - - Cygwin ACLs, e.g. setfacl/getfacl
- - - Cygwin/MSYS2 symlinks
- -
- -- Custom primary group support
- - - Supports primary group changes in the calling process/thread
- - (via |SetTokenInformation(..., TokenPrimaryGroup,...)|), 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.
- - - newgrp(1)/sg(1)-style "winsg" utilty to run cmd.exe with
- - different primary group, e.g.
- - $ winsg [-] -g group [-c command | /C command] #
- -
- -- Software compatibility:
- - - Any NFSv4.2/NFSv4.1 server (Linux, Solaris, Illumos,
- - FreeBSD, nfs4j, ...)
- - - All tools from Cygwin/MSYS2/MinGW
- - - Visual Studio
- - - VMware Workstation (can use VMs hosted on NFSv4.2/NFSv4.1
- - filesystem)
- -
- -
- -#
- -# 3. Requirements:
- -#
- -- Windows 10 (32bit or 64bit), Windows 11 or Windows Server 2019+2022
- -- Cygwin:
- - - Cygwin versions:
- - - 64bit: >= 3.5.7, recommended >= 3.6.1
- - - 32bit: >= 3.3.6
- - - Packages (required):
- - cygwin
- - cygrunsrv
- - cygutils
- - cygutils-extra
- - libiconv
- - libiconv2
- - procps-ng
- - util-linux
- -
- - - Packages (optional, recommended):
- - bison
- - cygport
- - cygwin-devel
- - clang
- - dos2unix
- - pax
- - pbzip2
- - libnfs-utils (for /usr/bin/nfs-ls)
- - libiconv-devel
- - make
- - bmake
- - git
- - gcc-core
- - gcc-g++
- - gdb
- - mingw64-i686-clang
- - mingw64-x86_64-clang
- - unzip
- - time
- -
- - - Packages (only-CI):
- - # required packages, but part of Cygwin default installation
- - # listed here for CI package list ONLY
- - bash
- - bzip2
- - coreutils
- - getent
- - grep
- - hostname
- - less
- - sed
- - tar
- - wget
- -
- -- MSYS2 (64bit, optional):
- - - Packages (recommended):
- - 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
- -
- -
- -#
- -# 4. Download and install Cygwin (if not installed yet):
- -#
- -# Windows 32bit-vs.-64bit can be tested from Windows cmd.exe console:
- -# Run this command:
- -# ---- snip ----
- -echo %PROCESSOR_ARCHITECTURE%
- -# ---- snip ----
- -# 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.
- -
- -- Cygwin 64bit can be installed like this:
- -# ---- snip ----
- -# Install Cygwin 64bit on Windows 64bit with packages required by "ms-nfs41-client"
- -# (Windows NFSv4.2 client):
- -# 1. Create subdir
- -mkdir download
- -cd download
- -# 2. Get installer from https://cygwin.com/setup-x86_64.exe
- -curl --remote-name "https://www.cygwin.com/setup-x86_64.exe"
- -# 3. Run installer with these arguments:
- -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
- -# ---- snip ----
- -
- -
- -- Cygwin 32bit can be installed like this:
- -# ---- snip ----
- -# Install Cygwin 32bit on Windows 32bit with packages required by "ms-nfs41-client"
- -# (Windows NFSv4.2 client):
- -# 1. Create subdir
- -mkdir download
- -cd download
- -# 2. Get installer from https://www.cygwin.com/setup-x86.exe
- -curl --remote-name "https://www.cygwin.com/setup-x86.exe"
- -# 3. Run installer with these arguments:
- -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
- -# ---- snip ----
- -
- -
- -#
- -# 5. Download and install MSYS2/64bit [OPTIONAL]
- -#
- -# 1. Download&&install from Cygwin
- -# ---- snip ----
- -mkdir -p download && cd download
- -wget 'https://github.com/msys2/msys2-installer/releases/download/2025-02-21/msys2-x86_64-20250221.exe'
- -chmod a+x 'msys2-x86_64-20250221'
- -./msys2-x86_64-20250221 --default-answer --root 'C:\msys64' install
- -# ---- snip ----
- -
- -# 2. Install extra packages:
- -# Start MSYS2 UCRT mintty and execute this:
- -# ---- snip ----
- -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
- -# ---- snip ----
- -
- -
- -#
- -# 6. Download "ms-nfs41-client" installation tarball:
- -#
- -# (from a Cygwin terminal)
- -$ mkdir -p ~/download
- -$ cd ~/download
- -$ wget 'http://www.nrubsig.org/people/gisburn/work/msnfs41client/releases/testing/${bintarball.base_filename}.tar.bz2'
- -$ openssl sha256 "${bintarball.base_filename}.tar.bz2"
- -SHA2-256(${bintarball.base_filename}.tar.bz2)= ${bintarball.archive_sha256hash}
- -
- -
- -#
- -# 7. Installation (as "Administrator"):
- -#
- -$ (cd / && tar -xf ~/download/${bintarball.base_filename}.tar.bz2 )
- -$ /sbin/msnfs41client install
- -<REBOOT>
- -
- -
- -#
- -# 8. Deinstallation:
- -#
- -$ (set -o xtrace ; cd / && tar -tf ~/download/${bintarball.base_filename}.tar.bz2 | while read i ; do [[ -f "$i" ]] && rm "$i" ; done)
- -<REBOOT>
- -
- -
- -#
- -# 9. Usage:
- -#
- -
- -# Option a)
- -# * Start NFSv4 client daemon as Windows service (requires
- -# "Administrator" account):
- -
- -$ sc start ms-nfs41-client-service
- -
- -# * Notes:
- -# - requires "Administrator" account, and one nfsd client daemon is
- -# used for all users on a machine.
- -# - The "ms-nfs41-client-service" service is installed by default as
- -# "disabled" and therefore always requires a "manual" start (e.g.
- -# $ sc start ms-nfs41-client-service #)
- -# - note that DOS devices are virtualised per LSA Logon, so each Logon
- -# needs to do a separare nfs_mount.exe to mount a NFSv4 share.
- -# The exception are mounts created by user "SYSTEM", such mounts
- -# are available to all users/logons.
- -# (see PsExec or function "su_system" in msnfs41client.bash how
- -# to run a process as user "SYSTEM")
- -# - nfsd_debug.exe will run as user "SYSTEM", but will do user
- -# impersonation for each request
- -# - stopping the service will NOT unmount filesystems, and due to a
- -# bug a reboot is required to restart and mount any NFSv4
- -# filesystems again
- -
- -# * Administration:
- -# - Follow new log messages:
- -$ tail -f '/var/log/ms-nfs41-client-service.log'
- -# - Query service status:
- -$ sc queryex ms-nfs41-client-service
- -# - Query service config:
- -$ sc qc ms-nfs41-client-service
- -# - Start service automatically:
- -# (nfsd_debug.exe will be started automagically, but mounts are
- -# not restored):
- -$ sc config ms-nfs41-client-service start=auto
- -# - Start service manually (default):
- -$ sc config ms-nfs41-client-service start=disabled
- -
- -
- -# Option b)
- -# Run the NFSv4 client daemon manually:
- -#
- -# - run this preferably as "Administrator", but this is not a requirement
- -# - requires separate terminal
- -$ /sbin/msnfs41client run_daemon
- -
- -# Mount a filesystem to drive N: and use it
- -$ /sbin/nfs_mount -o rw N 10.49.202.230:/net_tmpfs2
- -Successfully mounted '10.49.202.230@2049' to drive 'N:'
- -$ cd /cygdrive/n/
- -$ ls -la
- -total 4
- -drwxrwxrwt 5 Unix_User+0 Unix_Group+0 100 Dec 7 14:17 .
- -dr-xr-xr-x 1 roland_mainz Kein 0 Dec 14 13:48 ..
- -drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 80 Dec 12 16:24 10492030
- -drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 60 Dec 13 17:58 directory_t
- -drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 60 Dec 7 11:01 test2
- -
- -# Unmount filesystem:
- -$ cd ~ && /sbin/nfs_umount N:
- -# OR
- -$ cd ~
- -$ net use N: /delete
- -
- -# Mount a filesystem WITHOUT a dos drive assigned and use it via UNC path
- -$ /sbin/nfs_mount -o rw 10.49.202.230:/net_tmpfs2
- -Successfully mounted '10.49.202.230@2049' to drive '\0.49.202.230@2049\nfs4\net_tmpfs2'
- -$ cygpath -u '\0.49.202.230@2049\nfs4\net_tmpfs2'
- -//10.49.202.230@2049/nfs4/net_tmpfs2
- -$ cd '//10.49.202.230@2049/nfs4/net_tmpfs2'
- -$ ls -la
- -total 4
- -drwxrwxrwt 5 Unix_User+0 Unix_Group+0 100 Dec 7 14:17 .
- -dr-xr-xr-x 1 roland_mainz Kein 0 Dec 14 13:48 ..
- -drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 80 Dec 12 16:24 10492030
- -drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 60 Dec 13 17:58 directory_t
- -drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 60 Dec 7 11:01 test2
- -
- -# Unmount filesystem:
- -$ cd ~ && /sbin/nfs_umount '\0.49.202.230@2049\nfs4\net_tmpfs2'
- -# OR
- -$ cd ~
- -$ net use '\0.49.202.230@2049\nfs4\net_tmpfs2' /delete
- -
- -# List mounted NFSv4.2 filesystems:
- -$ /sbin/nfs_mount
- -
- -
- -# Global/System-wide mounts:
- -Mounts created by user "SYSTEM" are useable by all users in a system.
- -Example usage:
- ----- snip ----
- -# Create a file /etc/fstab.msnfs41client, which list the mounts
- -# which should be available system-wide
- -$ cat /etc/fstab.msnfs41client
- -nfs://[fe80::21b:1bff:fec3:7713]//bigdisk V nfs rw 0 0
- -# run "ms-nfs41-client-globalmountall-service", which runs
- -# /sbin/mountall_msnfs41client as user "SYSTEM" to read
- -# /etc/fstab.msnfs41client and mount the matching filesystems
- -sc start ms-nfs41-client-globalmountall-service
- ----- snip ----
- -
- -BUG: Note that "ms-nfs41-client-globalmountall-service" currently
- -does not wait until nfsd*.exe is available for accepting mounts.
- -
- -
- -# WSL usage:
- -Example 1: Mount Windows NFSv4.2 share via Windows drive letter
- -# Mount NFSv4.2 share in Windows to drive letter 'N':
- ----- snip ----
- -$ /sbin/nfs_mount -o rw 'N' nfs://10.49.202.230//bigdisk
- -Successfully mounted '10.49.202.230@2049' to drive 'N:'
- ----- snip ----
- -
- -# Within WSL mount drive letter 'N' to /mnt/n
- ----- snip ----
- -$ sudo bash
- -$ mkdir /mnt/n
- -$ mount -t drvfs N: /mnt/n
- ----- snip ----
- -
- -Example 2: Mount Windows NFSv4.2 share via UNC path:
- -# Mount NFSv4.2 share in Windows
- ----- snip ----
- -$ /sbin/nfs_mount -o rw nfs://10.49.202.230//bigdisk
- -Successfully mounted '10.49.202.230@2049' to drive '\0.49.202.230@2049\nfs4\bigdisk'
- ----- snip ----
- -
- -# Within WSL mount UNC path returned by /sbin/nfs_mount
- ----- snip ----
- -$ sudo bash
- -$ mkdir /mnt/bigdisk
- -$ mount -t drvfs '\0.49.202.230@2049\nfs4\bigdisk' /mnt/bigdisk
- ----- snip ----
- -
- -* Known issues with WSL:
- -- Softlinks do not work yet
- -- Creating a hard link returns "Invalid Argument", maybe drvfs
- - limitation
- -- Not all POSIX file types (e.g. block devices) etc. are supported
- -
- -
- -#
- -# 10. Notes:
- -#
- -- Idmapping (including uid/gid mapping) between NFSv4 client and
- - NFSv4 server works via /lib/msnfs41client/cygwin_idmapper.ksh,
- - which either uses builtin static data, or /usr/bin/getent passwd
- - and /usr/bin/getent group.
- - As getent 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.
- -
- -- UNC paths are supported, after successful mounting /sbin/nfs_mount
- - will list the paths in Cygwin/MSYS2 UNC format.
- -
- -- 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.
- -
- -- Workflow for nfs://-URLs:
- - - Create nfs://-URLs with nfsurlconv, read $ nfsurlconv --man # for usage
- - - pass URL to nfs_mount.exe like this:
- - $ nfs_mount -o sec=sys,rw 'L' nfs://derfwnb4966_ipv4//bigdisk #
- -
- -- Cygwin/MSYS2 symlinks are supported, but might require
- - $ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1 #.
- - This includes symlinks to UNC paths, e.g. as Administrator
- - $ cmd /c 'mklink /d c:\home\rmainz \\derfwpc5131_ipv6@2049\nfs4\export\home2\rmainz' #
- - and then $ cd /cygdrive/c/home/rmainz/ # should work
- -
- -- performance: All binaries are build without any optimisation, so
- - the filesystem is much slower than it could be.
- -
- -- bad performance due to Windows Defender AntiVirus:
- - Option 1:
- - # disable Windows defender realtime monitoring
- - # (requires Administrator shell)
- - powershell -Command 'Set-MpPreference -DisableRealtimeMonitoring 1'
- - Option 2:
- - Add "nfsd.exe", "nfsd_debug.exe", "ksh93.exe", "bash.exe",
- - "git.exe" and other offending commands to the process name
- - whitelist.
- -
- -- performance: Use vmxnet3 in VMware to improve performance
- -
- -- ACLs are supported via the normal Windows ACL tools, but on
- - Linux require the nfs4_getfacl/nfs4_setfacl utilities to see the
- - data.
- - * Example 1 (assuming that Windows, Linux NFSv4 client and NFSv4
- - server have a user "siegfried_wulsch"):
- - - On Windows on a NFSv4 filesystem:
- - $ icacls myhorribledata.txt /grant "siegfried_wulsch:WD" #
- - - On Linux NFSv4 clients you will then see this:
- - # ---- snip ----
- - $ nfs4_getfacl myhorribledata.txt
- - A::OWNER@:rwatTcCy
- - A::siegfried_wulsch@global.loc:rwatcy
- - A::GROUP@:rtcy
- - A::EVERYONE@:rtcy
- - # ---- snip ----
- -
- - * Example 2 (assuming that Windows, Linux NFSv4 client and NFSv4
- - server have a group "cygwingrp2"):
- - - On Windows on a NFSv4 filesystem:
- - $ icacls myhorribledata.txt /grant "cygwingrp2:(WDAC)" /t /c #
- - - On Linux NFSv4 clients you will then see this:
- - # ---- snip ----
- - $ nfs4_getfacl myhorribledata.txt
- - A::OWNER@:rwatTcCy
- - A::GROUP@:rtcy
- - A:g:cygwingrp2@global.loc:rtcy
- - A::EVERYONE@:rtcy
- - # ---- snip ----
- -
- -- nfs_mount.exe 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 < 1024.
- - If nfsd.exe/nfsd_debug.exe is started without the Windows priviledge
- - 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 /etc/exports and on Solaris/Illumos
- - using export option "resvport" (see nfs(5)).
- -
- -- Accessing mounts from a VMware/QEMU/VirtualBox VM using NAT requires
- - the the "insecure" export option in /etc/exports and on
- - Solaris/Illumos using export option "resvport" (see nfs(5)), as the
- - NFSv4 client source TCP port will be >= 1024.
- -
- -- Install: Adding Windows accounts+groups to the NFSv4 server:
- - ms-nfs41-client comes with /sbin/cygwinaccount2nfs4account 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.
- -
- -- nfs_mount -o sec=none ... # works with Solaris 11.4 nfsd, but
- - might require Linux kernel commit
- - https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git/patch/?id=bb4f07f2409c26c01e97e6f9b432545f353e3b66
- - ("nfsd: Fix NFSD_MAY_BYPASS_GSS and NFSD_MAY_BYPASS_GSS_ON_ROOT") to
- - work.
- -
- -
- -#
- -# 11. Known issues:
- -#
- -- The kernel driver ("nfs41_driver.sys") does not yet have a
- - cryptographic signature for SecureBoot - which means it will only
- - work if SecureBoot is turned off (otherwise
- - $ /sbin/msnfs41client install # will FAIL!)
- -
- -- If nfsd_debug.exe crashes or gets killed, the only safe way
- - to run it again requires a reboot
- -
- -- LDAP support does not work yet
- -
- -- Attribute caching is too aggressive
- -
- -- Caching in the kernel does not always work. For example
- - $ tail -f ... # does not not see new data.
- - Workaround: Use GNU tail'S $ tail --follow=name ... #
- - Working theory is that this is related to FCB caching, see
- - |FCB_STATE_FILESIZECACHEING_ENABLED|, as the nfs41_driver.sys
- - kernel module does not see the |stat()| syscalls. But $ tail -f ... #
- - always works for a moment if something else opens the same file.
- -
- -- Unmounting and then mounting the same filesystem causes issues
- - as the name cache in nfsd*.exe is not flushed on umount, including
- - leftover delegations.
- -
- -- krb5p security with AES keys do not work against the linux server,
- - as it does not support gss krb5 v2 tokens with rotated data.
- -
- -- 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.
- -
- -- If nfsd.exe is restarted while a drive is mapped, that drive needs
- - to be remounted before further use.
- -
- -- Does not allow renaming a file on top of an existing open file.
- - Connectathon's special test op_ren has been commented out.
- -
- -- File access timestamps might be wrong for delegations.
- -
- -- Extended attributes are supported with some limitations:
- - a) the server must support NFS 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.
- -
- -- Win10/32bit-only: $ net use H: /delete # does not work,
- - use $ nfs_umount 'H' instead #
- -
- -- Windows event log can list errors like "MUP 0xc0000222"
- - (|STATUS_LOST_WRITEBEHIND_DATA|) in case the disk on the NFSv4 server
- - is full and outstanding writes from a memory-mapped file fail.
- - Example:
- - ---- snip ----
- - {Fehler beim verzoegerten Schreibvorgang} Nicht alle Daten fuer die
- - Datei "\\34.159.25.153@2049\nfs4\export\nfs4export\gcc\lto-dump.exe"
- - konnten gespeichert werden. Daten gingen verloren.
- - Dieser Fehler wurde von dem Server zurueckgegeben, auf dem sich die
- - Datei befindet. Versuchen Sie, die Datei woanders zu speichern.
- - ---- snip ----
- -
- -
- -#
- -# 12. Notes for troubleshooting && finding bugs/debugging:
- -#
- -- nfsd_debug.exe has the -d option to set a level for debug
- - output.
- - Edit /sbin/msnfs41client to set the "-d" option.
- -
- -- The "msnfs41client" script has the option "watch_kernel_debuglog"
- - to get the debug output of the kernel module.
- -
- - Run as Administrator: $ /sbin/msnfs41client watch_kernel_debuglog #
- -
- - Currently requires DebugView
- - (https://learn.microsoft.com/en-gb/sysinternals/downloads/debugview)
- - to be installed.
- -
- -- Watching network traffic:
- - - Use $ /sbin/msnfs41client watch_nfs_traffic # to watch the
- - NFS network traffic
- -
- - - WireShark has a command line tool called "tshark", 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
- - it's 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"):
- - # ---- snip ----
- - $ nfsv4port=2049 ; /cygdrive/c/Program\ Files/Wireshark/tshark \
- - -f "port $nfsv4port" -d "tcp.port==${nfsv4port},rpc" -i Ethernet0
- - # ---- snip ----
- -
- - If you are running inside a VMware VM on a Linux host it
- - might require $ chmod a+rw /dev/vmnet0 # on VMware host, so that
- - the VM can use "Promiscuous Mode".
- -
- -
- -#
- -# 13. Source code:
- -#
- -- Source code can be obtained from https://github.com/kofemann/ms-nfs41-client
- - or as git bundle from /usr/src/msnfs41client/msnfs41client_git.bundle
- -
- -- Build instructions can be found at
- -https://github.com/kofemann/ms-nfs41-client/tree/master/cygwin
- -
- -
- -# EOF.
- diff --git a/cygwin/README.txt b/cygwin/README.txt
- deleted file mode 100644
- index 634cfcf..0000000
- --- a/cygwin/README.txt
- +++ /dev/null
- @@ -1,150 +0,0 @@
- -#
- -# ms-nfs41-client/cygwin/README.txt
- -#
- -# Draft README/ToDo list&co.
- -#
- -
- -######## Building ms-nfs41-client using Cygwin+Makefile:
- -** Required software:
- -* Option 1:
- - Windows 10 with Visual Studio 2019
- -- Start Visual Studio 19 installer and import the installer
- - config file "ms-nfs41-client/build.vc19/ms-nfs41-client_vs2019.vsconfig",
- - and then install Visual Studio.
- - (Note that 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)
- -- WDK for Windows 10, version 2004, from
- - https://go.microsoft.com/fwlink/?linkid=2128854
- -- Cygwin 64bit >= 3.5.0
- - (see "ms-nfs41-clientcygwin/README.bintarball.txt" for Cygwin 32bit
- - and 64bit installation instructions)
- -
- -* Option 2:
- - Windows 10/11 with Visual Studio 2022
- -- Start Visual Studio 2022 installer and import the installer
- - config file "ms-nfs41-client/build.vc19/ms-nfs41-client_vs2022.vsconfig",
- - and then install Visual Studio.
- - (Note that 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)
- -- WDK for Windows 11, version 1591, from
- - https://go.microsoft.com/fwlink/?linkid=2286137
- -- Cygwin 64bit >= 3.5.0
- - (see "ms-nfs41-clientcygwin/README.bintarball.txt" for Cygwin 32bit
- - and 64bit installation instructions)
- -
- -
- -** Build the project
- -* using Visual Studio 2019+Cygwin command line (bash/ksh93):
- -# this creates a 32bit+kernel+64bit-kernel build for Windows 10+11
- -export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/:$PATH"
- -git clone https://github.com/kofemann/ms-nfs41-client.git
- -cd ms-nfs41-client
- -cd cygwin
- -make build
- -make installdest
- -make bintarball
- -
- -* using Visual Studio 2022+Cygwin command line (bash/ksh93):
- -# this creates a 64bit-kernel only build for Windows 11
- -export PATH="/cygdrive/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/:$PATH"
- -git clone https://github.com/kofemann/ms-nfs41-client.git
- -cd ms-nfs41-client
- -# "retarget" VS platform toolset to "v143"
- -# ("v142" should remain the default when comitting)
- -sed -i -E 's/<PlatformToolset>v142<\/PlatformToolset>/<PlatformToolset>v143<\/PlatformToolset>/g' $(find 'build.vc19' -name \*.vcxproj)
- -cd cygwin
- -make build64
- -make installdest64
- -make bintarball64
- -
- -# Note that $ make installdest #/$ make installdest64 # can fail on SMB/NFSv4.1 filesystems
- -# with a "link.exe" crash.
- -# Workaround is to disable incremental linking before building, e.g. do
- -# ---- snip ----
- -cd ms-nfs41-client
- -sed -i -E 's/<LinkIncremental>true<\/LinkIncremental>/<LinkIncremental>false<\/LinkIncremental>/g' $(find build.vc19 -name \*.vcxproj)
- -# ---- snip ----
- -# This Visual Studio bug is tracked as
- -# https://developercommunity.visualstudio.com/t/Visual-Studio-linkexe-crashes-on-networ/10735424
- -# ("Visual Studio link.exe crashes on network filesystem").
- -
- -
- -#### Install the software (requires mintty.exe running as "Adminstrator"):
- -cd ms-nfs41-client/destdir/cygdrive/c/cygwin64/sbin
- -bash ./msnfs41client.bash install
- -# then reboot
- -
- -
- -#### Run nfs41 client:
- -** Run deamon:
- -(requires to modify "msnfs41client.bash")
- -cd ms-nfs41-client/destdir/cygdrive/c/cygwin64/sbin
- -bash ./msnfs41client.bash run_daemon
- -
- -** mount home dir:
- -(requires to modify "msnfs41client.bash")
- -cd ms-nfs41-client/destdir/cygdrive/c/cygwin64/sbin
- -bash ./msnfs41client.bash mount_homedir
- -
- -
- -
- -######## Manually building ms-nfs41-client using Cygwin:
- -** Required software:
- -- Visual Studio 19
- -- WDK for Windows 10, version 2004, from
- - https://go.microsoft.com/fwlink/?linkid=2128854
- -- Cygwin >= 3.5.0
- -
- -** Building the project using GUI:
- -1. Start Visual Studio 19
- -2. Load the project file "build.vc19/nfs41-client.sln"
- -3. Select menu item "Build/Build solution" as "Debug/x64"
- -4. Select menu item "Build/Build solution" as "Release/x64"
- -
- -** Build the project using Cygwin command line (bash/ksh93):
- -export PATH+=":/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/"
- -git clone https://github.com/kofemann/ms-nfs41-client.git
- -cd ms-nfs41-client
- -MSBuild.exe build.vc19/nfs41-client.sln -t:Build -p:Configuration=Debug -p:Platform=x64
- -MSBuild.exe build.vc19/nfs41-client.sln -t:Build -p:Configuration=Release -p:Platform=x64
- -
- -** Make release blob:
- -mkdir dist
- -cd dist/
- -cp ../build.vc19/x64/Debug/nfsd.exe nfsd_debug.exe
- -cp ../build.vc19/x64/Release/* .
- -cp ../nfs41rdr.inf .
- -cp ../etc_netconfig .
- -cp ../ms-nfs41-idmap.conf .
- -
- -
- -#### Install release blob (requires mintty.exe running as "Adminstrator"):
- -cd ms-nfs41-client/dist
- -bash ../cygwin/devel/msnfs41client.bash install
- -# then reboot
- -
- -#### Run nfs41 client:
- -** Run deamon:
- -(requires to modify "msnfs41client.bash")
- -bash ../cygwin/devel/msnfs41client.bash run_daemon
- -
- -
- -** mount home dir:
- -(requires to modify "msnfs41client.bash")
- -bash ../cygwin/devel/msnfs41client.bash mount_homedir
- -
- -
- -######## Testing:
- -Seen tests/manual_testing.txt
- -
- -#### ToDo:
- -- Makefile/script support for release blob generaetion, local test installation etc
- -- DocBook/XML based documentation
- -- Document how to get and build ksh93 for Cygwin
- -- Cygwin-specific binary release blob
- -- Document the usage of utils/mount_sshnfs/ and utils/sshnfs/
- -- Add test code for SID etc mapping
- -
- -# EOF.
- diff --git a/docs/README.xml b/docs/README.xml
- new file mode 100644
- index 0000000..b292e8f
- --- /dev/null
- +++ b/docs/README.xml
- @@ -0,0 +1,963 @@
- +<?xml version="1.0" encoding="UTF-8"?>
- +<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">
- +
- + <!--
- + DocBook XML: Compile to HTML via
- + $ xsltproc -xinclude -o README.html /usr/share/sgml/docbook/xsl-ns-stylesheets/xhtml-1_1/docbook.xsl README.xml #
- + -->
- +
- + <title xml:id="articletitle">Windows NFS 4.2 FileSystem Client Instructions</title>
- +
- + <section xml:id="what-is-this">
- + <title>What is this ?</title>
- + <para>NFSv4.2/NFSv4.1 filesystem driver for Windows 10/11 & Windows Server 2019+2022</para>
- + </section>
- +
- + <section xml:id="features">
- + <title>Features</title>
- + <itemizedlist>
- + <listitem>
- + <para>Full NFSv4.2/NFSv4.1 protocol support</para>
- + </listitem>
- + <listitem>
- + <para>idmapper (mapping usernames and uid/gid values between server and client)</para>
- + </listitem>
- + <listitem>
- + <para>Support for custom ports (NFSv4 defaults to TCP port 2049, this client can use different ports per mount)</para>
- + </listitem>
- + <listitem>
- + <para>Support for <literal>nfs://</literal>-URLs
- + <itemizedlist>
- + <listitem>
- + <para>Why? <literal>nfs://</literal>-URLs are cross-platform, portable and Character-Encoding independent descriptions of NFSv4 server resources (exports).</para>
- + </listitem>
- + <listitem>
- + <para>including custom ports and raw IPv6 addresses</para>
- + </listitem>
- + <listitem>
- + <para><literal>nfs://</literal>-URL conversion utility (<filename>/usr/bin/nfsurlconv</filename>) to convert URLs, including non-ASCII/Unicode characters in mount path</para>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>Support ssh forwarding, e.g., mounting NFSv4 filesystems via ssh tunnel</para>
- + </listitem>
- + <listitem>
- + <para>Support for long paths (up to 4096 bytes), no Windows MAXPATH limit</para>
- + </listitem>
- + <listitem>
- + <para>Unicode support
- + <itemizedlist>
- + <listitem>
- + <para>File names can use any Unicode character supported by the NFS server's filesystem.</para>
- + </listitem>
- + <listitem>
- + <para><literal>nfs://</literal>-URLs can be used to mount filesystems with non-ASCII characters in the mount path, independent of current locale.</para>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>UNC paths
- + <itemizedlist>
- + <listitem>
- + <para>Mounting UNC paths without DOS drive letter</para>
- + </listitem>
- + <listitem>
- + <para>IPv6 support in UNC paths</para>
- + </listitem>
- + <listitem>
- + <para><filename>/sbin/nfs_mount</filename> prints UNC paths in Win32+Cygwin/MSYS2 formats</para>
- + </listitem>
- + <listitem>
- + <para>Cygwin/MSYS2 bash+ksh93 support UNC paths, e.g., <command>cd //derfwnb4966@2049/nfs4/bigdisk/mysqldb4/</command></para>
- + </listitem>
- + <listitem>
- + <para>Symlinks on NFS can redirect to other filesystems via UNC syntax and work with Cygwin, MSYS2, cmd.exe, powershell etc., e.g.:
- + <programlisting>mklink /D symlnk1_to_h_tmp \\lab17@2049\nfs4\export\home\rsm\tmp</programlisting>
- + </para>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>WSL support
- + <itemizedlist>
- + <listitem>
- + <para>Mount Windows NFSv4.2 shares via drive letter or UNC path in WSL via <command>mount -t drvfs</command></para>
- + </listitem>
- + <listitem>
- + <para>Supports NFS owner/group to WSL uid/gid mapping</para>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>IPv6 support
- + <itemizedlist>
- + <listitem>
- + <para>IPv6 address within '[', ']' (will be converted to *.ipv6-literal.net)</para>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>Windows ACLs <---> NFSv4 ACL translation
- + <itemizedlist>
- + <listitem>
- + <para>Win32 <filename>C:\Windows\system32\icacls.exe</filename></para>
- + </listitem>
- + <listitem>
- + <para>Cygwin <filename>/usr/bin/setfacl</filename>+<filename>/usr/bin/getfacl</filename></para>
- + </listitem>
- + <listitem>
- + <para>Windows Explorer ACL dialog</para>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>Sparse file support
- + <itemizedlist>
- + <listitem>
- + <para>Requires NFSv4.2 server which supports the NFSv4.2 operations "ALLOCATE", "DEALLOCATE", "SEEK", and the <literal>|FATTR4_WORD1_SPACE_USED|</literal> attribute.</para>
- + </listitem>
- + <listitem>
- + <para>Full Win32 sparse file API support, including creation, punching holes, enumeration of hole&data ranges etc.</para>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <para>Cygwin sparse file support requires >= 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>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <para><filename>/cygdrive/c/Windows/system32/xcopy /sparse</filename> can be used to copy sparse files. Requires on Win11 >= 22H2 because it relies on <literal>|CopyFile2()|</literal> flag <literal>|COPY_FILE_ENABLE_SPARSE_COPY|</literal>.</para>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>Block cloning support
- + <itemizedlist>
- + <listitem>
- + <para>Implemented via Win32 <literal>|FSCTL_DUPLICATE_EXTENTS_TO_FILE|</literal> to clone file blocks from src to dst within the same filesystem.</para>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <para>Sparse files are correctly cloned, including all hole and data ranges</para>
- + </listitem>
- + <listitem>
- + <para><filename>/usr/bin/winclonefile.exe</filename> can be used to clone a file</para>
- + </listitem>
- + <listitem>
- + <para>Windows 11 <literal>|CopyFile2()|</literal> API uses <literal>|FSCTL_DUPLICATE_EXTENTS_TO_FILE|</literal> by default</para>
- + </listitem>
- + <listitem>
- + <para>Windows 11 tools like xcopy.exe, robocopy etc. all use <literal>|CopyFile2()|</literal>, and therefore file cloning by default</para>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>Symlink reparse and translation support
- + <itemizedlist>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <para>Translates Cygwin <filename>/cygdrive/<devletter></filename> symlinks on NFS to Win32 <filename><devletter>:\</filename> and back</para>
- + </listitem>
- + <listitem>
- + <para>Pass-through for NFS <filename>/dev-Symlinks</filename> (e.g. <filename>/dev/null</filename>) to Cygwin</para>
- + </listitem>
- + <listitem>
- + <para>Interoperability for symlinks between Cygwin, powershell, cmd.exe and other POSIX-compatible NFSv4.2/NFSv4.1 clients.</para>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>Support for NFSv4 public mounts (i.e., use the NFSv4 public file handle lookup protocol via <command>$ nfs_mount -o public ... #</command>)</para>
- + </listitem>
- + <listitem>
- + <para>Support for NFSv4 referrals
- + <itemizedlist>
- + <listitem>
- + <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>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>SFU/Cygwin/MSYS2 support, including:
- + <itemizedlist>
- + <listitem>
- + <para>POSIX uid/gid+mode</para>
- + </listitem>
- + <listitem>
- + <para>Backwards compatibility to Microsoft's NFSv3 driver</para>
- + </listitem>
- + <listitem>
- + <para>Cygwin ACLs, e.g., <command>setfacl</command>/<command>getfacl</command></para>
- + </listitem>
- + <listitem>
- + <para>Cygwin/MSYS2 symlinks</para>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>Custom primary group support
- + <itemizedlist>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>Software compatibility:
- + <itemizedlist>
- + <listitem>
- + <para>Any NFSv4.2/NFSv4.1 server (Linux, Solaris, Illumos, FreeBSD, nfs4j, ...)</para>
- + </listitem>
- + <listitem>
- + <para>All tools from Cygwin/MSYS2/MinGW</para>
- + </listitem>
- + <listitem>
- + <para>Visual Studio</para>
- + </listitem>
- + <listitem>
- + <para>VMware Workstation (can use VMs hosted on NFSv4.2/NFSv4.1 filesystem)</para>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + </itemizedlist>
- + </section>
- +
- + <section xml:id="requirements">
- + <title>Requirements</title>
- + <itemizedlist>
- + <listitem>
- + <para>Windows 10 (32bit or 64bit), Windows 11 or Windows Server 2019+2022</para>
- + </listitem>
- + <listitem>
- + <para>Cygwin:
- + <itemizedlist>
- + <listitem>
- + <para>Cygwin versions:
- + <itemizedlist>
- + <listitem>
- + <para>64bit: >= 3.5.7, recommended >= 3.6.1</para>
- + </listitem>
- + <listitem>
- + <para>32bit: >= 3.3.6</para>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>Packages (required):
- + <itemizedlist>
- + <listitem><para><literal>cygwin</literal></para></listitem>
- + <listitem><para><literal>cygrunsrv</literal></para></listitem>
- + <listitem><para><literal>cygutils</literal></para></listitem>
- + <listitem><para><literal>cygutils-extra</literal></para></listitem>
- + <listitem><para><literal>libiconv</literal></para></listitem>
- + <listitem><para><literal>libiconv2</literal></para></listitem>
- + <listitem><para><literal>procps-ng</literal></para></listitem>
- + <listitem><para><literal>util-linux</literal></para></listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>Packages (optional, recommended, required to build ms-nf41-client):
- + <itemizedlist>
- + <listitem><para><literal>bison</literal></para></listitem>
- + <listitem><para><literal>cygport</literal></para></listitem>
- + <listitem><para><literal>cygwin-devel</literal></para></listitem>
- + <listitem><para><literal>clang</literal></para></listitem>
- + <listitem><para><literal>dos2unix</literal></para></listitem>
- + <listitem><para><literal>pax</literal></para></listitem>
- + <listitem><para><literal>pbzip2</literal></para></listitem>
- + <listitem><para><literal>libnfs-utils</literal> (for <filename>/usr/bin/nfs-ls</filename>)</para></listitem>
- + <listitem><para><literal>libiconv-devel</literal></para></listitem>
- + <listitem><para><literal>make</literal></para></listitem>
- + <listitem><para><literal>bmake</literal></para></listitem>
- + <listitem><para><literal>git</literal></para></listitem>
- + <listitem><para><literal>gcc-core</literal></para></listitem>
- + <listitem><para><literal>gcc-g++</literal></para></listitem>
- + <listitem><para><literal>gdb</literal></para></listitem>
- + <listitem><para><literal>mingw64-i686-clang</literal></para></listitem>
- + <listitem><para><literal>mingw64-x86_64-clang</literal></para></listitem>
- + <listitem><para><literal>unzip</literal></para></listitem>
- + <listitem><para><literal>time</literal></para></listitem>
- + <listitem><para><literal>docbook-utils</literal></para></listitem>
- + <listitem><para><literal>docbook-xml45</literal></para></listitem>
- + <listitem><para><literal>docbook-xsl</literal></para></listitem>
- + <listitem><para><literal>docbook-xsl-ns</literal></para></listitem>
- + <listitem><para><literal>libxslt</literal></para></listitem>
- + <listitem><para><literal>w3m</literal></para></listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>Packages (only-CI):
- + <itemizedlist>
- + <listitem><para># required packages, but part of Cygwin default installation</para></listitem>
- + <listitem><para># listed here for CI package list ONLY</para></listitem>
- + <listitem><para><literal>bash</literal></para></listitem>
- + <listitem><para><literal>bzip2</literal></para></listitem>
- + <listitem><para><literal>coreutils</literal></para></listitem>
- + <listitem><para><literal>getent</literal></para></listitem>
- + <listitem><para><literal>grep</literal></para></listitem>
- + <listitem><para><literal>hostname</literal></para></listitem>
- + <listitem><para><literal>less</literal></para></listitem>
- + <listitem><para><literal>sed</literal></para></listitem>
- + <listitem><para><literal>tar</literal></para></listitem>
- + <listitem><para><literal>wget</literal></para></listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>MSYS2 (64bit, optional):
- + <itemizedlist>
- + <listitem>
- + <para>Packages (recommended):
- + <itemizedlist>
- + <listitem><para><literal>base-devel</literal></para></listitem>
- + <listitem><para><literal>gcc</literal></para></listitem>
- + <listitem><para><literal>clang</literal></para></listitem>
- + <listitem><para><literal>sed</literal></para></listitem>
- + <listitem><para><literal>time</literal></para></listitem>
- + <listitem><para><literal>coreutils</literal></para></listitem>
- + <listitem><para><literal>util-linux</literal></para></listitem>
- + <listitem><para><literal>grep</literal></para></listitem>
- + <listitem><para><literal>sed</literal></para></listitem>
- + <listitem><para><literal>emacs</literal></para></listitem>
- + <listitem><para><literal>gdb</literal></para></listitem>
- + <listitem><para><literal>make</literal></para></listitem>
- + <listitem><para><literal>autoconf</literal></para></listitem>
- + <listitem><para><literal>automake</literal></para></listitem>
- + <listitem><para><literal>gettext</literal></para></listitem>
- + <listitem><para><literal>gettext-devel</literal></para></listitem>
- + <listitem><para><literal>git</literal></para></listitem>
- + <listitem><para><literal>subversion</literal></para></listitem>
- + <listitem><para><literal>flex</literal></para></listitem>
- + <listitem><para><literal>bison</literal></para></listitem>
- + <listitem><para><literal>unzip</literal></para></listitem>
- + <listitem><para><literal>pax</literal></para></listitem>
- + <listitem><para><literal>tar</literal></para></listitem>
- + <listitem><para><literal>libiconv-devel</literal></para></listitem>
- + <listitem><para><literal>ncurses-devel</literal></para></listitem>
- + <listitem><para><literal>gmp-devel</literal></para></listitem>
- + <listitem><para><literal>mpfr-devel</literal></para></listitem>
- + <listitem><para><literal>mpc-devel</literal></para></listitem>
- + <listitem><para><literal>isl-devel</literal></para></listitem>
- + <listitem><para><literal>procps-ng</literal></para></listitem>
- + <listitem><para><literal>libiconv-devel</literal></para></listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + </itemizedlist>
- + </section>
- +
- + <section xml:id="installation">
- + <title>Installation</title>
- +
- + <section xml:id="download-install-cygwin">
- + <title>Download and install Cygwin (if not installed yet)</title>
- + <para>Windows 32bit-vs.-64bit can be tested from Windows <command>cmd.exe</command> console:</para>
- + <para>Run this command:</para>
- + <programlisting>echo %PROCESSOR_ARCHITECTURE%</programlisting>
- + <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>
- +
- + <para>Cygwin 64bit can be installed like this:</para>
- + <para>
- + <emphasis role="strong">Install Cygwin 64bit on Windows 64bit with packages required by "ms-nfs41-client" (Windows NFSv4.2 client):</emphasis>
- + </para>
- + <orderedlist>
- + <listitem>
- + <para>Create subdir</para>
- + <programlisting>mkdir download
- +cd download</programlisting>
- + </listitem>
- + <listitem>
- + <para>Get installer from <link xl:href="https://cygwin.com/setup-x86_64.exe">https://cygwin.com/setup-x86_64.exe</link></para>
- + <programlisting>curl --remote-name "https://www.cygwin.com/setup-x86_64.exe"</programlisting>
- + </listitem>
- + <listitem>
- + <para>Run installer with these arguments:</para>
- + <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>
- + </listitem>
- + </orderedlist>
- +
- + <para>Cygwin 32bit can be installed like this:</para>
- + <para>
- + <emphasis role="strong">Install Cygwin 32bit on Windows 32bit with packages required by "ms-nfs41-client" (Windows NFSv4.2 client):</emphasis>
- + </para>
- + <orderedlist>
- + <listitem>
- + <para>Create subdir</para>
- + <programlisting>mkdir download
- +cd download</programlisting>
- + </listitem>
- + <listitem>
- + <para>Get installer from <link xl:href="https://www.cygwin.com/setup-x86.exe">https://www.cygwin.com/setup-x86.exe</link></para>
- + <programlisting>curl --remote-name "https://www.cygwin.com/setup-x86.exe"</programlisting>
- + </listitem>
- + <listitem>
- + <para>Run installer with these arguments:</para>
- + <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>
- + </listitem>
- + </orderedlist>
- + </section>
- +
- + <section xml:id="download-install-msys2">
- + <title>Download and install MSYS2/64bit [OPTIONAL]</title>
- + <orderedlist>
- + <listitem>
- + <para>Download & install from Cygwin</para>
- + <programlisting>mkdir -p download && cd download
- +wget 'https://github.com/msys2/msys2-installer/releases/download/2025-02-21/msys2-x86_64-20250221.exe'
- +chmod a+x 'msys2-x86_64-20250221'
- +./msys2-x86_64-20250221 --default-answer --root 'C:\msys64' install</programlisting>
- + </listitem>
- + <listitem>
- + <para>Install extra packages:</para>
- + <para>Start MSYS2 UCRT mintty and execute this:</para>
- + <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>
- + </listitem>
- + </orderedlist>
- + </section>
- +
- + <section xml:id="download-msnfs41client-tarball">
- + <title>Download "ms-nfs41-client" installation tarball</title>
- + <para>(from a Cygwin terminal)</para>
- + <programlisting>$ mkdir -p ~/download
- +$ cd ~/download
- +$ wget 'http://www.nrubsig.org/people/gisburn/work/msnfs41client/releases/testing/${bintarball.base_filename}.tar.bz2'
- +$ openssl sha256 "${bintarball.base_filename}.tar.bz2"
- +SHA2-256(${bintarball.base_filename}.tar.bz2)= ${bintarball.archive_sha256hash}</programlisting>
- + </section>
- +
- + <section xml:id="installation-via-cygwin">
- + <title>Installation (as "Administrator")</title>
- + <programlisting>$ (cd / && tar -xf ~/download/${bintarball.base_filename}.tar.bz2 )
- +$ /sbin/msnfs41client install
- +<REBOOT></programlisting>
- + </section>
- +
- + <section xml:id="deinstallation">
- + <title>Deinstallation</title>
- + <programlisting>$ (set -o xtrace ; cd / && tar -tf ~/download/${bintarball.base_filename}.tar.bz2 | while read i ; do [[ -f "$i" ]] && rm "$i" ; done)
- +<REBOOT></programlisting>
- + </section>
- +
- + </section>
- +
- + <section xml:id="usage">
- + <title>Usage</title>
- +
- + <section xml:id="prep_nfs_server">
- + <title>Preparing the NFS server</title>
- +
- + <section xml:id="nfs_server_config">
- + <title>NFS server config</title>
- + <itemizedlist>
- + <listitem><para>Make sure the NFS client can access the NFS server</para></listitem>
- + <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>
- + </itemizedlist>
- + </section>
- +
- + <section xml:id="nfs_server_accounts">
- + <title>User/group accounts on the NFS server</title>
- + <para>It is required that all Windows users and groups used by the
- + Windows NFS client have user/group accounts on the server
- + side.</para>
- + <para>If no central user&group management between NFS server
- + and NFS clients exists the
- + <filename>/sbin/cygwinaccount2nfs4account</filename> script can be
- + used to manually create matching <filename>/etc/group</filename> and
- + <filename>/etc/passwd</filename> entries on the NFS server side.</para>
- + </section>
- + </section>
- +
- + <section xml:id="starting_nfs_daemon">
- + <title>Starting the NFS client daemon</title>
- +
- + <section xml:id="run_as_windows_service">
- + <title>Run as Windows Service</title>
- + <para>
- + <itemizedlist>
- + <listitem>
- + <para>Start NFSv4 client daemon as Windows service (requires "Administrator" account):</para>
- + <programlisting>$ sc start ms-nfs41-client-service</programlisting>
- + </listitem>
- + <listitem>
- + <para>Notes:
- + <itemizedlist>
- + <listitem>
- + <para>requires "Administrator" account, and one nfsd client daemon is used for all users on a machine.</para>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <para><command>nfsd_debug.exe</command> will run as user "SYSTEM", but will do user impersonation for each request</para>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>Administration:
- + <itemizedlist>
- + <listitem>
- + <para>Follow new log messages:</para>
- + <programlisting>$ tail -f '/var/log/ms-nfs41-client-service.log'</programlisting>
- + </listitem>
- + <listitem>
- + <para>Query service status:</para>
- + <programlisting>$ sc queryex ms-nfs41-client-service</programlisting>
- + </listitem>
- + <listitem>
- + <para>Query service config:</para>
- + <programlisting>$ sc qc ms-nfs41-client-service</programlisting>
- + </listitem>
- + <listitem>
- + <para>Start service automatically:</para>
- + <para>(<command>nfsd_debug.exe</command> will be started automagically, but mounts are not restored):</para>
- + <programlisting>$ sc config ms-nfs41-client-service start=auto</programlisting>
- + </listitem>
- + <listitem>
- + <para>Start service manually (default):</para>
- + <programlisting>$ sc config ms-nfs41-client-service start=disabled</programlisting>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </section>
- +
- + <section xml:id="manual_start">
- + <title>Manual starting the daemon</title>
- + <para>Run the NFSv4 client daemon manually:</para>
- + <itemizedlist>
- + <listitem>
- + <para>run this preferably as "Administrator", but this is not a requirement</para>
- + </listitem>
- + <listitem>
- + <para>requires separate terminal</para>
- + </listitem>
- + </itemizedlist>
- + <programlisting>$ /sbin/msnfs41client run_daemon</programlisting>
- + </section>
- +
- + </section>
- +
- + <section xml:id="mounting_and_using">
- + <title>Mounting and using NFS filesystems</title>
- +
- + <section xml:id="basic_usage">
- + <title>Basic usage</title>
- + <para>Mount a filesystem to drive N: and use it</para>
- + <programlisting>$ /sbin/nfs_mount -o rw N 10.49.202.230:/net_tmpfs2
- +Successfully mounted '10.49.202.230@2049' to drive 'N:'
- +$ cd /cygdrive/n/
- +$ ls -la
- +total 4
- +drwxrwxrwt 5 Unix_User+0 Unix_Group+0 100 Dec 7 14:17 .
- +dr-xr-xr-x 1 roland_mainz Kein 0 Dec 14 13:48 ..
- +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 80 Dec 12 16:24 10492030
- +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 60 Dec 13 17:58 directory_t
- +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 60 Dec 7 11:01 test2</programlisting>
- +
- + <para>Unmount filesystem:</para>
- + <programlisting>$ cd ~ && /sbin/nfs_umount N:
- +# OR
- +$ cd ~
- +$ net use N: /delete</programlisting>
- +
- + <para>Mount a filesystem WITHOUT a dos drive assigned and use it via UNC path</para>
- + <programlisting>$ /sbin/nfs_mount -o rw 10.49.202.230:/net_tmpfs2
- +Successfully mounted '10.49.202.230@2049' to drive '\0.49.202.230@2049\nfs4\net_tmpfs2'
- +$ cygpath -u '\0.49.202.230@2049\nfs4\net_tmpfs2'
- +//10.49.202.230@2049/nfs4/net_tmpfs2
- +$ cd '//10.49.202.230@2049/nfs4/net_tmpfs2'
- +$ ls -la
- +total 4
- +drwxrwxrwt 5 Unix_User+0 Unix_Group+0 100 Dec 7 14:17 .
- +dr-xr-xr-x 1 roland_mainz Kein 0 Dec 14 13:48 ..
- +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 80 Dec 12 16:24 10492030
- +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 60 Dec 13 17:58 directory_t
- +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121 60 Dec 7 11:01 test2</programlisting>
- + <para>Unmount filesystem:</para>
- + <programlisting>$ cd ~ && /sbin/nfs_umount '\0.49.202.230@2049\nfs4\net_tmpfs2'
- +# OR
- +$ cd ~
- +$ net use '\0.49.202.230@2049\nfs4\net_tmpfs2' /delete</programlisting>
- + <para>List mounted NFSv4.2 filesystems:</para>
- + <programlisting>$ /sbin/nfs_mount</programlisting>
- + </section>
- +
- + <section xml:id="global-system-wide-mounts">
- + <title>Global/System-wide mounts</title>
- + <para>Mounts created by user "SYSTEM" are usable by all users in a system. Example usage:</para>
- + <programlisting># Create a file /etc/fstab.msnfs41client, which list the mounts
- +# which should be available system-wide
- +$ cat /etc/fstab.msnfs41client
- +nfs://[fe80::21b:1bff:fec3:7713]//bigdisk V nfs rw 0 0
- +# run "ms-nfs41-client-globalmountall-service", which runs
- +# /sbin/mountall_msnfs41client as user "SYSTEM" to read
- +# /etc/fstab.msnfs41client and mount the matching filesystems
- +sc start ms-nfs41-client-globalmountall-service</programlisting>
- + <para>BUG: "ms-nfs41-client-globalmountall-service" currently does not wait until <command>nfsd*.exe</command> is available for accepting mounts.</para>
- + </section>
- +
- + <section xml:id="wsl-usage">
- + <title>WSL usage</title>
- + <para>Example 1: Mount Windows NFSv4.2 share via Windows drive letter</para>
- + <para>Mount NFSv4.2 share in Windows to drive letter 'N':</para>
- + <programlisting>$ /sbin/nfs_mount -o rw 'N' nfs://10.49.202.230//bigdisk
- +Successfully mounted '10.49.202.230@2049' to drive 'N:'</programlisting>
- + <para>Within WSL mount drive letter 'N' to <filename>/mnt/n</filename></para>
- + <programlisting>$ sudo bash
- +$ mkdir /mnt/n
- +$ mount -t drvfs N: /mnt/n</programlisting>
- +
- + <para>Example 2: Mount Windows NFSv4.2 share via UNC path:</para>
- + <para>Mount NFSv4.2 share in Windows</para>
- + <programlisting>$ /sbin/nfs_mount -o rw nfs://10.49.202.230//bigdisk
- +Successfully mounted '10.49.202.230@2049' to drive '\0.49.202.230@2049\nfs4\bigdisk'</programlisting>
- + <para>Within WSL mount UNC path returned by <filename>/sbin/nfs_mount</filename></para>
- + <programlisting>$ sudo bash
- +$ mkdir /mnt/bigdisk
- +$ mount -t drvfs '\0.49.202.230@2049\nfs4\bigdisk' /mnt/bigdisk</programlisting>
- +
- + <para><emphasis role="strong">Known issues with WSL:</emphasis></para>
- + <itemizedlist>
- + <listitem><para>Softlinks do not work yet</para></listitem>
- + <listitem><para>Creating a hard link returns "Invalid Argument", maybe drvfs limitation</para></listitem>
- + <listitem><para>Not all POSIX file types (e.g. block devices) etc. are supported</para></listitem>
- + </itemizedlist>
- + </section>
- + </section>
- + </section>
- +
- + <section xml:id="notes">
- + <title>Notes</title>
- + <itemizedlist>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <para>UNC paths are supported, after successful mounting <filename>/sbin/nfs_mount</filename> will list the paths in Cygwin/MSYS2 UNC format.</para>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <para>Workflow for <literal>nfs://</literal>-URLs:
- + <itemizedlist>
- + <listitem><para>Create <literal>nfs://</literal>-URLs with <command>nfsurlconv</command>, read <command>$ nfsurlconv --man #</command> for usage</para></listitem>
- + <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>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <para>performance: All binaries are built without any optimisation, so the filesystem is much slower than it could be.</para>
- + </listitem>
- + <listitem>
- + <para>bad performance due to Windows Defender AntiVirus:
- + <itemizedlist>
- + <listitem>
- + <para>Option 1: disable Windows defender realtime monitoring (requires Administrator shell)</para>
- + <programlisting>powershell -Command 'Set-MpPreference -DisableRealtimeMonitoring 1'</programlisting>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>performance: Use <literal>vmxnet3</literal> in VMware to improve performance</para>
- + </listitem>
- + <listitem>
- + <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>
- + <para><emphasis role="strong">Example 1</emphasis> (assuming that Windows, Linux NFSv4 client and NFSv4 server have a user "siegfried_wulsch"):</para>
- + <itemizedlist>
- + <listitem>
- + <para>On Windows on a NFSv4 filesystem:</para>
- + <programlisting>$ icacls myhorribledata.txt /grant "siegfried_wulsch:WD" #</programlisting>
- + </listitem>
- + <listitem>
- + <para>On Linux NFSv4 clients you will then see this:</para>
- + <programlisting>$ nfs4_getfacl myhorribledata.txt
- +A::OWNER@:rwatTcCy
- +A::siegfried_wulsch@global.loc:rwatcy
- +A::GROUP@:rtcy
- +A::EVERYONE@:rtcy</programlisting>
- + </listitem>
- + </itemizedlist>
- + <para><emphasis role="strong">Example 2</emphasis> (assuming that Windows, Linux NFSv4 client and NFSv4 server have a group "cygwingrp2"):</para>
- + <itemizedlist>
- + <listitem>
- + <para>On Windows on a NFSv4 filesystem:</para>
- + <programlisting>$ icacls myhorribledata.txt /grant "cygwingrp2:(WDAC)" /t /c #</programlisting>
- + </listitem>
- + <listitem>
- + <para>On Linux NFSv4 clients you will then see this:</para>
- + <programlisting>$ nfs4_getfacl myhorribledata.txt
- +A::OWNER@:rwatTcCy
- +A::GROUP@:rtcy
- +A:g:cygwingrp2@global.loc:rtcy
- +A::EVERYONE@:rtcy</programlisting>
- + </listitem>
- + </itemizedlist>
- + </listitem>
- + <listitem>
- + <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 < 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>
- + </listitem>
- + <listitem>
- + <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 >= 1024.</para>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + </itemizedlist>
- + </section>
- +
- + <section xml:id="known-issues">
- + <title>Known issues</title>
- + <itemizedlist>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <para>If <filename>nfsd_debug.exe</filename> crashes or gets killed, the only safe way to run it again requires a reboot</para>
- + </listitem>
- + <listitem>
- + <para>LDAP support does not work yet</para>
- + </listitem>
- + <listitem>
- + <para>Attribute caching is too aggressive</para>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <para>If <filename>nfsd.exe</filename> is restarted while a drive is mapped, that drive needs to be remounted before further use.</para>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <para>File access timestamps might be wrong for delegations.</para>
- + </listitem>
- + <listitem>
- + <para>Extended attributes are supported with some limitations:
- + <itemizedlist>
- + <listitem><para>a) the server must support NFS Named Attributes,</para></listitem>
- + <listitem><para>b) the order of listings cannot be guaranteed by NFS, and</para></listitem>
- + <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>
- + </itemizedlist>
- + </para>
- + </listitem>
- + <listitem>
- + <para>Win10/32bit-only: <command>$ net use H: /delete #</command> does not work, use <command>$ nfs_umount 'H'</command> instead #</para>
- + </listitem>
- + <listitem>
- + <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>
- + <programlisting>{Fehler beim verzoegerten Schreibvorgang} Nicht alle Daten fuer die
- +Datei "\\34.159.25.153@2049\nfs4\export\nfs4export\gcc\lto-dump.exe"
- +konnten gespeichert werden. Daten gingen verloren.
- +Dieser Fehler wurde von dem Server zurueckgegeben, auf dem sich die
- +Datei befindet. Versuchen Sie, die Datei woanders zu speichern.</programlisting>
- + </listitem>
- + </itemizedlist>
- + </section>
- +
- + <section xml:id="troubleshooting-debugging">
- + <title>Troubleshooting && finding bugs/debugging</title>
- + <itemizedlist>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <para>The "msnfs41client" script has the option "<literal>watch_kernel_debuglog</literal>" to get the debug output of the kernel module.</para>
- + <para>Run as Administrator: <command>$ /sbin/msnfs41client watch_kernel_debuglog #</command></para>
- + <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>
- + </listitem>
- + <listitem>
- + <para>Watching network traffic:
- + <itemizedlist>
- + <listitem><para>Use <command>$ /sbin/msnfs41client watch_nfs_traffic #</command> to watch the NFS network traffic</para></listitem>
- + <listitem>
- + <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>
- + <programlisting>$ nfsv4port=2049 ; /cygdrive/c/Program\ Files/Wireshark/tshark \
- + -f "port $nfsv4port" -d "tcp.port==${nfsv4port},rpc" -i Ethernet0</programlisting>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + </itemizedlist>
- + </para>
- + </listitem>
- + </itemizedlist>
- + </section>
- +
- + <section xml:id="development">
- + <title>Development</title>
- +
- + <section xml:id="source-code">
- + <title>Source code</title>
- + <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>
- + </section>
- +
- + <section xml:id="building_msnfs41client">
- + <title>Building ms-nfs41-client</title>
- +
- + <section xml:id="building-cygwin-makefile">
- + <title>Building ms-nfs41-client using Cygwin+Makefile</title>
- +
- + <section xml:id="required-software-makefile">
- + <title>Required Software</title>
- + <itemizedlist>
- + <listitem>
- + <para><emphasis role="bold">Option 1:</emphasis> Windows 10 with Visual Studio 2019</para>
- + <itemizedlist>
- + <listitem>
- + <para>Start Visual Studio 2019 installer and import the installer config file
- + <filename>ms-nfs41-client/build.vc19/ms-nfs41-client_vs2019.vsconfig</filename>, and then install Visual Studio.</para>
- + <note>
- + <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>
- + </note>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <para>Cygwin 64bit >= 3.5.0 (see <filename>ms-nfs41-clientcygwin/README.bintarball.txt</filename> for Cygwin 32bit and 64bit installation instructions)</para>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + </itemizedlist>
- + </listitem>
- + <listitem>
- + <para><emphasis role="bold">Option 2:</emphasis> Windows 10/11 with Visual Studio 2022</para>
- + <itemizedlist>
- + <listitem>
- + <para>Start Visual Studio 2022 installer and import the installer config file
- + <filename>ms-nfs41-client/build.vc19/ms-nfs41-client_vs2022.vsconfig</filename>, and then install Visual Studio.</para>
- + <note>
- + <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>
- + </note>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + <listitem>
- + <para>Cygwin 64bit >= 3.5.0 (see <filename>ms-nfs41-clientcygwin/README.bintarball.txt</filename> for Cygwin 32bit and 64bit installation instructions)</para>
- + </listitem>
- + <listitem>
- + <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>
- + </listitem>
- + </itemizedlist>
- + </listitem>
- + </itemizedlist>
- + </section>
- +
- + <section xml:id="build-project-makefile">
- + <title>Build the Project</title>
- + <itemizedlist>
- + <listitem>
- + <para><emphasis role="bold">Using Visual Studio 2019+Cygwin command line (bash/ksh93):</emphasis></para>
- + <programlisting># this creates a 32bit+kernel+64bit-kernel build for Windows 10+11
- +export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/:$PATH"
- +git clone https://github.com/kofemann/ms-nfs41-client.git
- +cd ms-nfs41-client
- +cd cygwin
- +make build
- +make installdest
- +make bintarball</programlisting>
- + </listitem>
- + <listitem>
- + <para><emphasis role="bold">Using Visual Studio 2022+Cygwin command line (bash/ksh93):</emphasis></para>
- + <programlisting># this creates a 64bit-kernel only build for Windows 11
- +export PATH="/cygdrive/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/:$PATH"
- +git clone https://github.com/kofemann/ms-nfs41-client.git
- +cd ms-nfs41-client
- +# "retarget" VS platform toolset to "v143"
- +# ("v142" should remain the default when comitting)
- +sed -i -E 's/<PlatformToolset>v142<\/PlatformToolset>/<PlatformToolset>v143<\/PlatformToolset>/g' $(find 'build.vc19' -name \*.vcxproj)
- +cd cygwin
- +make build64
- +make installdest64
- +make bintarball64</programlisting>
- + </listitem>
- + </itemizedlist>
- + <note>
- + <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>
- + <programlisting>cd ms-nfs41-client
- +sed -i -E 's/<LinkIncremental>true<\/LinkIncremental>/<LinkIncremental>false<\/LinkIncremental>/g' $(find build.vc19 -name \*.vcxproj)</programlisting>
- + <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>
- + </note>
- + </section>
- + </section>
- +
- + <section xml:id="testing">
- + <title>Testing</title>
- + <para>See <filename>tests/manual_testing.txt</filename></para>
- + </section>
- + </section>
- + </section>
- +
- + <section xml:id="mailinglist">
- + <title>Mailing list</title>
- + <para>Please direct any questions to <email>ms-nfs41-client-devel@lists.sourceforge.net</email>
- + (list <link xl:href="https://sourceforge.net/p/ms-nfs41-client/mailman/ms-nfs41-client-devel/">archive</link>)</para>
- + </section>
- +
- + <para>#EOF.</para>
- +</article>
- --
- 2.45.1
- From 3e258e53beceaf8ace696bf711c195d6701ee2df Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 30 May 2025 14:07:24 +0200
- Subject: [PATCH 2/5] daemon,libtirpc: Use types from <stdint.h> for XDR
- Use types from <stdint.h> for XDR
- Reported-by: Cedric Blancher <cedric.blancher@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/callback_xdr.c | 61 ++---
- daemon/nfs41_xdr.c | 470 ++++++++++++++++-----------------
- daemon/nfs42_xdr.c | 46 ++--
- libtirpc/libtirpc/libtirpc.def | 12 +
- libtirpc/src/xdr.c | 190 ++++++++++---
- libtirpc/tirpc/rpc/types.h | 19 +-
- libtirpc/tirpc/rpc/xdr.h | 9 +
- 7 files changed, 471 insertions(+), 336 deletions(-)
- diff --git a/daemon/callback_xdr.c b/daemon/callback_xdr.c
- index 7cf7132..7598db3 100644
- --- a/daemon/callback_xdr.c
- +++ b/daemon/callback_xdr.c
- @@ -1,9 +1,10 @@
- /* NFSv4.1 client for Windows
- * Copyright (C) 2012 The Regents of the University of Michigan
- - * Copyright (C) 2023-2025 Roland Mainz <roland.mainz@nrubsig.org>
- + * Copyright (C) 2024-2025 Roland Mainz <roland.mainz@nrubsig.org>
- *
- * Olga Kornievskaia <aglo@umich.edu>
- * Casey Bodley <cbodley@umich.edu>
- + * Roland Mainz <roland.mainz@nrubsig.org>
- *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- @@ -36,21 +37,21 @@ bool_t xdr_fattr4(XDR *xdr, fattr4 *fattr);
- static bool_t common_stateid(XDR *xdr, stateid4 *stateid)
- {
- - return xdr_u_int32_t(xdr, &stateid->seqid)
- + return xdr_uint32_t(xdr, &stateid->seqid)
- && xdr_opaque(xdr, (char*)stateid->other, NFS4_STATEID_OTHER);
- }
- static bool_t common_fh(XDR *xdr, nfs41_fh *fh)
- {
- - return xdr_u_int32_t(xdr, &fh->len)
- + return xdr_uint32_t(xdr, &fh->len)
- && fh->len <= NFS4_FHSIZE
- && xdr_opaque(xdr, (char*)fh->fh, fh->len);
- }
- static bool_t common_fsid(XDR *xdr, nfs41_fsid *fsid)
- {
- - return xdr_u_int64_t(xdr, &fsid->major)
- - && xdr_u_int64_t(xdr, &fsid->minor);
- + return xdr_uint64_t(xdr, &fsid->major)
- + && xdr_uint64_t(xdr, &fsid->minor);
- }
- static bool_t common_notify4(XDR *xdr, struct notify4 *notify)
- @@ -67,10 +68,10 @@ static bool_t op_cb_layoutrecall_file(XDR *xdr, struct cb_recall_file *args)
- result = common_fh(xdr, &args->fh);
- if (!result) { CBX_ERR("layoutrecall_file.fh"); goto out; }
- - result = xdr_u_int64_t(xdr, &args->offset);
- + result = xdr_uint64_t(xdr, &args->offset);
- if (!result) { CBX_ERR("layoutrecall_file.offset"); goto out; }
- - result = xdr_u_int64_t(xdr, &args->length);
- + result = xdr_uint64_t(xdr, &args->length);
- if (!result) { CBX_ERR("layoutrecall_file.length"); goto out; }
- result = common_stateid(xdr, &args->stateid);
- @@ -132,7 +133,7 @@ static bool_t op_cb_recall_slot_args(XDR *xdr, struct cb_recall_slot_args *res)
- {
- bool_t result;
- - result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
- + result = xdr_uint32_t(xdr, &res->target_highest_slotid);
- if (!result) { CBX_ERR("recall_slot.target_highest_slotid"); goto out; }
- out:
- return result;
- @@ -154,10 +155,10 @@ static bool_t op_cb_sequence_ref(XDR *xdr, struct cb_sequence_ref *args)
- {
- bool_t result;
- - result = xdr_u_int32_t(xdr, &args->sequenceid);
- + result = xdr_uint32_t(xdr, &args->sequenceid);
- if (!result) { CBX_ERR("sequence_ref.sequenceid"); goto out; }
- - result = xdr_u_int32_t(xdr, &args->slotid);
- + result = xdr_uint32_t(xdr, &args->slotid);
- if (!result) { CBX_ERR("sequence_ref.slotid"); goto out; }
- out:
- return result;
- @@ -184,13 +185,13 @@ static bool_t op_cb_sequence_args(XDR *xdr, struct cb_sequence_args *args)
- result = xdr_opaque(xdr, args->sessionid, NFS4_SESSIONID_SIZE);
- if (!result) { CBX_ERR("sequence_args.sessionid"); goto out; }
- - result = xdr_u_int32_t(xdr, &args->sequenceid);
- + result = xdr_uint32_t(xdr, &args->sequenceid);
- if (!result) { CBX_ERR("sequence_args.sequenceid"); goto out; }
- - result = xdr_u_int32_t(xdr, &args->slotid);
- + result = xdr_uint32_t(xdr, &args->slotid);
- if (!result) { CBX_ERR("sequence_args.slotid"); goto out; }
- - result = xdr_u_int32_t(xdr, &args->highest_slotid);
- + result = xdr_uint32_t(xdr, &args->highest_slotid);
- if (!result) { CBX_ERR("sequence_args.highest_slotid"); goto out; }
- result = xdr_bool(xdr, &args->cachethis);
- @@ -211,16 +212,16 @@ static bool_t op_cb_sequence_res_ok(XDR *xdr, struct cb_sequence_res_ok *res)
- result = xdr_opaque(xdr, res->sessionid, NFS4_SESSIONID_SIZE);
- if (!result) { CBX_ERR("sequence_res.sessionid"); goto out; }
- - result = xdr_u_int32_t(xdr, &res->sequenceid);
- + result = xdr_uint32_t(xdr, &res->sequenceid);
- if (!result) { CBX_ERR("sequence_res.sequenceid"); goto out; }
- - result = xdr_u_int32_t(xdr, &res->slotid);
- + result = xdr_uint32_t(xdr, &res->slotid);
- if (!result) { CBX_ERR("sequence_res.slotid"); goto out; }
- - result = xdr_u_int32_t(xdr, &res->highest_slotid);
- + result = xdr_uint32_t(xdr, &res->highest_slotid);
- if (!result) { CBX_ERR("sequence_res.highest_slotid"); goto out; }
- - result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
- + result = xdr_uint32_t(xdr, &res->target_highest_slotid);
- if (!result) { CBX_ERR("sequence_res.target_highest_slotid"); goto out; }
- out:
- return result;
- @@ -270,12 +271,12 @@ static bool_t info_to_fattr4(nfs41_file_info *info, fattr4 *fattr)
- * FIXME: What about |FATTR4_WORD1_SPACE_USED| ?
- */
- if (bitmap_isset(&info->attrmask, 0, FATTR4_WORD0_CHANGE)) {
- - result = xdr_u_hyper(&fattr_xdr, &info->change);
- + result = xdr_uint64_t(&fattr_xdr, &info->change);
- if (!result) { CBX_ERR("getattr.info.change"); goto out; }
- bitmap_set(&fattr->attrmask, 0, FATTR4_WORD0_CHANGE);
- }
- if (bitmap_isset(&info->attrmask, 0, FATTR4_WORD0_SIZE)) {
- - result = xdr_u_hyper(&fattr_xdr, &info->size);
- + result = xdr_uint64_t(&fattr_xdr, &info->size);
- if (!result) { CBX_ERR("getattr.info.size"); goto out; }
- bitmap_set(&fattr->attrmask, 0, FATTR4_WORD0_SIZE);
- }
- @@ -336,7 +337,7 @@ static bool_t op_cb_notify_args(XDR *xdr, struct cb_notify_args *res)
- {
- bool_t result;
- - result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
- + result = xdr_uint32_t(xdr, &res->target_highest_slotid);
- if (!result) { CBX_ERR("notify.target_highest_slotid"); goto out; }
- out:
- return result;
- @@ -357,7 +358,7 @@ static bool_t op_cb_push_deleg_args(XDR *xdr, struct cb_push_deleg_args *res)
- {
- bool_t result;
- - result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
- + result = xdr_uint32_t(xdr, &res->target_highest_slotid);
- if (!result) { CBX_ERR("push_deleg.target_highest_slotid"); goto out; }
- out:
- return result;
- @@ -378,7 +379,7 @@ static bool_t op_cb_recall_any_args(XDR *xdr, struct cb_recall_any_args *res)
- {
- bool_t result;
- - result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
- + result = xdr_uint32_t(xdr, &res->target_highest_slotid);
- if (!result) { CBX_ERR("recall_any.target_highest_slotid"); goto out; }
- out:
- return result;
- @@ -399,7 +400,7 @@ static bool_t op_cb_recallable_obj_avail_args(XDR *xdr, struct cb_recallable_obj
- {
- bool_t result;
- - result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
- + result = xdr_uint32_t(xdr, &res->target_highest_slotid);
- if (!result) { CBX_ERR("recallable_obj_avail.target_highest_slotid"); goto out; }
- out:
- return result;
- @@ -420,7 +421,7 @@ static bool_t op_cb_wants_cancelled_args(XDR *xdr, struct cb_wants_cancelled_arg
- {
- bool_t result;
- - result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
- + result = xdr_uint32_t(xdr, &res->target_highest_slotid);
- if (!result) { CBX_ERR("wants_cancelled.target_highest_slotid"); goto out; }
- out:
- return result;
- @@ -441,7 +442,7 @@ static bool_t op_cb_notify_lock_args(XDR *xdr, struct cb_notify_lock_args *res)
- {
- bool_t result;
- - result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
- + result = xdr_uint32_t(xdr, &res->target_highest_slotid);
- if (!result) { CBX_ERR("notify_lock.target_highest_slotid"); goto out; }
- out:
- return result;
- @@ -462,7 +463,7 @@ static bool_t cb_notify_deviceid_change(XDR *xdr, struct notify_deviceid4 *chang
- {
- bool_t result;
- - result = xdr_u_int32_t(xdr, (uint32_t*)&change->layouttype);
- + result = xdr_uint32_t(xdr, (uint32_t*)&change->layouttype);
- if (!result) { CBX_ERR("notify_deviceid.change.layouttype"); goto out; }
- result = xdr_opaque(xdr, (char*)change->deviceid, PNFS_DEVICEID_SIZE);
- @@ -478,7 +479,7 @@ static bool_t cb_notify_deviceid_delete(XDR *xdr, struct notify_deviceid4 *chang
- {
- bool_t result;
- - result = xdr_u_int32_t(xdr, (uint32_t*)&change->layouttype);
- + result = xdr_uint32_t(xdr, (uint32_t*)&change->layouttype);
- if (!result) { CBX_ERR("notify_deviceid.delete.layouttype"); goto out; }
- result = xdr_opaque(xdr, (char*)change->deviceid, PNFS_DEVICEID_SIZE);
- @@ -559,7 +560,7 @@ out:
- /* CB_COMPOUND */
- static bool_t cb_compound_tag(XDR *xdr, struct cb_compound_tag *args)
- {
- - return xdr_u_int32_t(xdr, &args->len)
- + return xdr_uint32_t(xdr, &args->len)
- && args->len <= CB_COMPOUND_MAX_TAG
- && xdr_opaque(xdr, args->str, args->len);
- }
- @@ -599,11 +600,11 @@ bool_t proc_cb_compound_args(XDR *xdr, struct cb_compound_args *args)
- result = cb_compound_tag(xdr, &args->tag);
- if (!result) { CBX_ERR("compound.tag"); goto out; }
- - result = xdr_u_int32_t(xdr, &args->minorversion);
- + result = xdr_uint32_t(xdr, &args->minorversion);
- if (!result) { CBX_ERR("compound.minorversion"); goto out; }
- /* "superfluous in NFSv4.1 and MUST be ignored by the client" */
- - result = xdr_u_int32_t(xdr, &args->callback_ident);
- + result = xdr_uint32_t(xdr, &args->callback_ident);
- if (!result) { CBX_ERR("compound.callback_ident"); goto out; }
- result = xdr_array(xdr, (char**)&args->argarray,
- diff --git a/daemon/nfs41_xdr.c b/daemon/nfs41_xdr.c
- index 927bfe8..e1a20ee 100644
- --- a/daemon/nfs41_xdr.c
- +++ b/daemon/nfs41_xdr.c
- @@ -60,15 +60,15 @@ bool_t xdr_bitmap4(
- BITMAP4_MAXCOUNT);
- return FALSE;
- }
- - if (!xdr_u_int32_t(xdr, &bitmap->count))
- + if (!xdr_uint32_t(xdr, &bitmap->count))
- return FALSE;
- for (i = 0; i < bitmap->count; i++)
- - if (!xdr_u_int32_t(xdr, &bitmap->arr[i]))
- + if (!xdr_uint32_t(xdr, &bitmap->arr[i]))
- return FALSE;
- } else if (xdr->x_op == XDR_DECODE) {
- - if (!xdr_u_int32_t(xdr, &bitmap->count))
- + if (!xdr_uint32_t(xdr, &bitmap->count))
- return FALSE;
- if (bitmap->count > BITMAP4_MAXCOUNT) {
- eprintf("decode_bitmap4: count (%d) must be <= %d\n",
- @@ -78,9 +78,9 @@ bool_t xdr_bitmap4(
- }
- for (i = 0; i < bitmap->count; i++)
- - if (!xdr_u_int32_t(xdr, &bitmap->arr[i]))
- + if (!xdr_uint32_t(xdr, &bitmap->arr[i]))
- return FALSE;
- - } else
- + } else
- return FALSE;
- return TRUE;
- @@ -91,10 +91,10 @@ static bool_t xdr_nfstime4(
- XDR *xdr,
- nfstime4 *nt)
- {
- - if (!xdr_hyper(xdr, &nt->seconds))
- + if (!xdr_int64_t(xdr, &nt->seconds))
- return FALSE;
- - return xdr_u_int32_t(xdr, &nt->nseconds);
- + return xdr_uint32_t(xdr, &nt->nseconds);
- }
- @@ -124,7 +124,7 @@ static bool_t xdr_settime4(
- if (xdr->x_op != XDR_ENCODE) /* not used for decode */
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &how))
- + if (!xdr_uint32_t(xdr, &how))
- return FALSE;
- if (how == SET_TO_CLIENT_TIME4)
- @@ -138,7 +138,7 @@ bool_t xdr_stateid4(
- XDR *xdr,
- stateid4 *si)
- {
- - if (!xdr_u_int32_t(xdr, &si->seqid))
- + if (!xdr_uint32_t(xdr, &si->seqid))
- return FALSE;
- return xdr_opaque(xdr, (char *)si->other, NFS4_STATEID_OTHER);
- @@ -171,10 +171,10 @@ static bool_t xdr_fsid(
- XDR *xdr,
- nfs41_fsid *fsid)
- {
- - if (!xdr_u_hyper(xdr, &fsid->major))
- + if (!xdr_uint64_t(xdr, &fsid->major))
- return FALSE;
- - return xdr_u_hyper(xdr, &fsid->minor);
- + return xdr_uint64_t(xdr, &fsid->minor);
- }
- @@ -213,10 +213,10 @@ static bool_t xdr_state_owner4(
- * client ID from the session ID of the SEQUENCE operation of the
- * COMPOUND request. */
- if (xdr->x_op == XDR_ENCODE) {
- - if (!xdr_u_hyper(xdr, &clientid)) /* clientid = 0 */
- + if (!xdr_uint64_t(xdr, &clientid)) /* clientid = 0 */
- return FALSE;
- } else if (xdr->x_op == XDR_DECODE) {
- - if (!xdr_u_hyper(xdr, &clientid))
- + if (!xdr_uint64_t(xdr, &clientid))
- return FALSE;
- } else return FALSE;
- @@ -237,11 +237,11 @@ static bool_t xdr_layout_types(
- *layout_type = 0;
- - if (!xdr_u_int32_t(xdr, &count))
- + if (!xdr_uint32_t(xdr, &count))
- return FALSE;
- for (i = 0; i < count; i++) {
- - if (!xdr_u_int32_t(xdr, &type))
- + if (!xdr_uint32_t(xdr, &type))
- return FALSE;
- *layout_type |= 1 << (type - 1);
- @@ -255,23 +255,23 @@ static bool_t xdr_threshold_item(
- {
- bitmap4 bitmap;
- - if (!xdr_u_int32_t(xdr, &item->type))
- + if (!xdr_uint32_t(xdr, &item->type))
- return FALSE;
- if (!xdr_bitmap4(xdr, &bitmap))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &bitmap.count))
- + if (!xdr_uint32_t(xdr, &bitmap.count))
- return FALSE;
- if (bitmap.count) {
- - if (bitmap.arr[0] & 0x1 && !xdr_u_hyper(xdr, &item->hints[0]))
- + if (bitmap.arr[0] & 0x1 && !xdr_uint64_t(xdr, &item->hints[0]))
- return FALSE;
- - if (bitmap.arr[0] & 0x2 && !xdr_u_hyper(xdr, &item->hints[1]))
- + if (bitmap.arr[0] & 0x2 && !xdr_uint64_t(xdr, &item->hints[1]))
- return FALSE;
- - if (bitmap.arr[0] & 0x4 && !xdr_u_hyper(xdr, &item->hints[2]))
- + if (bitmap.arr[0] & 0x4 && !xdr_uint64_t(xdr, &item->hints[2]))
- return FALSE;
- - if (bitmap.arr[0] & 0x8 && !xdr_u_hyper(xdr, &item->hints[3]))
- + if (bitmap.arr[0] & 0x8 && !xdr_uint64_t(xdr, &item->hints[3]))
- return FALSE;
- }
- return TRUE;
- @@ -283,7 +283,7 @@ static bool_t xdr_mdsthreshold(
- {
- uint32_t i;
- - if (!xdr_u_int32_t(xdr, &mdsthreshold->count))
- + if (!xdr_uint32_t(xdr, &mdsthreshold->count))
- return FALSE;
- if (mdsthreshold->count > MAX_MDSTHRESHOLD_ITEMS)
- @@ -301,13 +301,13 @@ static bool_t xdr_nfsace4(
- {
- char *who = ace->who;
- - if (!xdr_u_int32_t(xdr, &ace->acetype))
- + if (!xdr_uint32_t(xdr, &ace->acetype))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &ace->aceflag))
- + if (!xdr_uint32_t(xdr, &ace->aceflag))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &ace->acemask))
- + if (!xdr_uint32_t(xdr, &ace->acemask))
- return FALSE;
- /* 'who' is a static array, so don't try to free it */
- @@ -321,7 +321,7 @@ static bool_t xdr_nfsdacl41(
- XDR *xdr,
- nfsacl41 *acl)
- {
- - if (!xdr_u_int32_t(xdr, &acl->flag))
- + if (!xdr_uint32_t(xdr, &acl->flag))
- return FALSE;
- return xdr_array(xdr, (char**)&acl->aces, &acl->count,
- @@ -352,7 +352,7 @@ static bool_t decode_pathname4(
- u_int32_t i, count, len, remaining;
- /* decode the number of components */
- - if (!xdr_u_int32_t(xdr, &count))
- + if (!xdr_uint32_t(xdr, &count))
- return FALSE;
- pos = (char *)path->path;
- @@ -387,7 +387,7 @@ static bool_t decode_fs_location4(
- u_int32_t i, count, len;
- /* decode the number of servers */
- - if (!xdr_u_int32_t(xdr, &count))
- + if (!xdr_uint32_t(xdr, &count))
- return FALSE;
- /* allocate the fs_location_server array */
- @@ -430,7 +430,7 @@ static bool_t decode_fs_locations4(
- if (!decode_pathname4(xdr, &locations->path))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &count))
- + if (!xdr_uint32_t(xdr, &count))
- return FALSE;
- /* allocate the fs_location array */
- @@ -498,10 +498,10 @@ static bool_t encode_ssv_sp_parms4(
- &spp->ssp_encr_algs_len, NFS4_OPAQUE_LIMIT))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &spp->ssp_window))
- + if (!xdr_uint32_t(xdr, &spp->ssp_window))
- return FALSE;
- - return xdr_u_int32_t(xdr, &spp->ssp_num_gss_handles);
- + return xdr_uint32_t(xdr, &spp->ssp_num_gss_handles);
- }
- #endif
- @@ -511,7 +511,7 @@ static bool_t xdr_state_protect4_a(
- {
- bool_t result = TRUE;
- - if (!xdr_u_int32_t(xdr, (u_int32_t *)&spa->spa_how))
- + if (!xdr_uint32_t(xdr, (u_int32_t *)&spa->spa_how))
- return FALSE;
- switch (spa->spa_how)
- @@ -567,7 +567,7 @@ static bool_t encode_op_exchange_id(
- if (!xdr_client_owner4(xdr, args->eia_clientowner))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->eia_flags))
- + if (!xdr_uint32_t(xdr, &args->eia_flags))
- return FALSE;
- if (!xdr_state_protect4_a(xdr, &args->eia_state_protect))
- @@ -575,12 +575,12 @@ static bool_t encode_op_exchange_id(
- if (args->eia_client_impl_id)
- {
- - if (!xdr_u_int32_t(xdr, &one))
- + if (!xdr_uint32_t(xdr, &one))
- return FALSE;
- return xdr_nfs_impl_id4(xdr, args->eia_client_impl_id);
- }
- else
- - return xdr_u_int32_t(xdr, &zero);
- + return xdr_uint32_t(xdr, &zero);
- }
- #if 0
- @@ -604,22 +604,22 @@ static bool_t decode_ssv_prot_info4(
- if (!decode_state_protect_ops4(xdr, &spi->spi_ops))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &spi->spi_hash_alg))
- + if (!xdr_uint32_t(xdr, &spi->spi_hash_alg))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &spi->spi_encr_alg))
- + if (!xdr_uint32_t(xdr, &spi->spi_encr_alg))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &spi->spi_ssv_len))
- + if (!xdr_uint32_t(xdr, &spi->spi_ssv_len))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &spi->spi_window))
- + if (!xdr_uint32_t(xdr, &spi->spi_window))
- return FALSE;
- /* TODO: spi->spi_handles */
- - return xdr_u_int32_t(xdr, 0);
- + return xdr_uint32_t(xdr, 0);
- /*
- - if (!xdr_u_int32_t(xdr, &spi->spi_handles.count))
- + if (!xdr_uint32_t(xdr, &spi->spi_handles.count))
- return FALSE;
- for (i = 0; i < spi->spi_handles.count; i++)
- @@ -636,7 +636,7 @@ static bool_t xdr_state_protect4_r(
- {
- bool_t result = TRUE;
- - if (!xdr_u_int32_t(xdr, (uint32_t *)&spr->spr_how))
- + if (!xdr_uint32_t(xdr, (uint32_t *)&spr->spr_how))
- return FALSE;
- switch (spr->spr_how)
- @@ -666,7 +666,7 @@ static bool_t xdr_server_owner4(
- {
- char *so_major_id = so->so_major_id;
- - if (!xdr_u_hyper(xdr, &so->so_minor_id))
- + if (!xdr_uint64_t(xdr, &so->so_minor_id))
- return FALSE;
- return xdr_bytes(xdr, (char **)&so_major_id,
- @@ -683,19 +683,19 @@ static bool_t decode_op_exchange_id(
- if (unexpected_op(resop->op, OP_EXCHANGE_ID))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status != NFS4_OK)
- return TRUE;
- - if (!xdr_u_hyper(xdr, &res->clientid))
- + if (!xdr_uint64_t(xdr, &res->clientid))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->sequenceid))
- + if (!xdr_uint32_t(xdr, &res->sequenceid))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->flags))
- + if (!xdr_uint32_t(xdr, &res->flags))
- return FALSE;
- if (!xdr_state_protect4_r(xdr, &res->state_protect))
- @@ -719,51 +719,51 @@ static bool_t xdr_channel_attrs4(
- uint32_t one = 1;
- /* count4 ca_headerpadsize */
- - if (!xdr_u_int32_t(xdr, &attrs->ca_headerpadsize))
- + if (!xdr_uint32_t(xdr, &attrs->ca_headerpadsize))
- return FALSE;
- /* count4 ca_maxrequestsize */
- - if (!xdr_u_int32_t(xdr, &attrs->ca_maxrequestsize))
- + if (!xdr_uint32_t(xdr, &attrs->ca_maxrequestsize))
- return FALSE;
- /* count4 ca_maxresponsesize */
- - if (!xdr_u_int32_t(xdr, &attrs->ca_maxresponsesize))
- + if (!xdr_uint32_t(xdr, &attrs->ca_maxresponsesize))
- return FALSE;
- /* count4 ca_maxresponsesize_cached */
- - if (!xdr_u_int32_t(xdr, &attrs->ca_maxresponsesize_cached))
- + if (!xdr_uint32_t(xdr, &attrs->ca_maxresponsesize_cached))
- return FALSE;
- /* count4 ca_maxoperations */
- - if (!xdr_u_int32_t(xdr, &attrs->ca_maxoperations))
- + if (!xdr_uint32_t(xdr, &attrs->ca_maxoperations))
- return FALSE;
- /* count4 ca_maxrequests */
- - if (!xdr_u_int32_t(xdr, &attrs->ca_maxrequests))
- + if (!xdr_uint32_t(xdr, &attrs->ca_maxrequests))
- return FALSE;
- if (xdr->x_op == XDR_ENCODE) {
- /* uint32_t ca_rdma_ird<1> */
- if (attrs->ca_rdma_ird)
- {
- - if (!xdr_u_int32_t(xdr, &one))
- + if (!xdr_uint32_t(xdr, &one))
- return FALSE;
- - return xdr_u_int32_t(xdr, attrs->ca_rdma_ird);
- + return xdr_uint32_t(xdr, attrs->ca_rdma_ird);
- }
- else {
- - return xdr_u_int32_t(xdr, &zero);
- + return xdr_uint32_t(xdr, &zero);
- }
- }
- else if (xdr->x_op == XDR_DECODE) {
- #if 0
- u_int32_t count;
- /* uint32_t ca_rdma_ird<1> */
- - if (!xdr_u_int32_t(xdr, &count))
- + if (!xdr_uint32_t(xdr, &count))
- return FALSE;
- if (count > 1)
- return FALSE;
- if (count)
- - return xdr_u_int32_t(xdr, attrs->ca_rdma_ird);
- + return xdr_uint32_t(xdr, attrs->ca_rdma_ird);
- else
- #endif
- return TRUE;
- @@ -781,18 +781,18 @@ static bool_t encode_backchannel_sec_parms(
- {
- uint32_t zero = 0;
- - if (!xdr_u_int32_t(xdr, &args->type))
- + if (!xdr_uint32_t(xdr, &args->type))
- return FALSE;
- switch (args->type) {
- case AUTH_NONE: return TRUE;
- case AUTH_SYS:
- - if (!xdr_u_int32_t(xdr, &args->u.auth_sys.stamp))
- + if (!xdr_uint32_t(xdr, &args->u.auth_sys.stamp))
- return FALSE;
- if (!xdr_string(xdr, &args->u.auth_sys.machinename, NI_MAXHOST))
- return FALSE;
- - return xdr_u_int32_t(xdr, &zero) && xdr_u_int32_t(xdr, &zero) &&
- - xdr_u_int32_t(xdr, &zero);
- + return xdr_uint32_t(xdr, &zero) && xdr_uint32_t(xdr, &zero) &&
- + xdr_uint32_t(xdr, &zero);
- case RPCSEC_GSS:
- default:
- return FALSE;
- @@ -811,15 +811,15 @@ static bool_t encode_op_create_session(
- return FALSE;
- /* clientid4 csa_clientid */
- - if (!xdr_u_hyper(xdr, &args->csa_clientid))
- + if (!xdr_uint64_t(xdr, &args->csa_clientid))
- return FALSE;
- /* sequenceid4 csa_sequence */
- - if (!xdr_u_int32_t(xdr, &args->csa_sequence))
- + if (!xdr_uint32_t(xdr, &args->csa_sequence))
- return FALSE;
- /* TODO: uint32_t csa_flags = 0 */
- - if (!xdr_u_int32_t(xdr, &args->csa_flags))
- + if (!xdr_uint32_t(xdr, &args->csa_flags))
- return FALSE;
- /* channel_attrs4 csa_fore_chan_attrs */
- @@ -831,7 +831,7 @@ static bool_t encode_op_create_session(
- return FALSE;
- /* TODO: uint32_t csa_cb_program = 1234 */
- - if (!xdr_u_int32_t(xdr, &args->csa_cb_program))
- + if (!xdr_uint32_t(xdr, &args->csa_cb_program))
- return FALSE;
- return xdr_array(xdr, (char **)&cb_secparams, &cb_count,
- @@ -848,7 +848,7 @@ static bool_t decode_op_create_session(
- if (unexpected_op(resop->op, OP_CREATE_SESSION))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &opstatus))
- + if (!xdr_uint32_t(xdr, &opstatus))
- return FALSE;
- if (opstatus != NFS4_OK)
- @@ -858,11 +858,11 @@ static bool_t decode_op_create_session(
- return FALSE;
- /* sequenceid4 csr_sequence */
- - if (!xdr_u_int32_t(xdr, &res->csr_sequence))
- + if (!xdr_uint32_t(xdr, &res->csr_sequence))
- return FALSE;
- /* uint32_t csr_flags */
- - if (!xdr_u_int32_t(xdr, &res->csr_flags))
- + if (!xdr_uint32_t(xdr, &res->csr_flags))
- return FALSE;
- /* channel_attrs4 csr_fore_chan_attrs */
- @@ -895,7 +895,7 @@ static bool_t encode_op_bind_conn_to_session(
- if (!xdr_enum(xdr, (enum_t *)&args->dir))
- return FALSE;
- - return xdr_u_int32_t(xdr, &zero); /* bctsa_use_conn_in_rdma_mode = false */
- + return xdr_uint32_t(xdr, &zero); /* bctsa_use_conn_in_rdma_mode = false */
- }
- static bool_t decode_op_bind_conn_to_session(
- @@ -950,7 +950,7 @@ static bool_t decode_op_destroy_session(
- if (unexpected_op(resop->op, OP_DESTROY_SESSION))
- return FALSE;
- - return xdr_u_int32_t(xdr, &res->dsr_status);
- + return xdr_uint32_t(xdr, &res->dsr_status);
- }
- /*
- @@ -965,7 +965,7 @@ static bool_t encode_op_destroy_clientid(
- if (unexpected_op(argop->op, OP_DESTROY_CLIENTID))
- return FALSE;
- - return xdr_u_hyper(xdr, &args->dca_clientid);
- + return xdr_uint64_t(xdr, &args->dca_clientid);
- }
- static bool_t decode_op_destroy_clientid(
- @@ -977,7 +977,7 @@ static bool_t decode_op_destroy_clientid(
- if (unexpected_op(resop->op, OP_DESTROY_CLIENTID))
- return FALSE;
- - return xdr_u_int32_t(xdr, &res->dcr_status);
- + return xdr_uint32_t(xdr, &res->dcr_status);
- }
- @@ -996,13 +996,13 @@ static bool_t encode_op_sequence(
- if (!xdr_opaque(xdr, (char *)args->sa_sessionid, NFS4_SESSIONID_SIZE))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->sa_sequenceid))
- + if (!xdr_uint32_t(xdr, &args->sa_sequenceid))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->sa_slotid))
- + if (!xdr_uint32_t(xdr, &args->sa_slotid))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->sa_highest_slotid))
- + if (!xdr_uint32_t(xdr, &args->sa_highest_slotid))
- return FALSE;
- return xdr_bool(xdr, &args->sa_cachethis);
- @@ -1015,19 +1015,19 @@ static bool_t xdr_sequence_res_ok(
- if (!xdr_opaque(xdr, (char *)res->sr_sessionid, NFS4_SESSIONID_SIZE))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->sr_sequenceid))
- + if (!xdr_uint32_t(xdr, &res->sr_sequenceid))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->sr_slotid))
- + if (!xdr_uint32_t(xdr, &res->sr_slotid))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->sr_highest_slotid))
- + if (!xdr_uint32_t(xdr, &res->sr_highest_slotid))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->sr_target_highest_slotid))
- + if (!xdr_uint32_t(xdr, &res->sr_target_highest_slotid))
- return FALSE;
- - return xdr_u_int32_t(xdr, &res->sr_status_flags);
- + return xdr_uint32_t(xdr, &res->sr_status_flags);
- }
- static bool_t decode_op_sequence(
- @@ -1039,7 +1039,7 @@ static bool_t decode_op_sequence(
- if (unexpected_op(resop->op, OP_SEQUENCE))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->sr_status))
- + if (!xdr_uint32_t(xdr, &res->sr_status))
- return FALSE;
- if (res->sr_status == NFS4_OK)
- @@ -1102,7 +1102,7 @@ static bool_t decode_op_putfh(
- if (unexpected_op(resop->op, OP_PUTFH))
- return FALSE;
- - return xdr_u_int32_t(xdr, &res->status);
- + return xdr_uint32_t(xdr, &res->status);
- }
- @@ -1128,7 +1128,7 @@ static bool_t decode_op_putpubfh(
- if (unexpected_op(resop->op, OP_PUTPUBFH))
- return FALSE;
- - return xdr_u_int32_t(xdr, &res->status);
- + return xdr_uint32_t(xdr, &res->status);
- }
- @@ -1154,7 +1154,7 @@ static bool_t decode_op_putrootfh(
- if (unexpected_op(resop->op, OP_PUTROOTFH))
- return FALSE;
- - return xdr_u_int32_t(xdr, &res->status);
- + return xdr_uint32_t(xdr, &res->status);
- }
- @@ -1181,7 +1181,7 @@ static bool_t decode_op_getfh(
- if (unexpected_op(resop->op, OP_GETFH))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- @@ -1215,7 +1215,7 @@ static bool_t decode_op_lookup(
- if (unexpected_op(resop->op, OP_LOOKUP))
- return FALSE;
- - return xdr_u_int32_t(xdr, &res->status);
- + return xdr_uint32_t(xdr, &res->status);
- }
- @@ -1231,7 +1231,7 @@ static bool_t encode_op_access(
- if (unexpected_op(argop->op, OP_ACCESS))
- return FALSE;
- - return xdr_u_int32_t(xdr, &args->access);
- + return xdr_uint32_t(xdr, &args->access);
- }
- static bool_t decode_op_access(
- @@ -1243,15 +1243,15 @@ static bool_t decode_op_access(
- if (unexpected_op(resop->op, OP_ACCESS))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- {
- - if (!xdr_u_int32_t(xdr, &res->supported))
- + if (!xdr_uint32_t(xdr, &res->supported))
- return FALSE;
- - return xdr_u_int32_t(xdr, &res->access);
- + return xdr_uint32_t(xdr, &res->access);
- }
- return TRUE;
- }
- @@ -1270,7 +1270,7 @@ static bool_t encode_op_close(
- if (unexpected_op(argop->op, OP_CLOSE))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &zero)) // This should be ignored by server
- + if (!xdr_uint32_t(xdr, &zero)) // This should be ignored by server
- return FALSE;
- return xdr_stateid4(xdr, &args->stateid->stateid);
- @@ -1286,7 +1286,7 @@ static bool_t decode_op_close(
- if (unexpected_op(resop->op, OP_CLOSE))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- @@ -1308,10 +1308,10 @@ static bool_t encode_op_commit(
- if (unexpected_op(argop->op, OP_COMMIT))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->offset))
- + if (!xdr_uint64_t(xdr, &args->offset))
- return FALSE;
- - return xdr_u_int32_t(xdr, &args->count);
- + return xdr_uint32_t(xdr, &args->count);
- }
- static bool_t decode_op_commit(
- @@ -1323,7 +1323,7 @@ static bool_t decode_op_commit(
- if (unexpected_op(resop->op, OP_COMMIT))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- @@ -1343,7 +1343,7 @@ static bool_t encode_createtype4(
- bool_t result = TRUE;
- const char *linkdata;
- - if (!xdr_u_int32_t(xdr, &ct->type))
- + if (!xdr_uint32_t(xdr, &ct->type))
- return FALSE;
- switch (ct->type)
- @@ -1355,9 +1355,9 @@ static bool_t encode_createtype4(
- break;
- case NF4BLK:
- case NF4CHR:
- - result = xdr_u_int32_t(xdr, &ct->u.devdata.specdata1);
- + result = xdr_uint32_t(xdr, &ct->u.devdata.specdata1);
- if (result == TRUE)
- - result = xdr_u_int32_t(xdr, &ct->u.devdata.specdata2);
- + result = xdr_uint32_t(xdr, &ct->u.devdata.specdata2);
- break;
- default:
- // Some types need no further action
- @@ -1405,10 +1405,10 @@ static bool_t xdr_change_info4(
- if (!xdr_bool(xdr, &cinfo->atomic))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &cinfo->before))
- + if (!xdr_uint64_t(xdr, &cinfo->before))
- return FALSE;
- - return xdr_u_hyper(xdr, &cinfo->after);
- + return xdr_uint64_t(xdr, &cinfo->after);
- }
- static bool_t decode_op_create(
- @@ -1420,7 +1420,7 @@ static bool_t decode_op_create(
- if (unexpected_op(resop->op, OP_CREATE))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- @@ -1457,7 +1457,7 @@ static bool_t decode_op_link(
- if (unexpected_op(resop->op, OP_LINK))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- @@ -1485,13 +1485,13 @@ static bool_t xdr_locker4(
- if (locker->new_lock_owner) {
- /* open_to_lock_owner4 open_owner */
- - if (!xdr_u_int32_t(xdr, &locker->u.open_owner.open_seqid))
- + if (!xdr_uint32_t(xdr, &locker->u.open_owner.open_seqid))
- return FALSE;
- if (!xdr_stateid4(xdr, &locker->u.open_owner.open_stateid->stateid))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &locker->u.open_owner.lock_seqid))
- + if (!xdr_uint32_t(xdr, &locker->u.open_owner.lock_seqid))
- return FALSE;
- return xdr_state_owner4(xdr, locker->u.open_owner.lock_owner);
- @@ -1500,7 +1500,7 @@ static bool_t xdr_locker4(
- if (!xdr_stateid4(xdr, &locker->u.lock_owner.lock_stateid->stateid))
- return FALSE;
- - return xdr_u_int32_t(xdr, &locker->u.lock_owner.lock_seqid);
- + return xdr_uint32_t(xdr, &locker->u.lock_owner.lock_seqid);
- }
- }
- @@ -1513,16 +1513,16 @@ static bool_t encode_op_lock(
- if (unexpected_op(argop->op, OP_LOCK))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->locktype))
- + if (!xdr_uint32_t(xdr, &args->locktype))
- return FALSE;
- if (!xdr_bool(xdr, &args->reclaim))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->offset))
- + if (!xdr_uint64_t(xdr, &args->offset))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->length))
- + if (!xdr_uint64_t(xdr, &args->length))
- return FALSE;
- return xdr_locker4(xdr, &args->locker);
- @@ -1532,13 +1532,13 @@ static bool_t decode_lock_res_denied(
- XDR *xdr,
- lock_res_denied *denied)
- {
- - if (!xdr_u_hyper(xdr, &denied->offset))
- + if (!xdr_uint64_t(xdr, &denied->offset))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &denied->length))
- + if (!xdr_uint64_t(xdr, &denied->length))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &denied->locktype))
- + if (!xdr_uint32_t(xdr, &denied->locktype))
- return FALSE;
- return xdr_state_owner4(xdr, &denied->owner);
- @@ -1553,7 +1553,7 @@ static bool_t decode_op_lock(
- if (unexpected_op(resop->op, OP_LOCK))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- switch (res->status) {
- @@ -1583,13 +1583,13 @@ static bool_t encode_op_lockt(
- if (unexpected_op(argop->op, OP_LOCKT))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->locktype))
- + if (!xdr_uint32_t(xdr, &args->locktype))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->offset))
- + if (!xdr_uint64_t(xdr, &args->offset))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->length))
- + if (!xdr_uint64_t(xdr, &args->length))
- return FALSE;
- return xdr_state_owner4(xdr, args->owner);
- @@ -1604,7 +1604,7 @@ static bool_t decode_op_lockt(
- if (unexpected_op(resop->op, OP_LOCKT))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4ERR_DENIED)
- @@ -1626,19 +1626,19 @@ static bool_t encode_op_locku(
- if (unexpected_op(argop->op, OP_LOCKU))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->locktype))
- + if (!xdr_uint32_t(xdr, &args->locktype))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->seqid))
- + if (!xdr_uint32_t(xdr, &args->seqid))
- return FALSE;
- if (!xdr_stateid4(xdr, &args->lock_stateid->stateid))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->offset))
- + if (!xdr_uint64_t(xdr, &args->offset))
- return FALSE;
- - return xdr_u_hyper(xdr, &args->length);
- + return xdr_uint64_t(xdr, &args->length);
- }
- static bool_t decode_op_locku(
- @@ -1650,7 +1650,7 @@ static bool_t decode_op_locku(
- if (unexpected_op(resop->op, OP_LOCKU))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- @@ -1674,7 +1674,7 @@ static bool_t encode_op_delegpurge(
- /* The client SHOULD set the client field to zero,
- * and the server MUST ignore the clientid field. */
- - return xdr_u_int64_t(xdr, &zero);
- + return xdr_uint64_t(xdr, &zero);
- }
- static bool_t decode_op_delegpurge(
- @@ -1686,7 +1686,7 @@ static bool_t decode_op_delegpurge(
- if (unexpected_op(resop->op, OP_DELEGPURGE))
- return FALSE;
- - return xdr_u_int32_t(xdr, &res->status);
- + return xdr_uint32_t(xdr, &res->status);
- }
- @@ -1714,7 +1714,7 @@ static bool_t decode_op_delegreturn(
- if (unexpected_op(resop->op, OP_DELEGRETURN))
- return FALSE;
- - return xdr_u_int32_t(xdr, &res->status);
- + return xdr_uint32_t(xdr, &res->status);
- }
- @@ -1744,15 +1744,15 @@ static bool_t decode_file_attrs(
- return FALSE;
- }
- if (attrs->attrmask.arr[0] & FATTR4_WORD0_TYPE) {
- - if (!xdr_u_int32_t(xdr, &info->type))
- + if (!xdr_uint32_t(xdr, &info->type))
- return FALSE;
- }
- if (attrs->attrmask.arr[0] & FATTR4_WORD0_CHANGE) {
- - if (!xdr_u_hyper(xdr, &info->change))
- + if (!xdr_uint64_t(xdr, &info->change))
- return FALSE;
- }
- if (attrs->attrmask.arr[0] & FATTR4_WORD0_SIZE) {
- - if (!xdr_u_hyper(xdr, &info->size))
- + if (!xdr_uint64_t(xdr, &info->size))
- return FALSE;
- }
- if (attrs->attrmask.arr[0] & FATTR4_WORD0_LINK_SUPPORT) {
- @@ -1768,11 +1768,11 @@ static bool_t decode_file_attrs(
- return FALSE;
- }
- if (attrs->attrmask.arr[0] & FATTR4_WORD0_LEASE_TIME) {
- - if (!xdr_u_int32_t(xdr, &info->lease_time))
- + if (!xdr_uint32_t(xdr, &info->lease_time))
- return FALSE;
- }
- if (attrs->attrmask.arr[0] & FATTR4_WORD0_RDATTR_ERROR) {
- - if (!xdr_u_int32_t(xdr, &info->rdattr_error))
- + if (!xdr_uint32_t(xdr, &info->rdattr_error))
- return FALSE;
- }
- if (attrs->attrmask.arr[0] & FATTR4_WORD0_ACL) {
- @@ -1782,7 +1782,7 @@ static bool_t decode_file_attrs(
- return FALSE;
- }
- if (attrs->attrmask.arr[0] & FATTR4_WORD0_ACLSUPPORT) {
- - if (!xdr_u_int32_t(xdr, &info->aclsupport))
- + if (!xdr_uint32_t(xdr, &info->aclsupport))
- return FALSE;
- }
- if (attrs->attrmask.arr[0] & FATTR4_WORD0_ARCHIVE) {
- @@ -1802,7 +1802,7 @@ static bool_t decode_file_attrs(
- return FALSE;
- }
- if (attrs->attrmask.arr[0] & FATTR4_WORD0_FILEID) {
- - if (!xdr_u_hyper(xdr, &info->fileid))
- + if (!xdr_uint64_t(xdr, &info->fileid))
- return FALSE;
- }
- if (attrs->attrmask.arr[0] & FATTR4_WORD0_FS_LOCATIONS) {
- @@ -1814,21 +1814,21 @@ static bool_t decode_file_attrs(
- return FALSE;
- }
- if (attrs->attrmask.arr[0] & FATTR4_WORD0_MAXREAD) {
- - if (!xdr_u_hyper(xdr, &info->maxread))
- + if (!xdr_uint64_t(xdr, &info->maxread))
- return FALSE;
- }
- if (attrs->attrmask.arr[0] & FATTR4_WORD0_MAXWRITE) {
- - if (!xdr_u_hyper(xdr, &info->maxwrite))
- + if (!xdr_uint64_t(xdr, &info->maxwrite))
- return FALSE;
- }
- }
- if (attrs->attrmask.count > 1) {
- if (attrs->attrmask.arr[1] & FATTR4_WORD1_MODE) {
- - if (!xdr_u_int32_t(xdr, &info->mode))
- + if (!xdr_uint32_t(xdr, &info->mode))
- return FALSE;
- }
- if (attrs->attrmask.arr[1] & FATTR4_WORD1_NUMLINKS) {
- - if (!xdr_u_int32_t(xdr, &info->numlinks))
- + if (!xdr_uint32_t(xdr, &info->numlinks))
- return FALSE;
- }
- if (attrs->attrmask.arr[1] & FATTR4_WORD1_OWNER) {
- @@ -1864,19 +1864,19 @@ static bool_t decode_file_attrs(
- EASSERT(info->owner_group[0] != '\0');
- }
- if (attrs->attrmask.arr[1] & FATTR4_WORD1_SPACE_AVAIL) {
- - if (!xdr_u_hyper(xdr, &info->space_avail))
- + if (!xdr_uint64_t(xdr, &info->space_avail))
- return FALSE;
- }
- if (attrs->attrmask.arr[1] & FATTR4_WORD1_SPACE_FREE) {
- - if (!xdr_u_hyper(xdr, &info->space_free))
- + if (!xdr_uint64_t(xdr, &info->space_free))
- return FALSE;
- }
- if (attrs->attrmask.arr[1] & FATTR4_WORD1_SPACE_TOTAL) {
- - if (!xdr_u_hyper(xdr, &info->space_total))
- + if (!xdr_uint64_t(xdr, &info->space_total))
- return FALSE;
- }
- if (attrs->attrmask.arr[1] & FATTR4_WORD1_SPACE_USED) {
- - if (!xdr_u_hyper(xdr, &info->space_used))
- + if (!xdr_uint64_t(xdr, &info->space_used))
- return FALSE;
- }
- if (attrs->attrmask.arr[1] & FATTR4_WORD1_SYSTEM) {
- @@ -1918,7 +1918,7 @@ static bool_t decode_file_attrs(
- return FALSE;
- }
- if (attrs->attrmask.arr[2] & FATTR4_WORD2_CLONE_BLKSIZE) {
- - if (!xdr_u_int32_t(xdr, &info->clone_blksize))
- + if (!xdr_uint32_t(xdr, &info->clone_blksize))
- return FALSE;
- }
- }
- @@ -1934,7 +1934,7 @@ static bool_t decode_op_getattr(
- if (unexpected_op(resop->op, OP_GETATTR))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- @@ -1959,7 +1959,7 @@ static bool_t encode_createhow4(
- {
- bool_t result = TRUE;
- - if (!xdr_u_int32_t(xdr, &ch->mode))
- + if (!xdr_uint32_t(xdr, &ch->mode))
- return FALSE;
- switch (ch->mode)
- @@ -1987,7 +1987,7 @@ static bool_t encode_openflag4(
- {
- bool_t result = TRUE;
- - if (!xdr_u_int32_t(xdr, &of->opentype))
- + if (!xdr_uint32_t(xdr, &of->opentype))
- return FALSE;
- switch (of->opentype)
- @@ -2015,7 +2015,7 @@ static bool_t encode_open_claim4(
- XDR *xdr,
- open_claim4 *oc)
- {
- - if (!xdr_u_int32_t(xdr, &oc->claim))
- + if (!xdr_uint32_t(xdr, &oc->claim))
- return FALSE;
- switch (oc->claim)
- @@ -2023,7 +2023,7 @@ static bool_t encode_open_claim4(
- case CLAIM_NULL:
- return encode_component(xdr, oc->u.null.filename);
- case CLAIM_PREVIOUS:
- - return xdr_u_int32_t(xdr, &oc->u.prev.delegate_type);
- + return xdr_uint32_t(xdr, &oc->u.prev.delegate_type);
- case CLAIM_FH:
- return TRUE; /* use current file handle */
- case CLAIM_DELEGATE_CUR:
- @@ -2053,13 +2053,13 @@ static bool_t encode_op_open(
- if (unexpected_op(argop->op, OP_OPEN))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->seqid))
- + if (!xdr_uint32_t(xdr, &args->seqid))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->share_access))
- + if (!xdr_uint32_t(xdr, &args->share_access))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->share_deny))
- + if (!xdr_uint32_t(xdr, &args->share_deny))
- return FALSE;
- if (!xdr_state_owner4(xdr, args->owner))
- @@ -2110,10 +2110,10 @@ static bool_t decode_modified_limit4(
- {
- uint32_t blocks, bytes_per_block;
- - if (!xdr_u_int32_t(xdr, &blocks))
- + if (!xdr_uint32_t(xdr, &blocks))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &bytes_per_block))
- + if (!xdr_uint32_t(xdr, &bytes_per_block))
- return FALSE;
- *filesize = (uint64_t)blocks * bytes_per_block;
- @@ -2131,13 +2131,13 @@ static bool_t decode_space_limit4(
- {
- uint32_t limitby;
- - if (!xdr_u_int32_t(xdr, &limitby))
- + if (!xdr_uint32_t(xdr, &limitby))
- return FALSE;
- switch (limitby)
- {
- case NFS_LIMIT_SIZE:
- - return xdr_u_hyper(xdr, filesize);
- + return xdr_uint64_t(xdr, filesize);
- case NFS_LIMIT_BLOCKS:
- return decode_modified_limit4(xdr, filesize);
- default:
- @@ -2174,7 +2174,7 @@ static bool_t decode_open_res_ok(
- if (!xdr_change_info4(xdr, &res->cinfo))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->rflags))
- + if (!xdr_uint32_t(xdr, &res->rflags))
- return FALSE;
- if (!xdr_bitmap4(xdr, &res->attrset))
- @@ -2209,7 +2209,7 @@ static bool_t decode_op_open(
- if (unexpected_op(resop->op, OP_OPEN))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- @@ -2243,7 +2243,7 @@ static bool_t decode_op_openattr(
- if (unexpected_op(resop->op, OP_OPENATTR))
- return FALSE;
- - return xdr_u_int32_t(xdr, &res->status);
- + return xdr_uint32_t(xdr, &res->status);
- }
- @@ -2262,10 +2262,10 @@ static bool_t encode_op_read(
- if (!xdr_stateid4(xdr, &args->stateid->stateid))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->offset))
- + if (!xdr_uint64_t(xdr, &args->offset))
- return FALSE;
- - return xdr_u_int32_t(xdr, &args->count);
- + return xdr_uint32_t(xdr, &args->count);
- }
- static bool_t decode_read_res_ok(
- @@ -2279,7 +2279,7 @@ static bool_t decode_read_res_ok(
- if (!xdr_bool(xdr, &res->eof))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &count)) {
- + if (!xdr_uint32_t(xdr, &count)) {
- DPRINTF(0, ("decode_read_res_ok: decoding 'count' failed\n"));
- return FALSE;
- }
- @@ -2310,7 +2310,7 @@ static bool_t decode_op_read(
- if (unexpected_op(resop->op, OP_READ))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- @@ -2332,16 +2332,16 @@ static bool_t encode_op_readdir(
- if (unexpected_op(argop->op, OP_READDIR))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->cookie.cookie))
- + if (!xdr_uint64_t(xdr, &args->cookie.cookie))
- return FALSE;
- if (!xdr_opaque(xdr, (char *)args->cookie.verf, NFS4_VERIFIER_SIZE))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->dircount))
- + if (!xdr_uint32_t(xdr, &args->dircount))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->maxcount))
- + if (!xdr_uint32_t(xdr, &args->maxcount))
- return FALSE;
- return xdr_bitmap4(xdr, args->attr_request);
- @@ -2372,7 +2372,7 @@ static bool_t decode_readdir_entry(
- entry_len = (uint32_t)FIELD_OFFSET(nfs41_readdir_entry, name);
- attrs.attr_vals_len = NFS4_OPAQUE_LIMIT;
- - if (!xdr_u_hyper(xdr, &cookie))
- + if (!xdr_uint64_t(xdr, &cookie))
- return FALSE;
- if (!xdr_bytes(xdr, (char **)&nameptr, &name_len, NFS4_OPAQUE_LIMIT))
- @@ -2464,7 +2464,7 @@ static bool_t decode_op_readdir(
- if (unexpected_op(resop->op, OP_READDIR))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK) {
- @@ -2499,7 +2499,7 @@ static bool_t decode_op_readlink(
- if (unexpected_op(resop->op, OP_READLINK))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK) {
- @@ -2535,7 +2535,7 @@ static bool_t decode_op_remove(
- if (unexpected_op(resop->op, OP_REMOVE))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- @@ -2572,7 +2572,7 @@ static bool_t decode_op_rename(
- if (unexpected_op(resop->op, OP_RENAME))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- @@ -2608,7 +2608,7 @@ static bool_t decode_op_restorefh(
- if (unexpected_op(resop->op, OP_RESTOREFH))
- return FALSE;
- - return xdr_u_int32_t(xdr, &res->status);
- + return xdr_uint32_t(xdr, &res->status);
- }
- @@ -2635,7 +2635,7 @@ static bool_t decode_op_savefh(
- if (unexpected_op(resop->op, OP_SAVEFH))
- return FALSE;
- - return xdr_u_int32_t(xdr, &res->status);
- + return xdr_uint32_t(xdr, &res->status);
- }
- @@ -2657,7 +2657,7 @@ static bool_t encode_file_attrs(
- if (info->attrmask.count > 0) {
- if (info->attrmask.arr[0] & FATTR4_WORD0_SIZE) {
- - if (!xdr_u_hyper(&localxdr, &info->size))
- + if (!xdr_uint64_t(&localxdr, &info->size))
- return FALSE;
- attrs->attrmask.arr[0] |= FATTR4_WORD0_SIZE;
- }
- @@ -2679,7 +2679,7 @@ static bool_t encode_file_attrs(
- }
- if (info->attrmask.count > 1) {
- if (info->attrmask.arr[1] & FATTR4_WORD1_MODE) {
- - if (!xdr_u_int32_t(&localxdr, &info->mode))
- + if (!xdr_uint32_t(&localxdr, &info->mode))
- return FALSE;
- attrs->attrmask.arr[1] |= FATTR4_WORD1_MODE;
- }
- @@ -2722,9 +2722,9 @@ static bool_t encode_file_attrs(
- }
- if (info->attrmask.count > 2) {
- if (info->attrmask.arr[2] & FATTR4_WORD2_MODE_SET_MASKED) {
- - if (!xdr_u_int32_t(&localxdr, &info->mode))
- + if (!xdr_uint32_t(&localxdr, &info->mode))
- return FALSE;
- - if (!xdr_u_int32_t(&localxdr, &info->mode_mask))
- + if (!xdr_uint32_t(&localxdr, &info->mode_mask))
- return FALSE;
- attrs->attrmask.arr[2] |= FATTR4_WORD2_MODE_SET_MASKED;
- }
- @@ -2771,7 +2771,7 @@ static bool_t decode_op_setattr(
- if (unexpected_op(resop->op, OP_SETATTR))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- @@ -2793,14 +2793,14 @@ static bool_t encode_op_want_delegation(
- if (unexpected_op(argop->op, OP_WANT_DELEGATION))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->want))
- + if (!xdr_uint32_t(xdr, &args->want))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->claim->claim))
- + if (!xdr_uint32_t(xdr, &args->claim->claim))
- return FALSE;
- return args->claim->claim != CLAIM_PREVIOUS ||
- - xdr_u_int32_t(xdr, &args->claim->prev_delegate_type);
- + xdr_uint32_t(xdr, &args->claim->prev_delegate_type);
- }
- static bool_t decode_op_want_delegation(
- @@ -2812,7 +2812,7 @@ static bool_t decode_op_want_delegation(
- if (unexpected_op(resop->op, OP_WANT_DELEGATION))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status)
- @@ -2863,7 +2863,7 @@ static bool_t decode_op_free_stateid(
- if (unexpected_op(resop->op, OP_FREE_STATEID))
- return FALSE;
- - return xdr_u_int32_t(xdr, &res->status);
- + return xdr_uint32_t(xdr, &res->status);
- }
- @@ -2892,12 +2892,12 @@ static bool_t decode_op_test_stateid(
- if (unexpected_op(resop->op, OP_TEST_STATEID))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK) {
- return xdr_array(xdr, (char**)&res->resok.status, &res->resok.count,
- - res->resok.count, sizeof(uint32_t), (xdrproc_t)xdr_u_int32_t);
- + res->resok.count, sizeof(uint32_t), (xdrproc_t)xdr_uint32_t);
- }
- return TRUE;
- }
- @@ -2919,13 +2919,13 @@ static bool_t encode_op_write(
- if (!xdr_stateid4(xdr, &args->stateid->stateid))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->offset))
- + if (!xdr_uint64_t(xdr, &args->offset))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->stable))
- + if (!xdr_uint32_t(xdr, &args->stable))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->data_len))
- + if (!xdr_uint32_t(xdr, &args->data_len))
- return FALSE;
- return xdr_opaque(xdr, (char *)data, args->data_len);
- @@ -2945,7 +2945,7 @@ static bool_t xdr_write_res_ok(
- XDR *xdr,
- nfs41_write_res_ok *res)
- {
- - if (!xdr_u_int32_t(xdr, &res->count))
- + if (!xdr_uint32_t(xdr, &res->count))
- return FALSE;
- return xdr_write_verf(xdr, res->verf);
- @@ -2960,7 +2960,7 @@ static bool_t decode_op_write(
- if (unexpected_op(resop->op, OP_WRITE))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- @@ -2969,20 +2969,20 @@ static bool_t decode_op_write(
- return TRUE;
- }
- -/*
- +/*
- * OP_SECINFO_NO_NAME
- */
- static bool_t xdr_secinfo(
- XDR *xdr,
- nfs41_secinfo_info *secinfo)
- {
- - if (!xdr_u_int32_t(xdr, &secinfo->sec_flavor))
- + if (!xdr_uint32_t(xdr, &secinfo->sec_flavor))
- return FALSE;
- if (secinfo->sec_flavor == RPCSEC_GSS) {
- char *p = secinfo->oid;
- if (!xdr_bytes(xdr, (char **)&p, &secinfo->oid_len, MAX_OID_LEN))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &secinfo->qop))
- + if (!xdr_uint32_t(xdr, &secinfo->qop))
- return FALSE;
- if (!xdr_enum(xdr, (enum_t *)&secinfo->type))
- return FALSE;
- @@ -3014,7 +3014,7 @@ static bool_t decode_op_secinfo_noname(
- if (unexpected_op(resop->op, OP_SECINFO_NO_NAME))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- @@ -3024,7 +3024,7 @@ static bool_t decode_op_secinfo_noname(
- return TRUE;
- }
- -/*
- +/*
- * OP_SECINFO
- */
- static bool_t encode_op_secinfo(
- @@ -3052,7 +3052,7 @@ static bool_t decode_op_secinfo(
- if (unexpected_op(resop->op, OP_SECINFO))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- @@ -3079,7 +3079,7 @@ static bool_t encode_op_getdeviceinfo(
- if (!xdr_enum(xdr, (enum_t *)&args->layout_type))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->maxcount))
- + if (!xdr_uint32_t(xdr, &args->maxcount))
- return FALSE;
- return xdr_bitmap4(xdr, &args->notify_types);
- @@ -3091,7 +3091,7 @@ static bool_t xdr_stripe_indices(
- {
- uint32_t i, count;
- - if (!xdr_u_int32_t(xdr, &count))
- + if (!xdr_uint32_t(xdr, &count))
- return FALSE;
- if (count && count != indices->count) {
- @@ -3103,9 +3103,9 @@ static bool_t xdr_stripe_indices(
- ZeroMemory(indices->arr, count * sizeof(uint32_t));
- indices->count = count;
- }
- -
- +
- for (i = 0; i < indices->count; i++) {
- - if (!xdr_u_int32_t(xdr, &indices->arr[i]))
- + if (!xdr_uint32_t(xdr, &indices->arr[i]))
- return FALSE;
- }
- return TRUE;
- @@ -3153,7 +3153,7 @@ static bool_t xdr_multi_addr(
- netaddr4 dummy, *dest;
- uint32_t i;
- - if (!xdr_u_int32_t(xdr, &list->count))
- + if (!xdr_uint32_t(xdr, &list->count))
- return FALSE;
- for (i = 0; i < list->count; i++) {
- @@ -3172,7 +3172,7 @@ static bool_t xdr_data_server_list(
- {
- uint32_t i, count;
- - if (!xdr_u_int32_t(xdr, &count))
- + if (!xdr_uint32_t(xdr, &count))
- return FALSE;
- if (count && count != servers->count) {
- @@ -3183,7 +3183,7 @@ static bool_t xdr_data_server_list(
- servers->arr[i].client = NULL;
- tmp = realloc(servers->arr, count * sizeof(pnfs_data_server));
- - if (tmp == NULL)
- + if (tmp == NULL)
- return FALSE;
- servers->arr = tmp;
- ZeroMemory(servers->arr, count * sizeof(pnfs_data_server));
- @@ -3221,7 +3221,7 @@ static bool_t decode_getdeviceinfo_ok(
- if (res_ok->device->device.type != PNFS_LAYOUTTYPE_FILE)
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &len_ignored))
- + if (!xdr_uint32_t(xdr, &len_ignored))
- return FALSE;
- if (!xdr_file_device(xdr, res_ok->device))
- @@ -3239,7 +3239,7 @@ static bool_t decode_op_getdeviceinfo(
- if (unexpected_op(resop->op, OP_GETDEVICEINFO))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, (uint32_t *)&res->status))
- + if (!xdr_uint32_t(xdr, (uint32_t *)&res->status))
- return FALSE;
- switch (res->status) {
- @@ -3249,7 +3249,7 @@ static bool_t decode_op_getdeviceinfo(
- case NFS4ERR_TOOSMALL:
- {
- uint32_t ignored;
- - return xdr_u_int32_t(xdr, &ignored);
- + return xdr_uint32_t(xdr, &ignored);
- }
- break;
- default:
- @@ -3277,10 +3277,10 @@ static bool_t encode_op_layoutcommit(
- if (unexpected_op(argop->op, OP_LAYOUTCOMMIT))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->offset))
- + if (!xdr_uint64_t(xdr, &args->offset))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->length))
- + if (!xdr_uint64_t(xdr, &args->length))
- return FALSE;
- if (!xdr_bool(xdr, &false_bool)) /* loca_reclaim = 0 */
- @@ -3294,7 +3294,7 @@ static bool_t encode_op_layoutcommit(
- if (!xdr_bool(xdr, &true_bool))
- return FALSE;
- - if (!xdr_u_hyper(xdr, args->new_offset))
- + if (!xdr_uint64_t(xdr, args->new_offset))
- return FALSE;
- } else {
- if (!xdr_bool(xdr, &false_bool))
- @@ -3317,7 +3317,7 @@ static bool_t encode_op_layoutcommit(
- if (!xdr_enum(xdr, &pnfs_layout))
- return FALSE;
- - return xdr_u_int32_t(xdr, &zero);
- + return xdr_uint32_t(xdr, &zero);
- }
- static bool_t decode_op_layoutcommit(
- @@ -3329,7 +3329,7 @@ static bool_t decode_op_layoutcommit(
- if (unexpected_op(resop->op, OP_LAYOUTCOMMIT))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK) {
- @@ -3337,7 +3337,7 @@ static bool_t decode_op_layoutcommit(
- return FALSE;
- if (res->has_new_size)
- - if (!xdr_u_hyper(xdr, &res->new_size))
- + if (!xdr_uint64_t(xdr, &res->new_size))
- return FALSE;
- }
- return TRUE;
- @@ -3358,25 +3358,25 @@ static bool_t encode_op_layoutget(
- if (!xdr_bool(xdr, &args->signal_layout_avail))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, (u_int32_t *)&args->layout_type))
- + if (!xdr_uint32_t(xdr, (u_int32_t *)&args->layout_type))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, (u_int32_t *)&args->iomode))
- + if (!xdr_uint32_t(xdr, (u_int32_t *)&args->iomode))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->offset))
- + if (!xdr_uint64_t(xdr, &args->offset))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->length))
- + if (!xdr_uint64_t(xdr, &args->length))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->minlength))
- + if (!xdr_uint64_t(xdr, &args->minlength))
- return FALSE;
- if (!xdr_stateid4(xdr, &args->stateid->stateid))
- return FALSE;
- - return xdr_u_int32_t(xdr, &args->maxcount);
- + return xdr_uint32_t(xdr, &args->maxcount);
- }
- static bool_t decode_file_layout_handles(
- @@ -3385,7 +3385,7 @@ static bool_t decode_file_layout_handles(
- {
- uint32_t i, count;
- - if (!xdr_u_int32_t(xdr, &count))
- + if (!xdr_uint32_t(xdr, &count))
- return FALSE;
- if (count && count != handles->count) {
- @@ -3397,7 +3397,7 @@ static bool_t decode_file_layout_handles(
- ZeroMemory(handles->arr, count * sizeof(nfs41_path_fh));
- handles->count = count;
- }
- -
- +
- for (i = 0; i < handles->count; i++) {
- if (!xdr_fh(xdr, &handles->arr[i].fh))
- return FALSE;
- @@ -3413,7 +3413,7 @@ static bool_t decode_file_layout(
- pnfs_file_layout *layout;
- u_int32_t len_ignored;
- - if (!xdr_u_int32_t(xdr, &len_ignored))
- + if (!xdr_uint32_t(xdr, &len_ignored))
- return FALSE;
- layout = calloc(1, sizeof(pnfs_file_layout));
- @@ -3429,13 +3429,13 @@ static bool_t decode_file_layout(
- if (!xdr_opaque(xdr, (char *)layout->deviceid, PNFS_DEVICEID_SIZE))
- goto out_error;
- - if (!xdr_u_int32_t(xdr, &layout->util))
- + if (!xdr_uint32_t(xdr, &layout->util))
- goto out_error;
- - if (!xdr_u_int32_t(xdr, &layout->first_index))
- + if (!xdr_uint32_t(xdr, &layout->first_index))
- goto out_error;
- - if (!xdr_u_hyper(xdr, &layout->pattern_offset))
- + if (!xdr_uint64_t(xdr, &layout->pattern_offset))
- goto out_error;
- if (!decode_file_layout_handles(xdr, &layout->filehandles))
- @@ -3455,10 +3455,10 @@ static bool_t decode_layout(
- {
- pnfs_layout layout;
- - if (!xdr_u_hyper(xdr, &layout.offset))
- + if (!xdr_uint64_t(xdr, &layout.offset))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &layout.length))
- + if (!xdr_uint64_t(xdr, &layout.length))
- return FALSE;
- if (!xdr_enum(xdr, (enum_t *)&layout.iomode))
- @@ -3490,7 +3490,7 @@ static bool_t decode_layout_res_ok(
- if (!xdr_stateid4(xdr, &res->stateid))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->count))
- + if (!xdr_uint32_t(xdr, &res->count))
- return FALSE;
- for (i = 0; i < res->count; i++)
- @@ -3508,7 +3508,7 @@ static bool_t decode_op_layoutget(
- if (unexpected_op(resop->op, OP_LAYOUTGET))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, (uint32_t *)&res->status))
- + if (!xdr_uint32_t(xdr, (uint32_t *)&res->status))
- return FALSE;
- switch (res->status) {
- @@ -3552,16 +3552,16 @@ static bool_t encode_op_layoutreturn(
- if (args->return_type == PNFS_RETURN_FILE) {
- u_int32_t zero = 0;
- - if (!xdr_u_hyper(xdr, &args->offset))
- + if (!xdr_uint64_t(xdr, &args->offset))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->length))
- + if (!xdr_uint64_t(xdr, &args->length))
- return FALSE;
- if (!xdr_stateid4(xdr, args->stateid))
- return FALSE;
- - return xdr_u_int32_t(xdr, &zero); /* size of lrf_body is 0 */
- + return xdr_uint32_t(xdr, &zero); /* size of lrf_body is 0 */
- } else {
- eprintf("'%s': layout type (%d) is not PNFS_RETURN_FILE!\n",
- "encode_op_layoutreturn", args->return_type);
- @@ -3578,7 +3578,7 @@ static bool_t decode_op_layoutreturn(
- if (unexpected_op(resop->op, OP_LAYOUTRETURN))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, (uint32_t *)&res->status))
- + if (!xdr_uint32_t(xdr, (uint32_t *)&res->status))
- return FALSE;
- if (res->status == NFS4_OK) {
- @@ -3709,10 +3709,10 @@ bool_t nfs_encode_compound(
- if (!xdr_bytes(xdr, (char **)&tag, &args->tag_len, NFS4_OPAQUE_LIMIT))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->minorversion))
- + if (!xdr_uint32_t(xdr, &args->minorversion))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->argarray_count))
- + if (!xdr_uint32_t(xdr, &args->argarray_count))
- return FALSE;
- for (i = 0; i < args->argarray_count; i++)
- @@ -3721,7 +3721,7 @@ bool_t nfs_encode_compound(
- if (entry == NULL || entry->encode == NULL)
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &args->argarray[i].op))
- + if (!xdr_uint32_t(xdr, &args->argarray[i].op))
- return FALSE;
- if (!entry->encode(xdr, &args->argarray[i]))
- return FALSE;
- @@ -3738,14 +3738,14 @@ bool_t nfs_decode_compound(
- const op_table_entry *entry;
- unsigned char *tag = res->tag;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (!xdr_bytes(xdr, (char **)&tag, &res->tag_len, NFS4_OPAQUE_LIMIT))
- return FALSE;
- expected_count = res->resarray_count;
- - if (!xdr_u_int32_t(xdr, &res->resarray_count))
- + if (!xdr_uint32_t(xdr, &res->resarray_count))
- return FALSE;
- /* validate the number of operations against what we sent */
- @@ -3765,7 +3765,7 @@ bool_t nfs_decode_compound(
- for (i = 0; i < res->resarray_count; i++)
- {
- expected_op = res->resarray[i].op;
- - if (!xdr_u_int32_t(xdr, &res->resarray[i].op))
- + if (!xdr_uint32_t(xdr, &res->resarray[i].op))
- return FALSE;
- /* validate each operation number against what we sent */
- diff --git a/daemon/nfs42_xdr.c b/daemon/nfs42_xdr.c
- index 1e9c731..e3da651 100644
- --- a/daemon/nfs42_xdr.c
- +++ b/daemon/nfs42_xdr.c
- @@ -55,10 +55,10 @@ bool_t encode_op_allocate(
- if (!xdr_stateid4(xdr, &args->stateid->stateid))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->offset))
- + if (!xdr_uint64_t(xdr, &args->offset))
- return FALSE;
- - return xdr_u_hyper(xdr, &args->length);
- + return xdr_uint64_t(xdr, &args->length);
- }
- @@ -71,7 +71,7 @@ bool_t decode_op_allocate(
- if (unexpected_op(resop->op, OP_ALLOCATE))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- return TRUE;
- @@ -92,10 +92,10 @@ bool_t encode_op_deallocate(
- if (!xdr_stateid4(xdr, &args->stateid->stateid))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->offset))
- + if (!xdr_uint64_t(xdr, &args->offset))
- return FALSE;
- - return xdr_u_hyper(xdr, &args->length);
- + return xdr_uint64_t(xdr, &args->length);
- }
- @@ -108,7 +108,7 @@ bool_t decode_op_deallocate(
- if (unexpected_op(resop->op, OP_DEALLOCATE))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- return TRUE;
- @@ -130,10 +130,10 @@ bool_t encode_op_read_plus(
- if (!xdr_stateid4(xdr, &args->stateid->stateid))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->offset))
- + if (!xdr_uint64_t(xdr, &args->offset))
- return FALSE;
- - return xdr_u_int32_t(xdr, &args->count);
- + return xdr_uint32_t(xdr, &args->count);
- }
- static bool_t decode_read_plus_res_ok(
- @@ -148,7 +148,7 @@ static bool_t decode_read_plus_res_ok(
- return FALSE;
- }
- - if (!xdr_u_int32_t(xdr, &res->count)) {
- + if (!xdr_uint32_t(xdr, &res->count)) {
- DPRINTF(0, ("decode count failed\n"));
- return FALSE;
- }
- @@ -167,7 +167,7 @@ static bool_t decode_read_plus_res_ok(
- uint32_t i, co;
- for (i = 0 ; i < res->count ; i++) {
- - if (!xdr_u_int32_t(xdr, &co)) {
- + if (!xdr_uint32_t(xdr, &co)) {
- DPRINTF(0, ("i=%d, decode co failed\n", (int)i));
- return FALSE;
- }
- @@ -179,12 +179,12 @@ static bool_t decode_read_plus_res_ok(
- DPRINTF(2,
- ("i=%d, 'NFS4_CONTENT_DATA' content\n", (int)i));
- - if (!xdr_u_hyper(xdr, &contents[i].u.data.offset)) {
- + if (!xdr_uint64_t(xdr, &contents[i].u.data.offset)) {
- DPRINTF(0,
- ("i=%d, decoding 'offset' failed\n", (int)i));
- return FALSE;
- }
- - if (!xdr_u_int32_t(xdr, &contents[i].u.data.count)) {
- + if (!xdr_uint32_t(xdr, &contents[i].u.data.count)) {
- DPRINTF(0,
- ("i=%d, decoding 'count' failed\n", (int)i));
- return FALSE;
- @@ -215,9 +215,9 @@ static bool_t decode_read_plus_res_ok(
- DPRINTF(2,
- ("i=%d, 'NFS4_CONTENT_HOLE' content\n", (int)i));
- - if (!xdr_u_hyper(xdr, &contents[i].u.hole.offset))
- + if (!xdr_uint64_t(xdr, &contents[i].u.hole.offset))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &contents[i].u.hole.length))
- + if (!xdr_uint64_t(xdr, &contents[i].u.hole.length))
- return FALSE;
- @@ -266,7 +266,7 @@ bool_t decode_op_read_plus(
- if (unexpected_op(resop->op, OP_READ_PLUS))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- @@ -290,13 +290,13 @@ bool_t encode_op_seek(
- if (!xdr_stateid4(xdr, &args->stateid->stateid))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->offset))
- + if (!xdr_uint64_t(xdr, &args->offset))
- return FALSE;
- uint32_t args_what = args->what;
- EASSERT((args_what == NFS4_CONTENT_DATA) ||
- (args_what == NFS4_CONTENT_HOLE));
- - return xdr_u_int32_t(xdr, &args_what);
- + return xdr_uint32_t(xdr, &args_what);
- }
- static bool_t decode_seek_res_ok(
- @@ -308,7 +308,7 @@ static bool_t decode_seek_res_ok(
- return FALSE;
- }
- - if (!xdr_u_hyper(xdr, &res->offset)) {
- + if (!xdr_uint64_t(xdr, &res->offset)) {
- return FALSE;
- }
- @@ -324,7 +324,7 @@ bool_t decode_op_seek(
- if (unexpected_op(resop->op, OP_SEEK))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- if (res->status == NFS4_OK)
- @@ -351,13 +351,13 @@ bool_t encode_op_clone(
- if (!xdr_stateid4(xdr, &args->dst_stateid->stateid))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->src_offset))
- + if (!xdr_uint64_t(xdr, &args->src_offset))
- return FALSE;
- - if (!xdr_u_hyper(xdr, &args->dst_offset))
- + if (!xdr_uint64_t(xdr, &args->dst_offset))
- return FALSE;
- - return xdr_u_hyper(xdr, &args->count);
- + return xdr_uint64_t(xdr, &args->count);
- }
- bool_t decode_op_clone(
- @@ -369,7 +369,7 @@ bool_t decode_op_clone(
- if (unexpected_op(resop->op, OP_CLONE))
- return FALSE;
- - if (!xdr_u_int32_t(xdr, &res->status))
- + if (!xdr_uint32_t(xdr, &res->status))
- return FALSE;
- return TRUE;
- diff --git a/libtirpc/libtirpc/libtirpc.def b/libtirpc/libtirpc/libtirpc.def
- index ca28582..15aab8d 100644
- --- a/libtirpc/libtirpc/libtirpc.def
- +++ b/libtirpc/libtirpc/libtirpc.def
- @@ -60,6 +60,10 @@ xdr_float
- xdr_free
- xdr_hyper
- xdr_int
- +xdr_int8_t
- +xdr_int16_t
- +xdr_int32_t
- +xdr_int64_t
- xdr_long
- xdr_netobj
- xdr_opaque
- @@ -71,14 +75,22 @@ xdr_pointer
- xdr_reference
- xdr_replymsg
- xdr_short
- +xdr_sizeof
- xdr_string
- xdr_u_char
- xdr_u_hyper
- xdr_u_int
- +xdr_u_int8_t
- xdr_u_int32_t
- xdr_u_int64_t
- xdr_u_long
- xdr_u_short
- +xdr_uint8_t
- +xdr_uint16_t
- +xdr_uint32_t
- +xdr_uint64_t
- +xdr_quad_t
- +xdr_u_quad_t
- xdr_union
- xdr_vector
- xdr_void
- diff --git a/libtirpc/src/xdr.c b/libtirpc/src/xdr.c
- index 46c1b34..0b9b97d 100644
- --- a/libtirpc/src/xdr.c
- +++ b/libtirpc/src/xdr.c
- @@ -26,7 +26,6 @@
- * POSSIBILITY OF SUCH DAMAGE.
- */
- -//#include <sys/cdefs.h>
- /*
- * xdr.c, Generic XDR routines implementation.
- @@ -44,14 +43,10 @@
- #include <stdlib.h>
- #include <string.h>
- -#ifdef _WIN32 // CVE-2017-8779
- #include <rpc/rpc.h>
- -#endif
- #include <rpc/types.h>
- #include <rpc/xdr.h>
- -#ifdef _WIN32 // CVE-2017-8779
- #include <rpc/rpc_com.h>
- -#endif
- typedef quad_t longlong_t; /* ANSI long long type */
- typedef u_quad_t u_longlong_t; /* ANSI unsigned long long type */
- @@ -61,9 +56,6 @@ typedef u_quad_t u_longlong_t; /* ANSI unsigned long long type */
- */
- #define XDR_FALSE ((long) 0)
- #define XDR_TRUE ((long) 1)
- -#ifndef _WIN32 // CVE-2017-8779
- -#define LASTUNSIGNED ((u_int) 0-1)
- -#endif
- /*
- * for unit alignment
- @@ -263,6 +255,18 @@ xdr_u_int32_t(xdrs, u_int32_p)
- }
- +/*
- + * XDR unsigned 32-bit integers
- + */
- +bool_t
- +xdr_uint32_t(xdrs, uint32_p)
- + XDR *xdrs;
- + uint32_t *uint32_p;
- +{
- + return (xdr_u_int32_t(xdrs, (u_int32_t *)uint32_p));
- +}
- +
- +
- /*
- * XDR short integers
- */
- @@ -385,6 +389,92 @@ xdr_u_int16_t(xdrs, u_int16_p)
- }
- +/*
- + * XDR unsigned 16-bit integers
- + */
- +bool_t
- +xdr_uint16_t(xdrs, uint16_p)
- + XDR *xdrs;
- + uint16_t *uint16_p;
- +{
- + return (xdr_u_int16_t(xdrs, (u_int16_t *)uint16_p));
- +}
- +
- +
- +/*
- + * XDR 8-bit integers
- + */
- +bool_t
- +xdr_int8_t(xdrs, int8_p)
- + XDR *xdrs;
- + int8_t *int8_p;
- +{
- + long l;
- +
- + switch (xdrs->x_op) {
- +
- + case XDR_ENCODE:
- + l = (long) *int8_p;
- + return (XDR_PUTLONG(xdrs, &l));
- +
- + case XDR_DECODE:
- + if (!XDR_GETLONG(xdrs, &l)) {
- + return (FALSE);
- + }
- + *int8_p = (int8_t) l;
- + return (TRUE);
- +
- + case XDR_FREE:
- + return (TRUE);
- + }
- + /* NOTREACHED */
- + return (FALSE);
- +}
- +
- +
- +/*
- + * XDR unsigned 8-bit integers
- + */
- +bool_t
- +xdr_u_int8_t(xdrs, uint8_p)
- + XDR *xdrs;
- + uint8_t *uint8_p;
- +{
- + u_long l;
- +
- + switch (xdrs->x_op) {
- +
- + case XDR_ENCODE:
- + l = (u_long) *uint8_p;
- + return (XDR_PUTLONG(xdrs, (long *)&l));
- +
- + case XDR_DECODE:
- + if (!XDR_GETLONG(xdrs, (long *)&l)) {
- + return (FALSE);
- + }
- + *uint8_p = (uint8_t) l;
- + return (TRUE);
- +
- + case XDR_FREE:
- + return (TRUE);
- + }
- + /* NOTREACHED */
- + return (FALSE);
- +}
- +
- +
- +/*
- + * XDR unsigned 8-bit integers
- + */
- +bool_t
- +xdr_uint8_t(xdrs, uint8_p)
- + XDR *xdrs;
- + uint8_t *uint8_p;
- +{
- + return (xdr_u_int8_t(xdrs, (uint8_t *)uint8_p));
- +}
- +
- +
- /*
- * XDR a char
- */
- @@ -461,16 +551,16 @@ xdr_enum(xdrs, ep)
- {
- enum sizecheck { SIZEVAL }; /* used to find the size of an enum */
- - /*
- - * enums are treated as ints
- - */
- -
- -
- #ifdef _WIN32
- #pragma warning( push )
- -/* Disable "warning C4127: conditional expression is constant" */
- +/*
- + * warning C4127: conditional expression is constant
- + */
- #pragma warning (disable : 4127)
- -#endif
- +#endif /* _WIN32 */
- + /*
- + * enums are treated as ints
- + */
- /* LINTED */ if (sizeof (enum sizecheck) == sizeof (long)) {
- return (xdr_long(xdrs, (long *)(void *)ep));
- } else /* LINTED */ if (sizeof (enum sizecheck) == sizeof (int)) {
- @@ -482,7 +572,7 @@ xdr_enum(xdrs, ep)
- }
- #ifdef _WIN32
- #pragma warning( pop )
- -#endif
- +#endif /* _WIN32 */
- }
- /*
- @@ -551,9 +641,7 @@ xdr_bytes(xdrs, cpp, sizep, maxsize)
- {
- char *sp = *cpp; /* sp is the actual string pointer */
- u_int nodesize;
- -#ifdef _WIN32 // CVE-2017-8779
- bool_t ret, allocated = FALSE;
- -#endif
- /*
- * first deal with the length since xdr bytes are counted
- @@ -577,9 +665,7 @@ xdr_bytes(xdrs, cpp, sizep, maxsize)
- }
- if (sp == NULL) {
- *cpp = sp = mem_alloc(nodesize);
- -#ifdef _WIN32 // CVE-2017-8779
- allocated = TRUE;
- -#endif
- }
- if (sp == NULL) {
- warnx("xdr_bytes: out of memory");
- @@ -588,9 +674,6 @@ xdr_bytes(xdrs, cpp, sizep, maxsize)
- /* FALLTHROUGH */
- case XDR_ENCODE:
- -#ifndef _WIN32 // CVE-2017-8779
- - return (xdr_opaque(xdrs, sp, nodesize));
- -#else
- ret = xdr_opaque(xdrs, sp, nodesize);
- if ((xdrs->x_op == XDR_DECODE) && (ret == FALSE)) {
- if (allocated == TRUE) {
- @@ -599,7 +682,6 @@ xdr_bytes(xdrs, cpp, sizep, maxsize)
- }
- }
- return (ret);
- -#endif
- case XDR_FREE:
- if (sp != NULL) {
- @@ -693,9 +775,7 @@ xdr_string(xdrs, cpp, maxsize)
- char *sp = *cpp; /* sp is the actual string pointer */
- u_int size;
- u_int nodesize;
- -#ifdef _WIN32 // CVE-2017-8779
- bool_t ret, allocated = FALSE;
- -#endif
- /*
- * first deal with the length since xdr strings are counted-strings
- @@ -735,15 +815,10 @@ xdr_string(xdrs, cpp, maxsize)
- switch (xdrs->x_op) {
- case XDR_DECODE:
- -#ifndef _WIN32 // CVE-2017-8779
- - if (sp == NULL)
- - *cpp = sp = mem_alloc(nodesize);
- -#else
- if (sp == NULL) {
- *cpp = sp = mem_alloc(nodesize);
- allocated = TRUE;
- }
- -#endif
- if (sp == NULL) {
- warnx("xdr_string: out of memory");
- return (FALSE);
- @@ -752,9 +827,6 @@ xdr_string(xdrs, cpp, maxsize)
- /* FALLTHROUGH */
- case XDR_ENCODE:
- -#ifndef _WIN32 // CVE-2017-8779
- - return (xdr_opaque(xdrs, sp, size));
- -#else
- ret = xdr_opaque(xdrs, sp, size);
- if ((xdrs->x_op == XDR_DECODE) && (ret == FALSE)) {
- if (allocated == TRUE) {
- @@ -763,7 +835,6 @@ xdr_string(xdrs, cpp, maxsize)
- }
- }
- return (ret);
- -#endif
- case XDR_FREE:
- mem_free(sp, nodesize);
- @@ -774,8 +845,8 @@ xdr_string(xdrs, cpp, maxsize)
- return (FALSE);
- }
- -/*
- - * Wrapper for xdr_string that can be called directly from
- +/*
- + * Wrapper for xdr_string that can be called directly from
- * routines like clnt_call
- */
- bool_t
- @@ -783,11 +854,7 @@ xdr_wrapstring(xdrs, cpp)
- XDR *xdrs;
- char **cpp;
- {
- -#ifdef _WIN32 // CVE-2017-8779
- return xdr_string(xdrs, cpp, RPC_MAXDATASIZE);
- -#else
- - return xdr_string(xdrs, cpp, LASTUNSIGNED);
- -#endif
- }
- /*
- @@ -821,7 +888,8 @@ xdr_int64_t(xdrs, llp)
- if (XDR_GETLONG(xdrs, (long *)&ul[1]) == FALSE)
- return (FALSE);
- *llp = (int64_t)
- - (((u_int64_t)ul[0] << 32) | ((u_int64_t)ul[1]));
- + (((u_int64_t)ul[0] << 32) |
- + ((u_int64_t)(ul[1]) & 0xffffffff));
- return (TRUE);
- case XDR_FREE:
- return (TRUE);
- @@ -854,7 +922,8 @@ xdr_u_int64_t(xdrs, ullp)
- if (XDR_GETLONG(xdrs, (long *)&ul[1]) == FALSE)
- return (FALSE);
- *ullp = (u_int64_t)
- - (((u_int64_t)ul[0] << 32) | ((u_int64_t)ul[1]));
- + (((u_int64_t)ul[0] << 32) |
- + ((u_int64_t)(ul[1]) & 0xffffffff));
- return (TRUE);
- case XDR_FREE:
- return (TRUE);
- @@ -864,6 +933,18 @@ xdr_u_int64_t(xdrs, ullp)
- }
- +/*
- + * XDR unsigned 64-bit integers
- + */
- +bool_t
- +xdr_uint64_t(xdrs, ullp)
- + XDR *xdrs;
- + uint64_t *ullp;
- +{
- + return (xdr_u_int64_t(xdrs, (u_int64_t *)ullp));
- +}
- +
- +
- /*
- * XDR hypers
- */
- @@ -930,3 +1011,26 @@ xdr_u_longlong_t(xdrs, ullp)
- */
- return (xdr_u_int64_t(xdrs, (u_int64_t *)ullp));
- }
- +
- +/*
- + * XDR quad_t
- + */
- +bool_t
- +xdr_quad_t(xdrs, llp)
- + XDR *xdrs;
- + int64_t *llp;
- +{
- + return (xdr_int64_t(xdrs, (int64_t *)llp));
- +}
- +
- +
- +/*
- + * XDR u_quad_t
- + */
- +bool_t
- +xdr_u_quad_t(xdrs, ullp)
- + XDR *xdrs;
- + u_int64_t *ullp;
- +{
- + return (xdr_u_int64_t(xdrs, (u_int64_t *)ullp));
- +}
- diff --git a/libtirpc/tirpc/rpc/types.h b/libtirpc/tirpc/rpc/types.h
- index afb0a53..8abdfab 100644
- --- a/libtirpc/tirpc/rpc/types.h
- +++ b/libtirpc/tirpc/rpc/types.h
- @@ -33,10 +33,12 @@
- */
- /* NFSv4.1 client for Windows
- - * Copyright (C) 2012 The Regents of the University of Michigan
- + * Copyright (C) 2012 The Regents of the University of Michigan
- + * Copyright (C) 2024-2025 Roland Mainz <roland.mainz@nrubsig.org>
- *
- * Olga Kornievskaia <aglo@umich.edu>
- * Casey Bodley <cbodley@umich.edu>
- + * Roland Mainz <roland.mainz@nrubsig.org>
- *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- @@ -60,13 +62,20 @@
- #define _TIRPC_TYPES_H
- #include <sys/types.h>
- -//#include <sys/_null.h>
- +#ifndef _WIN32
- +#include <sys/_null.h>
- +#endif /* !_WIN32 */
- +#ifdef _WIN32
- // Windows mappings of data types
- // Fixed size things
- -typedef INT16 int16_t;
- +typedef signed char int8_t;
- +typedef signed short int16_t;
- typedef INT32 int32_t;
- typedef INT64 int64_t;
- +typedef unsigned char uint8_t;
- +typedef unsigned char u_int8_t;
- +typedef UINT16 uint16_t;
- typedef UINT16 u_int16_t;
- typedef UINT32 u_int32_t;
- typedef UINT32 uint32_t;
- @@ -88,7 +97,7 @@ typedef DWORD pid_t;
- //typedef SIZE_T size_t; //This is causing a "benign redefinition error"
- typedef SSIZE_T ssize_t;
- -// End of Windows...
- +#endif /* _WIN32 */
- typedef int32_t bool_t;
- typedef int32_t enum_t;
- @@ -150,7 +159,7 @@ struct t_bind {
- * not use.
- */
- struct __rpc_sockinfo {
- - ADDRESS_FAMILY si_af;
- + ADDRESS_FAMILY si_af;
- int si_proto;
- int si_socktype;
- int si_alen;
- diff --git a/libtirpc/tirpc/rpc/xdr.h b/libtirpc/tirpc/rpc/xdr.h
- index 42bfb57..39782d7 100644
- --- a/libtirpc/tirpc/rpc/xdr.h
- +++ b/libtirpc/tirpc/rpc/xdr.h
- @@ -295,12 +295,20 @@ extern bool_t xdr_long(XDR *, long *);
- extern bool_t xdr_u_long(XDR *, u_long *);
- extern bool_t xdr_short(XDR *, short *);
- extern bool_t xdr_u_short(XDR *, u_short *);
- +extern bool_t xdr_int8_t(XDR *, int8_t *);
- +extern bool_t xdr_u_int8_t(XDR *, uint8_t *);
- +extern bool_t xdr_uint8_t(XDR *, uint8_t *);
- extern bool_t xdr_int16_t(XDR *, int16_t *);
- extern bool_t xdr_u_int16_t(XDR *, u_int16_t *);
- +extern bool_t xdr_uint16_t(XDR *, uint16_t *);
- extern bool_t xdr_int32_t(XDR *, int32_t *);
- extern bool_t xdr_u_int32_t(XDR *, u_int32_t *);
- +extern bool_t xdr_uint32_t(XDR *, uint32_t *);
- extern bool_t xdr_int64_t(XDR *, int64_t *);
- extern bool_t xdr_u_int64_t(XDR *, u_int64_t *);
- +extern bool_t xdr_uint64_t(XDR *, uint64_t *);
- +extern bool_t xdr_quad_t(XDR *, int64_t *);
- +extern bool_t xdr_u_quad_t(XDR *, u_int64_t *);
- extern bool_t xdr_bool(XDR *, bool_t *);
- extern bool_t xdr_enum(XDR *, enum_t *);
- extern bool_t xdr_array(XDR *, char **, u_int *, u_int, u_int, xdrproc_t);
- @@ -322,6 +330,7 @@ extern bool_t xdr_hyper(XDR *, quad_t *);
- extern bool_t xdr_u_hyper(XDR *, u_quad_t *);
- extern bool_t xdr_longlong_t(XDR *, quad_t *);
- extern bool_t xdr_u_longlong_t(XDR *, u_quad_t *);
- +extern u_long xdr_sizeof(xdrproc_t, void *);
- __END_DECLS
- /*
- --
- 2.45.1
- From 3b9c4a13f2a480036920c45ce9111619d589cc09 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 30 May 2025 15:06:27 +0200
- Subject: [PATCH 3/5] daemon: Add |nfs41_fsid_cmp()| to compare two
- |nfs41_fsid| vars
- Add |nfs41_fsid_cmp()| to compare two |nfs41_fsid| vars
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/fsctl.c | 3 +--
- daemon/util.h | 16 ++++++++++++++++
- 2 files changed, 17 insertions(+), 2 deletions(-)
- diff --git a/daemon/fsctl.c b/daemon/fsctl.c
- index 200ae9d..b5de6b4 100644
- --- a/daemon/fsctl.c
- +++ b/daemon/fsctl.c
- @@ -743,8 +743,7 @@ int handle_duplicatedata(void *daemon_context,
- * Check whether source and destination files are on the same
- * filesystem
- */
- - if (memcmp(&src_file_fsid, &info.fsid,
- - sizeof(src_file_fsid)) != 0) {
- + if (nfs41_fsid_cmp(&src_file_fsid, &info.fsid) != 0) {
- DPRINTF(DDLVL,
- ("handle_duplicatedata: "
- "src_file_fsid(major=%llu,minor=%llu) != "
- diff --git a/daemon/util.h b/daemon/util.h
- index fa01c7e..b6e35c1 100644
- --- a/daemon/util.h
- +++ b/daemon/util.h
- @@ -180,6 +180,22 @@ static __inline int stateid4_cmp(
- return memcmp(s1->other, s2->other, NFS4_STATEID_OTHER);
- }
- +static __inline int nfs41_fsid_cmp(
- + IN const nfs41_fsid *restrict s1,
- + IN const nfs41_fsid *restrict s2)
- +{
- + if (s1->major > s2->major)
- + return 1;
- + else if (s1->major < s2->major)
- + return -1;
- + else if (s1->minor > s2->minor)
- + return 1;
- + else if (s1->minor < s2->minor)
- + return -1;
- + else
- + return 0;
- +}
- +
- static __inline void open_delegation4_cpy(
- OUT open_delegation4 *restrict dst,
- IN const open_delegation4 *restrict src)
- --
- 2.45.1
- From c875fa7ed9f7a18b0a39c001004d21ea44f0a5d6 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 30 May 2025 15:55:45 +0200
- Subject: [PATCH 4/5] build.vc19,daemon: Move fileinfoutil defines&co into new
- fileinfoutil.h
- Move fileinfoutil defines&co into new fileinfoutil.h
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- build.vc19/nfsd/nfsd.vcxproj | 1 +
- build.vc19/nfsd/nfsd.vcxproj.filters | 3 ++
- daemon/delegation.c | 4 +-
- daemon/fileinfoutil.c | 1 +
- daemon/fileinfoutil.h | 79 ++++++++++++++++++++++++++++
- daemon/getattr.c | 1 +
- daemon/lookup.c | 1 +
- daemon/open.c | 1 +
- daemon/readdir.c | 1 +
- daemon/util.h | 46 ----------------
- 10 files changed, 91 insertions(+), 47 deletions(-)
- create mode 100644 daemon/fileinfoutil.h
- diff --git a/build.vc19/nfsd/nfsd.vcxproj b/build.vc19/nfsd/nfsd.vcxproj
- index 85ab083..d5ae5a1 100644
- --- a/build.vc19/nfsd/nfsd.vcxproj
- +++ b/build.vc19/nfsd/nfsd.vcxproj
- @@ -331,6 +331,7 @@
- <ClInclude Include="..\..\daemon\cpvparser1.h" />
- <ClInclude Include="..\..\daemon\daemon_debug.h" />
- <ClInclude Include="..\..\daemon\delegation.h" />
- + <ClInclude Include="..\..\daemon\fileinfoutil.h" />
- <ClInclude Include="..\..\daemon\idmap.h" />
- <ClInclude Include="..\..\daemon\list.h" />
- <ClInclude Include="..\..\daemon\name_cache.h" />
- diff --git a/build.vc19/nfsd/nfsd.vcxproj.filters b/build.vc19/nfsd/nfsd.vcxproj.filters
- index c642442..d444636 100644
- --- a/build.vc19/nfsd/nfsd.vcxproj.filters
- +++ b/build.vc19/nfsd/nfsd.vcxproj.filters
- @@ -158,6 +158,9 @@
- <ClInclude Include="..\..\daemon\delegation.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- + <ClInclude Include="..\..\daemon\fileinfoutil.h">
- + <Filter>Header Files</Filter>
- + </ClInclude>
- <ClInclude Include="..\..\include\from_kernel.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- diff --git a/daemon/delegation.c b/daemon/delegation.c
- index 57e1342..352a4f7 100644
- --- a/daemon/delegation.c
- +++ b/daemon/delegation.c
- @@ -1,5 +1,6 @@
- /* NFSv4.1 client for Windows
- - * Copyright (C) 2012 The Regents of the University of Michigan
- + * Copyright (C) 2012 The Regents of the University of Michigan
- + * Copyright (C) 2023-2025 Roland Mainz <roland.mainz@nrubsig.org>
- *
- * Olga Kornievskaia <aglo@umich.edu>
- * Casey Bodley <cbodley@umich.edu>
- @@ -23,6 +24,7 @@
- #include "delegation.h"
- #include "nfs41_ops.h"
- #include "name_cache.h"
- +#include "fileinfoutil.h"
- #include "util.h"
- #include "daemon_debug.h"
- diff --git a/daemon/fileinfoutil.c b/daemon/fileinfoutil.c
- index 644d235..f907b38 100644
- --- a/daemon/fileinfoutil.c
- +++ b/daemon/fileinfoutil.c
- @@ -29,6 +29,7 @@
- #include "nfs41_build_features.h"
- #include "daemon_debug.h"
- #include "nfs41_daemon.h"
- +#include "fileinfoutil.h"
- #include "util.h"
- #include "nfs41_ops.h"
- #include "nfs41_driver.h" /* for |FILE_INFO_TIME_NOT_SET| */
- diff --git a/daemon/fileinfoutil.h b/daemon/fileinfoutil.h
- new file mode 100644
- index 0000000..63b8117
- --- /dev/null
- +++ b/daemon/fileinfoutil.h
- @@ -0,0 +1,79 @@
- +/* NFSv4.1 client for Windows
- + * Copyright (C) 2024-2025 Roland Mainz <roland.mainz@nrubsig.org>
- + *
- + * Roland Mainz <roland.mainz@nrubsig.org>
- + *
- + * This library is free software; you can redistribute it and/or modify it
- + * under the terms of the GNU Lesser General Public License as published by
- + * the Free Software Foundation; either version 2.1 of the License, or (at
- + * your option) any later version.
- + *
- + * This library is distributed in the hope that it will be useful, but
- + * without any warranty; without even the implied warranty of merchantability
- + * or fitness for a particular purpose. See the GNU Lesser General Public
- + * License for more details.
- + *
- + * You should have received a copy of the GNU Lesser General Public License
- + * along with this library; if not, write to the Free Software Foundation,
- + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- + */
- +
- +#ifndef __NFS41_DAEMON_FILEINFOUTIL_H__
- +#define __NFS41_DAEMON_FILEINFOUTIL_H__ 1
- +
- +#include <stdlib.h>
- +#include <stdbool.h>
- +
- +#include "nfs41_build_features.h"
- +#include "nfs41_types.h"
- +#include "from_kernel.h"
- +
- +typedef struct _FILE_ID_128 FILE_ID_128, *PFILE_ID_128;
- +typedef struct __nfs41_superblock nfs41_superblock;
- +typedef struct __nfs41_open_state nfs41_open_state;
- +
- +void nfs41_file_info_to_FILE_ID_128(
- + IN const nfs41_file_info *restrict info,
- + OUT FILE_ID_128 *restrict out_fid128);
- +ULONG nfs_file_info_to_attributes(
- + IN const nfs41_superblock *restrict superblock,
- + IN const nfs41_file_info *restrict info);
- +void nfs_to_basic_info(
- + IN const char *restrict name,
- + IN const nfs41_superblock *restrict superblock,
- + IN const nfs41_file_info *restrict info,
- + OUT PFILE_BASIC_INFO restrict basic_out);
- +void nfs_to_standard_info(
- + IN const nfs41_superblock *restrict superblock,
- + IN const nfs41_file_info *restrict info,
- + OUT PFILE_STANDARD_INFO restrict std_out);
- +void nfs_to_network_openinfo(
- + IN const char *restrict name,
- + IN const nfs41_superblock *restrict superblock,
- + IN const nfs41_file_info *restrict info,
- + OUT PFILE_NETWORK_OPEN_INFORMATION restrict std_out);
- +void nfs_to_remote_protocol_info(
- + IN nfs41_open_state *state,
- + OUT PFILE_REMOTE_PROTOCOL_INFORMATION restrict rpi_out);
- +#ifdef NFS41_DRIVER_WSL_SUPPORT
- +void nfs_to_stat_info(
- + IN const char *restrict name,
- + IN const nfs41_superblock *restrict superblock,
- + IN const nfs41_file_info *restrict info,
- + OUT PFILE_STAT_INFORMATION restrict stat_out);
- +void nfs_to_stat_lx_info(
- + IN void *daemon_context,
- + IN const char *restrict name,
- + IN const nfs41_superblock *restrict superblock,
- + IN const nfs41_file_info *restrict info,
- + OUT PFILE_STAT_LX_INFORMATION restrict stat_lx_out);
- +#endif /* NFS41_DRIVER_WSL_SUPPORT */
- +
- +/* Copy |info->symlink_dir| */
- +#define NFS41FILEINFOCPY_COPY_SYMLINK_DIR (1 << 0)
- +void nfs41_file_info_cpy(
- + OUT nfs41_file_info *restrict dest,
- + IN const nfs41_file_info *restrict src,
- + IN int flags);
- +
- +#endif /* !__NFS41_DAEMON_FILEINFOUTIL_H__ */
- diff --git a/daemon/getattr.c b/daemon/getattr.c
- index c9a0904..6d2b89e 100644
- --- a/daemon/getattr.c
- +++ b/daemon/getattr.c
- @@ -30,6 +30,7 @@
- #include "name_cache.h"
- #include "nfs41_driver.h" /* only for |NFS41_SYSOP_FILE_QUERY*| */
- #include "upcall.h"
- +#include "fileinfoutil.h"
- #include "daemon_debug.h"
- diff --git a/daemon/lookup.c b/daemon/lookup.c
- index be88a09..66188b1 100644
- --- a/daemon/lookup.c
- +++ b/daemon/lookup.c
- @@ -28,6 +28,7 @@
- #include "nfs41_compound.h"
- #include "nfs41_ops.h"
- #include "name_cache.h"
- +#include "fileinfoutil.h"
- #include "util.h"
- #include "daemon_debug.h"
- diff --git a/daemon/open.c b/daemon/open.c
- index 00b67e3..682d04d 100644
- --- a/daemon/open.c
- +++ b/daemon/open.c
- @@ -33,6 +33,7 @@
- #include "from_kernel.h"
- #include "daemon_debug.h"
- #include "upcall.h"
- +#include "fileinfoutil.h"
- #include "util.h"
- #include "idmap.h"
- #include "accesstoken.h"
- diff --git a/daemon/readdir.c b/daemon/readdir.c
- index 7110a2f..f3ec443 100644
- --- a/daemon/readdir.c
- +++ b/daemon/readdir.c
- @@ -33,6 +33,7 @@
- #include "nfs41_ops.h"
- #include "daemon_debug.h"
- #include "upcall.h"
- +#include "fileinfoutil.h"
- #include "util.h"
- diff --git a/daemon/util.h b/daemon/util.h
- index b6e35c1..30db100 100644
- --- a/daemon/util.h
- +++ b/daemon/util.h
- @@ -203,52 +203,6 @@ static __inline void open_delegation4_cpy(
- (void)memcpy(dst, src, sizeof(open_delegation4));
- }
- -typedef struct _FILE_ID_128 FILE_ID_128, *PFILE_ID_128;
- -void nfs41_file_info_to_FILE_ID_128(
- - IN const nfs41_file_info *restrict info,
- - OUT FILE_ID_128 *restrict out_fid128);
- -ULONG nfs_file_info_to_attributes(
- - IN const nfs41_superblock *restrict superblock,
- - IN const nfs41_file_info *restrict info);
- -void nfs_to_basic_info(
- - IN const char *restrict name,
- - IN const nfs41_superblock *restrict superblock,
- - IN const nfs41_file_info *restrict info,
- - OUT PFILE_BASIC_INFO restrict basic_out);
- -void nfs_to_standard_info(
- - IN const nfs41_superblock *restrict superblock,
- - IN const nfs41_file_info *restrict info,
- - OUT PFILE_STANDARD_INFO restrict std_out);
- -void nfs_to_network_openinfo(
- - IN const char *restrict name,
- - IN const nfs41_superblock *restrict superblock,
- - IN const nfs41_file_info *restrict info,
- - OUT PFILE_NETWORK_OPEN_INFORMATION restrict std_out);
- -typedef struct __nfs41_open_state nfs41_open_state;
- -void nfs_to_remote_protocol_info(
- - IN nfs41_open_state *state,
- - OUT PFILE_REMOTE_PROTOCOL_INFORMATION restrict rpi_out);
- -#ifdef NFS41_DRIVER_WSL_SUPPORT
- -void nfs_to_stat_info(
- - IN const char *restrict name,
- - IN const nfs41_superblock *restrict superblock,
- - IN const nfs41_file_info *restrict info,
- - OUT PFILE_STAT_INFORMATION restrict stat_out);
- -void nfs_to_stat_lx_info(
- - IN void *daemon_context,
- - IN const char *restrict name,
- - IN const nfs41_superblock *restrict superblock,
- - IN const nfs41_file_info *restrict info,
- - OUT PFILE_STAT_LX_INFORMATION restrict stat_lx_out);
- -#endif /* NFS41_DRIVER_WSL_SUPPORT */
- -
- -/* Copy |info->symlink_dir| */
- -#define NFS41FILEINFOCPY_COPY_SYMLINK_DIR (1 << 0)
- -void nfs41_file_info_cpy(
- - OUT nfs41_file_info *restrict dest,
- - IN const nfs41_file_info *restrict src,
- - IN int flags);
- -
- /* http://msdn.microsoft.com/en-us/library/ms724290%28VS.85%29.aspx:
- * A file time is a 64-bit value that represents the number of
- * 100-nanosecond intervals that have elapsed since 12:00 A.M.
- --
- 2.45.1
- From 65932391d7577fa8b0628155b8835d7d0530c49f Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Fri, 30 May 2025 16:18:14 +0200
- Subject: [PATCH 5/5] daemon: Fix ARM64 "Arithmetic overflow: Using operator
- '+' on a 4 byte value and then casting the result to a 8 byte value."
- warnings
- Fix ARM64 "Arithmetic overflow: Using operator '+' on a 4 byte value and
- then casting the result to a 8 byte value." warnings.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/acl.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
- diff --git a/daemon/acl.c b/daemon/acl.c
- index 0d90bc2..ecf6156 100644
- --- a/daemon/acl.c
- +++ b/daemon/acl.c
- @@ -1121,14 +1121,14 @@ add_domain:
- #ifdef NFS41_DRIVER_WS2022_HACKS
- /* Fixup |domain| for Windows Sever 2022 NFSv4.1 server */
- - if ((!strncmp(who_out, "Users@", who_size+1)) ||
- - (!strncmp(who_out, "Administrators@", who_size+1))) {
- + if ((!strncmp(who_out, "Users@", (size_t)who_size+1)) ||
- + (!strncmp(who_out, "Administrators@", (size_t)who_size+1))) {
- domain = "BUILTIN";
- DPRINTF(1,
- ("map_sid2nfs4ace_who: Fixup '%.*s' domain='%s'\n",
- (int)who_size+1, who_out, domain));
- }
- - else if (!strncmp(who_out, "SYSTEM@", who_size+1)) {
- + else if (!strncmp(who_out, "SYSTEM@", (size_t)who_size+1)) {
- domain = "NT AUTHORITY";
- DPRINTF(1,
- ("map_sid2nfs4ace_who: Fixup '%.*s' domain='%s'\n",
- --
- 2.45.1
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
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.